diff --git a/apple_pay.go b/apple_pay.go index cea9a52..d11c29c 100644 --- a/apple_pay.go +++ b/apple_pay.go @@ -82,7 +82,6 @@ type RegisterDomainResponseStatus string const ( RegisterDomainResponseStatusPending RegisterDomainResponseStatus = "PENDING" RegisterDomainResponseStatusVerified RegisterDomainResponseStatus = "VERIFIED" - RegisterDomainResponseStatusDoNotUse RegisterDomainResponseStatus = "DO_NOT_USE" ) func NewRegisterDomainResponseStatusFromString(s string) (RegisterDomainResponseStatus, error) { @@ -91,8 +90,6 @@ func NewRegisterDomainResponseStatusFromString(s string) (RegisterDomainResponse return RegisterDomainResponseStatusPending, nil case "VERIFIED": return RegisterDomainResponseStatusVerified, nil - case "DO_NOT_USE": - return RegisterDomainResponseStatusDoNotUse, nil } var t RegisterDomainResponseStatus return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/bank_accounts.go b/bank_accounts.go index 6c77aef..f1c1a0b 100644 --- a/bank_accounts.go +++ b/bank_accounts.go @@ -274,7 +274,6 @@ func (b BankAccountStatus) Ptr() *BankAccountStatus { type BankAccountType string const ( - BankAccountTypeUnknown BankAccountType = "UNKNOWN" BankAccountTypeChecking BankAccountType = "CHECKING" BankAccountTypeSavings BankAccountType = "SAVINGS" BankAccountTypeInvestment BankAccountType = "INVESTMENT" @@ -284,8 +283,6 @@ const ( func NewBankAccountTypeFromString(s string) (BankAccountType, error) { switch s { - case "UNKNOWN": - return BankAccountTypeUnknown, nil case "CHECKING": return BankAccountTypeChecking, nil case "SAVINGS": diff --git a/cards.go b/cards.go index 920197b..cbd7f67 100644 --- a/cards.go +++ b/cards.go @@ -28,7 +28,7 @@ type CreateCardRequest struct { Card *Card `json:"card,omitempty" url:"-"` } -type DisableCardRequest struct { +type CardsDisableRequest struct { // Unique ID for the desired Card. CardID string `json:"-" url:"-"` } diff --git a/cards/client.go b/cards/client.go index 9cbf5dc..3c9961b 100644 --- a/cards/client.go +++ b/cards/client.go @@ -180,7 +180,7 @@ func (c *Client) Get( // Disabling an already disabled card is allowed but has no effect. func (c *Client) Disable( ctx context.Context, - request *squaregosdk.DisableCardRequest, + request *squaregosdk.CardsDisableRequest, opts ...option.RequestOption, ) (*squaregosdk.DisableCardResponse, error) { options := core.NewRequestOptions(opts...) @@ -197,7 +197,6 @@ func (c *Client) Disable( c.header.Clone(), options.ToHeader(), ) - headers.Set("Content-Type", "application/json") var response *squaregosdk.DisableCardResponse if err := c.caller.Call( @@ -210,7 +209,6 @@ func (c *Client) Disable( BodyProperties: options.BodyProperties, QueryParameters: options.QueryParameters, Client: options.HTTPClient, - Request: request, Response: &response, }, ); err != nil { diff --git a/cashdrawers/shifts/client.go b/cashdrawers/shifts/client.go index 42d462a..bf2ef45 100644 --- a/cashdrawers/shifts/client.go +++ b/cashdrawers/shifts/client.go @@ -192,7 +192,7 @@ func (c *Client) ListEvents( } readPageResponse := func(response *squaregosdk.ListCashDrawerShiftEventsResponse) *internal.PageResponse[*string, *squaregosdk.CashDrawerShiftEvent] { next := response.Cursor - results := response.Events + results := response.CashDrawerShiftEvents return &internal.PageResponse[*string, *squaregosdk.CashDrawerShiftEvent]{ Next: next, Results: results, diff --git a/catalog.go b/catalog.go index cdf9289..3715560 100644 --- a/catalog.go +++ b/catalog.go @@ -221,7 +221,6 @@ type SearchCatalogObjectsRequest struct { type ArchivedState string const ( - ArchivedStateArchivedStateDoNotUse ArchivedState = "ARCHIVED_STATE_DO_NOT_USE" ArchivedStateArchivedStateNotArchived ArchivedState = "ARCHIVED_STATE_NOT_ARCHIVED" ArchivedStateArchivedStateArchived ArchivedState = "ARCHIVED_STATE_ARCHIVED" ArchivedStateArchivedStateAll ArchivedState = "ARCHIVED_STATE_ALL" @@ -229,8 +228,6 @@ const ( func NewArchivedStateFromString(s string) (ArchivedState, error) { switch s { - case "ARCHIVED_STATE_DO_NOT_USE": - return ArchivedStateArchivedStateDoNotUse, nil case "ARCHIVED_STATE_NOT_ARCHIVED": return ArchivedStateArchivedStateNotArchived, nil case "ARCHIVED_STATE_ARCHIVED": @@ -1665,15 +1662,12 @@ func (r *Range) String() string { type SearchCatalogItemsRequestStockLevel string const ( - SearchCatalogItemsRequestStockLevelStockLevelDoNotUse SearchCatalogItemsRequestStockLevel = "STOCK_LEVEL_DO_NOT_USE" - SearchCatalogItemsRequestStockLevelOut SearchCatalogItemsRequestStockLevel = "OUT" - SearchCatalogItemsRequestStockLevelLow SearchCatalogItemsRequestStockLevel = "LOW" + SearchCatalogItemsRequestStockLevelOut SearchCatalogItemsRequestStockLevel = "OUT" + SearchCatalogItemsRequestStockLevelLow SearchCatalogItemsRequestStockLevel = "LOW" ) func NewSearchCatalogItemsRequestStockLevelFromString(s string) (SearchCatalogItemsRequestStockLevel, error) { switch s { - case "STOCK_LEVEL_DO_NOT_USE": - return SearchCatalogItemsRequestStockLevelStockLevelDoNotUse, nil case "OUT": return SearchCatalogItemsRequestStockLevelOut, nil case "LOW": diff --git a/checkout.go b/checkout.go index ff0a8d5..d2531a5 100644 --- a/checkout.go +++ b/checkout.go @@ -200,16 +200,13 @@ func (c *CheckoutLocationSettingsBranding) String() string { type CheckoutLocationSettingsBrandingButtonShape string const ( - CheckoutLocationSettingsBrandingButtonShapeButtonShapeDoNotUse CheckoutLocationSettingsBrandingButtonShape = "BUTTON_SHAPE_DO_NOT_USE" - CheckoutLocationSettingsBrandingButtonShapeSquared CheckoutLocationSettingsBrandingButtonShape = "SQUARED" - CheckoutLocationSettingsBrandingButtonShapeRounded CheckoutLocationSettingsBrandingButtonShape = "ROUNDED" - CheckoutLocationSettingsBrandingButtonShapePill CheckoutLocationSettingsBrandingButtonShape = "PILL" + CheckoutLocationSettingsBrandingButtonShapeSquared CheckoutLocationSettingsBrandingButtonShape = "SQUARED" + CheckoutLocationSettingsBrandingButtonShapeRounded CheckoutLocationSettingsBrandingButtonShape = "ROUNDED" + CheckoutLocationSettingsBrandingButtonShapePill CheckoutLocationSettingsBrandingButtonShape = "PILL" ) func NewCheckoutLocationSettingsBrandingButtonShapeFromString(s string) (CheckoutLocationSettingsBrandingButtonShape, error) { switch s { - case "BUTTON_SHAPE_DO_NOT_USE": - return CheckoutLocationSettingsBrandingButtonShapeButtonShapeDoNotUse, nil case "SQUARED": return CheckoutLocationSettingsBrandingButtonShapeSquared, nil case "ROUNDED": @@ -228,16 +225,13 @@ func (c CheckoutLocationSettingsBrandingButtonShape) Ptr() *CheckoutLocationSett type CheckoutLocationSettingsBrandingHeaderType string const ( - CheckoutLocationSettingsBrandingHeaderTypeHeaderTypeDoNotUse CheckoutLocationSettingsBrandingHeaderType = "HEADER_TYPE_DO_NOT_USE" - CheckoutLocationSettingsBrandingHeaderTypeBusinessName CheckoutLocationSettingsBrandingHeaderType = "BUSINESS_NAME" - CheckoutLocationSettingsBrandingHeaderTypeFramedLogo CheckoutLocationSettingsBrandingHeaderType = "FRAMED_LOGO" - CheckoutLocationSettingsBrandingHeaderTypeFullWidthLogo CheckoutLocationSettingsBrandingHeaderType = "FULL_WIDTH_LOGO" + CheckoutLocationSettingsBrandingHeaderTypeBusinessName CheckoutLocationSettingsBrandingHeaderType = "BUSINESS_NAME" + CheckoutLocationSettingsBrandingHeaderTypeFramedLogo CheckoutLocationSettingsBrandingHeaderType = "FRAMED_LOGO" + CheckoutLocationSettingsBrandingHeaderTypeFullWidthLogo CheckoutLocationSettingsBrandingHeaderType = "FULL_WIDTH_LOGO" ) func NewCheckoutLocationSettingsBrandingHeaderTypeFromString(s string) (CheckoutLocationSettingsBrandingHeaderType, error) { switch s { - case "HEADER_TYPE_DO_NOT_USE": - return CheckoutLocationSettingsBrandingHeaderTypeHeaderTypeDoNotUse, nil case "BUSINESS_NAME": return CheckoutLocationSettingsBrandingHeaderTypeBusinessName, nil case "FRAMED_LOGO": diff --git a/client/client.go b/client/client.go index 40bdd3f..64f73d5 100644 --- a/client/client.go +++ b/client/client.go @@ -43,7 +43,7 @@ import ( teamclient "github.com/square/square-go-sdk/team/client" teammembers "github.com/square/square-go-sdk/teammembers" terminalclient "github.com/square/square-go-sdk/terminal/client" - v1client "github.com/square/square-go-sdk/v1/client" + v1transactions "github.com/square/square-go-sdk/v1transactions" vendors "github.com/square/square-go-sdk/vendors" webhooksclient "github.com/square/square-go-sdk/webhooks/client" http "net/http" @@ -57,6 +57,7 @@ type Client struct { Mobile *mobile.Client OAuth *oauth.Client + V1Transactions *v1transactions.Client ApplePay *applepay.Client BankAccounts *bankaccounts.Client Bookings *bookingsclient.Client @@ -93,7 +94,6 @@ type Client struct { CashDrawers *cashdrawersclient.Client Customer *customerclient.Client Team *teamclient.Client - V1 *v1client.Client Webhooks *webhooksclient.Client } @@ -116,6 +116,7 @@ func NewClient(opts ...option.RequestOption) *Client { header: options.ToHeader(), Mobile: mobile.NewClient(opts...), OAuth: oauth.NewClient(opts...), + V1Transactions: v1transactions.NewClient(opts...), ApplePay: applepay.NewClient(opts...), BankAccounts: bankaccounts.NewClient(opts...), Bookings: bookingsclient.NewClient(opts...), @@ -152,7 +153,6 @@ func NewClient(opts ...option.RequestOption) *Client { CashDrawers: cashdrawersclient.NewClient(opts...), Customer: customerclient.NewClient(opts...), Team: teamclient.NewClient(opts...), - V1: v1client.NewClient(opts...), Webhooks: webhooksclient.NewClient(opts...), } } diff --git a/core/request_option.go b/core/request_option.go index da01c1e..097af6b 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -64,7 +64,7 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/square/square-go-sdk") - headers.Set("X-Fern-SDK-Version", "v0.0.163") + headers.Set("X-Fern-SDK-Version", "v0.0.172") return headers } diff --git a/customers.go b/customers.go index 57a66d5..e5f4c13 100644 --- a/customers.go +++ b/customers.go @@ -1029,8 +1029,6 @@ type Customer struct { Note *string `json:"note,omitempty" url:"note,omitempty"` // Represents general customer preferences. Preferences *CustomerPreferences `json:"preferences,omitempty" url:"preferences,omitempty"` - // The customer groups and segments the customer belongs to. This deprecated field has been replaced with the dedicated `group_ids` for customer groups and the dedicated `segment_ids` field for customer segments. You can retrieve information about a given customer group and segment respectively using the Customer Groups API and Customer Segments API. - Groups []*CustomerGroupInfo `json:"groups,omitempty" url:"groups,omitempty"` // The method used to create the customer profile. // See [CustomerCreationSource](#type-customercreationsource) for possible values CreationSource *CustomerCreationSource `json:"creation_source,omitempty" url:"creation_source,omitempty"` @@ -1153,13 +1151,6 @@ func (c *Customer) GetPreferences() *CustomerPreferences { return c.Preferences } -func (c *Customer) GetGroups() []*CustomerGroupInfo { - if c == nil { - return nil - } - return c.Groups -} - func (c *Customer) GetCreationSource() *CustomerCreationSource { if c == nil { return nil @@ -1910,63 +1901,6 @@ func (c *CustomerFilter) String() string { return fmt.Sprintf("%#v", c) } -// Contains some brief information about a Customer Group with its identifier included. -type CustomerGroupInfo struct { - // The ID of the Customer Group. - ID string `json:"id" url:"id"` - // The name of the Customer Group. - Name string `json:"name" url:"name"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (c *CustomerGroupInfo) GetID() string { - if c == nil { - return "" - } - return c.ID -} - -func (c *CustomerGroupInfo) GetName() string { - if c == nil { - return "" - } - return c.Name -} - -func (c *CustomerGroupInfo) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *CustomerGroupInfo) UnmarshalJSON(data []byte) error { - type unmarshaler CustomerGroupInfo - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = CustomerGroupInfo(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err - } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil -} - -func (c *CustomerGroupInfo) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - // Indicates whether customers should be included in, or excluded from, // the result set when they match the filtering criteria. type CustomerInclusionExclusion string diff --git a/devices.go b/devices.go index e0a0ad8..d551e3c 100644 --- a/devices.go +++ b/devices.go @@ -29,51 +29,7 @@ type DevicesListRequest struct { LocationID *string `json:"-" url:"location_id,omitempty"` } -type ApplicationType string - -const ( - ApplicationTypeApplicationInvalidType ApplicationType = "APPLICATION_INVALID_TYPE" - ApplicationTypeSquarePos ApplicationType = "SQUARE_POS" - ApplicationTypeRetail ApplicationType = "RETAIL" - ApplicationTypeRestaurant ApplicationType = "RESTAURANT" - ApplicationTypeInvoices ApplicationType = "INVOICES" - ApplicationTypeAppointments ApplicationType = "APPOINTMENTS" - ApplicationTypeKds ApplicationType = "KDS" - ApplicationTypeTerminalAPI ApplicationType = "TERMINAL_API" - ApplicationTypeReaderSdk ApplicationType = "READER_SDK" - ApplicationTypeFnbKiosk ApplicationType = "FNB_KIOSK" -) - -func NewApplicationTypeFromString(s string) (ApplicationType, error) { - switch s { - case "APPLICATION_INVALID_TYPE": - return ApplicationTypeApplicationInvalidType, nil - case "SQUARE_POS": - return ApplicationTypeSquarePos, nil - case "RETAIL": - return ApplicationTypeRetail, nil - case "RESTAURANT": - return ApplicationTypeRestaurant, nil - case "INVOICES": - return ApplicationTypeInvoices, nil - case "APPOINTMENTS": - return ApplicationTypeAppointments, nil - case "KDS": - return ApplicationTypeKds, nil - case "TERMINAL_API": - return ApplicationTypeTerminalAPI, nil - case "READER_SDK": - return ApplicationTypeReaderSdk, nil - case "FNB_KIOSK": - return ApplicationTypeFnbKiosk, nil - } - var t ApplicationType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (a ApplicationType) Ptr() *ApplicationType { - return &a -} +type ApplicationType = string // The wrapper object for the component entries of a given component type. type Component struct { @@ -174,29 +130,16 @@ func (c *Component) String() string { type ComponentComponentType string const ( - ComponentComponentTypeComponentInvalidType ComponentComponentType = "COMPONENT_INVALID_TYPE" - ComponentComponentTypeApplication ComponentComponentType = "APPLICATION" - ComponentComponentTypeCardReader ComponentComponentType = "CARD_READER" - ComponentComponentTypeBattery ComponentComponentType = "BATTERY" - ComponentComponentTypeWifi ComponentComponentType = "WIFI" - ComponentComponentTypeEthernet ComponentComponentType = "ETHERNET" - ComponentComponentTypePrinter ComponentComponentType = "PRINTER" - ComponentComponentTypeScale ComponentComponentType = "SCALE" - ComponentComponentTypeBarcodeScanner ComponentComponentType = "BARCODE_SCANNER" - ComponentComponentTypeUsbInterface ComponentComponentType = "USB_INTERFACE" - ComponentComponentTypeBluetoothInterface ComponentComponentType = "BLUETOOTH_INTERFACE" - ComponentComponentTypeNetworkInterface ComponentComponentType = "NETWORK_INTERFACE" - ComponentComponentTypeAirprintInterface ComponentComponentType = "AIRPRINT_INTERFACE" - ComponentComponentTypeAudioInterface ComponentComponentType = "AUDIO_INTERFACE" - ComponentComponentTypeCellularData ComponentComponentType = "CELLULAR_DATA" - ComponentComponentTypeStand ComponentComponentType = "STAND" - ComponentComponentTypeScannerScale ComponentComponentType = "SCANNER_SCALE" + ComponentComponentTypeApplication ComponentComponentType = "APPLICATION" + ComponentComponentTypeCardReader ComponentComponentType = "CARD_READER" + ComponentComponentTypeBattery ComponentComponentType = "BATTERY" + ComponentComponentTypeWifi ComponentComponentType = "WIFI" + ComponentComponentTypeEthernet ComponentComponentType = "ETHERNET" + ComponentComponentTypePrinter ComponentComponentType = "PRINTER" ) func NewComponentComponentTypeFromString(s string) (ComponentComponentType, error) { switch s { - case "COMPONENT_INVALID_TYPE": - return ComponentComponentTypeComponentInvalidType, nil case "APPLICATION": return ComponentComponentTypeApplication, nil case "CARD_READER": @@ -209,26 +152,6 @@ func NewComponentComponentTypeFromString(s string) (ComponentComponentType, erro return ComponentComponentTypeEthernet, nil case "PRINTER": return ComponentComponentTypePrinter, nil - case "SCALE": - return ComponentComponentTypeScale, nil - case "BARCODE_SCANNER": - return ComponentComponentTypeBarcodeScanner, nil - case "USB_INTERFACE": - return ComponentComponentTypeUsbInterface, nil - case "BLUETOOTH_INTERFACE": - return ComponentComponentTypeBluetoothInterface, nil - case "NETWORK_INTERFACE": - return ComponentComponentTypeNetworkInterface, nil - case "AIRPRINT_INTERFACE": - return ComponentComponentTypeAirprintInterface, nil - case "AUDIO_INTERFACE": - return ComponentComponentTypeAudioInterface, nil - case "CELLULAR_DATA": - return ComponentComponentTypeCellularData, nil - case "STAND": - return ComponentComponentTypeStand, nil - case "SCANNER_SCALE": - return ComponentComponentTypeScannerScale, nil } var t ComponentComponentType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -316,7 +239,7 @@ func (d *Device) String() string { type DeviceAttributes struct { // The device type. // See [DeviceType](#type-devicetype) for possible values - Type DeviceAttributesDeviceType `json:"type" url:"type"` + Type DeviceAttributesDeviceType `json:"type,omitempty" url:"type,omitempty"` // The maker of the device. Manufacturer string `json:"manufacturer" url:"manufacturer"` // The specific model of the device. @@ -338,13 +261,6 @@ type DeviceAttributes struct { rawJSON json.RawMessage } -func (d *DeviceAttributes) GetType() DeviceAttributesDeviceType { - if d == nil { - return "" - } - return d.Type -} - func (d *DeviceAttributes) GetManufacturer() string { if d == nil { return "" @@ -427,60 +343,7 @@ func (d *DeviceAttributes) String() string { } // An enum identifier of the device type. -type DeviceAttributesDeviceType string - -const ( - DeviceAttributesDeviceTypeDeviceTypeInvalidType DeviceAttributesDeviceType = "DEVICE_TYPE_INVALID_TYPE" - DeviceAttributesDeviceTypeTerminal DeviceAttributesDeviceType = "TERMINAL" - DeviceAttributesDeviceTypeRegister DeviceAttributesDeviceType = "REGISTER" - DeviceAttributesDeviceTypeIos DeviceAttributesDeviceType = "IOS" - DeviceAttributesDeviceTypeAndroid DeviceAttributesDeviceType = "ANDROID" - DeviceAttributesDeviceTypeCashDrawer DeviceAttributesDeviceType = "CASH_DRAWER" - DeviceAttributesDeviceTypePrinter DeviceAttributesDeviceType = "PRINTER" - DeviceAttributesDeviceTypeReader DeviceAttributesDeviceType = "READER" - DeviceAttributesDeviceTypeScale DeviceAttributesDeviceType = "SCALE" - DeviceAttributesDeviceTypeBarcodeScanner DeviceAttributesDeviceType = "BARCODE_SCANNER" - DeviceAttributesDeviceTypeStand DeviceAttributesDeviceType = "STAND" - DeviceAttributesDeviceTypeInternalPrinter DeviceAttributesDeviceType = "INTERNAL_PRINTER" - DeviceAttributesDeviceTypeScannerScale DeviceAttributesDeviceType = "SCANNER_SCALE" -) - -func NewDeviceAttributesDeviceTypeFromString(s string) (DeviceAttributesDeviceType, error) { - switch s { - case "DEVICE_TYPE_INVALID_TYPE": - return DeviceAttributesDeviceTypeDeviceTypeInvalidType, nil - case "TERMINAL": - return DeviceAttributesDeviceTypeTerminal, nil - case "REGISTER": - return DeviceAttributesDeviceTypeRegister, nil - case "IOS": - return DeviceAttributesDeviceTypeIos, nil - case "ANDROID": - return DeviceAttributesDeviceTypeAndroid, nil - case "CASH_DRAWER": - return DeviceAttributesDeviceTypeCashDrawer, nil - case "PRINTER": - return DeviceAttributesDeviceTypePrinter, nil - case "READER": - return DeviceAttributesDeviceTypeReader, nil - case "SCALE": - return DeviceAttributesDeviceTypeScale, nil - case "BARCODE_SCANNER": - return DeviceAttributesDeviceTypeBarcodeScanner, nil - case "STAND": - return DeviceAttributesDeviceTypeStand, nil - case "INTERNAL_PRINTER": - return DeviceAttributesDeviceTypeInternalPrinter, nil - case "SCANNER_SCALE": - return DeviceAttributesDeviceTypeScannerScale, nil - } - var t DeviceAttributesDeviceType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (d DeviceAttributesDeviceType) Ptr() *DeviceAttributesDeviceType { - return &d -} +type DeviceAttributesDeviceType = string type DeviceComponentDetailsApplicationDetails struct { // The type of application. @@ -497,13 +360,6 @@ type DeviceComponentDetailsApplicationDetails struct { rawJSON json.RawMessage } -func (d *DeviceComponentDetailsApplicationDetails) GetApplicationType() *ApplicationType { - if d == nil { - return nil - } - return d.ApplicationType -} - func (d *DeviceComponentDetailsApplicationDetails) GetVersion() *string { if d == nil { return nil @@ -721,17 +577,14 @@ func (d *DeviceComponentDetailsEthernetDetails) String() string { type DeviceComponentDetailsExternalPower string const ( - DeviceComponentDetailsExternalPowerExternalPowerInvalidType DeviceComponentDetailsExternalPower = "EXTERNAL_POWER_INVALID_TYPE" - DeviceComponentDetailsExternalPowerAvailableCharging DeviceComponentDetailsExternalPower = "AVAILABLE_CHARGING" - DeviceComponentDetailsExternalPowerAvailableNotInUse DeviceComponentDetailsExternalPower = "AVAILABLE_NOT_IN_USE" - DeviceComponentDetailsExternalPowerUnavailable DeviceComponentDetailsExternalPower = "UNAVAILABLE" - DeviceComponentDetailsExternalPowerAvailableInsufficient DeviceComponentDetailsExternalPower = "AVAILABLE_INSUFFICIENT" + DeviceComponentDetailsExternalPowerAvailableCharging DeviceComponentDetailsExternalPower = "AVAILABLE_CHARGING" + DeviceComponentDetailsExternalPowerAvailableNotInUse DeviceComponentDetailsExternalPower = "AVAILABLE_NOT_IN_USE" + DeviceComponentDetailsExternalPowerUnavailable DeviceComponentDetailsExternalPower = "UNAVAILABLE" + DeviceComponentDetailsExternalPowerAvailableInsufficient DeviceComponentDetailsExternalPower = "AVAILABLE_INSUFFICIENT" ) func NewDeviceComponentDetailsExternalPowerFromString(s string) (DeviceComponentDetailsExternalPower, error) { switch s { - case "EXTERNAL_POWER_INVALID_TYPE": - return DeviceComponentDetailsExternalPowerExternalPowerInvalidType, nil case "AVAILABLE_CHARGING": return DeviceComponentDetailsExternalPowerAvailableCharging, nil case "AVAILABLE_NOT_IN_USE": @@ -930,23 +783,17 @@ func (d *DeviceStatus) String() string { type DeviceStatusCategory string const ( - DeviceStatusCategoryDeviceStatusInvalidType DeviceStatusCategory = "DEVICE_STATUS_INVALID_TYPE" - DeviceStatusCategoryAvailable DeviceStatusCategory = "AVAILABLE" - DeviceStatusCategoryNeedsAttention DeviceStatusCategory = "NEEDS_ATTENTION" - DeviceStatusCategoryCritical DeviceStatusCategory = "CRITICAL" - DeviceStatusCategoryOffline DeviceStatusCategory = "OFFLINE" + DeviceStatusCategoryAvailable DeviceStatusCategory = "AVAILABLE" + DeviceStatusCategoryNeedsAttention DeviceStatusCategory = "NEEDS_ATTENTION" + DeviceStatusCategoryOffline DeviceStatusCategory = "OFFLINE" ) func NewDeviceStatusCategoryFromString(s string) (DeviceStatusCategory, error) { switch s { - case "DEVICE_STATUS_INVALID_TYPE": - return DeviceStatusCategoryDeviceStatusInvalidType, nil case "AVAILABLE": return DeviceStatusCategoryAvailable, nil case "NEEDS_ATTENTION": return DeviceStatusCategoryNeedsAttention, nil - case "CRITICAL": - return DeviceStatusCategoryCritical, nil case "OFFLINE": return DeviceStatusCategoryOffline, nil } diff --git a/disputes.go b/disputes.go index f46392a..dbfb9ca 100644 --- a/disputes.go +++ b/disputes.go @@ -486,41 +486,25 @@ func (d *Dispute) String() string { type DisputeReason string const ( - DisputeReasonUnknownReason DisputeReason = "UNKNOWN_REASON" DisputeReasonAmountDiffers DisputeReason = "AMOUNT_DIFFERS" DisputeReasonCancelled DisputeReason = "CANCELLED" - DisputeReasonCompliance DisputeReason = "COMPLIANCE" - DisputeReasonDissatisfied DisputeReason = "DISSATISFIED" DisputeReasonDuplicate DisputeReason = "DUPLICATE" - DisputeReasonFraud DisputeReason = "FRAUD" DisputeReasonNoKnowledge DisputeReason = "NO_KNOWLEDGE" DisputeReasonNotAsDescribed DisputeReason = "NOT_AS_DESCRIBED" DisputeReasonNotReceived DisputeReason = "NOT_RECEIVED" DisputeReasonPaidByOtherMeans DisputeReason = "PAID_BY_OTHER_MEANS" DisputeReasonCustomerRequestsCredit DisputeReason = "CUSTOMER_REQUESTS_CREDIT" - DisputeReasonUnauthorized DisputeReason = "UNAUTHORIZED" - DisputeReasonReturned DisputeReason = "RETURNED" - DisputeReasonInsufficientResponse DisputeReason = "INSUFFICIENT_RESPONSE" - DisputeReasonRequestDocumentation DisputeReason = "REQUEST_DOCUMENTATION" DisputeReasonEmvLiabilityShift DisputeReason = "EMV_LIABILITY_SHIFT" ) func NewDisputeReasonFromString(s string) (DisputeReason, error) { switch s { - case "UNKNOWN_REASON": - return DisputeReasonUnknownReason, nil case "AMOUNT_DIFFERS": return DisputeReasonAmountDiffers, nil case "CANCELLED": return DisputeReasonCancelled, nil - case "COMPLIANCE": - return DisputeReasonCompliance, nil - case "DISSATISFIED": - return DisputeReasonDissatisfied, nil case "DUPLICATE": return DisputeReasonDuplicate, nil - case "FRAUD": - return DisputeReasonFraud, nil case "NO_KNOWLEDGE": return DisputeReasonNoKnowledge, nil case "NOT_AS_DESCRIBED": @@ -531,14 +515,6 @@ func NewDisputeReasonFromString(s string) (DisputeReason, error) { return DisputeReasonPaidByOtherMeans, nil case "CUSTOMER_REQUESTS_CREDIT": return DisputeReasonCustomerRequestsCredit, nil - case "UNAUTHORIZED": - return DisputeReasonUnauthorized, nil - case "RETURNED": - return DisputeReasonReturned, nil - case "INSUFFICIENT_RESPONSE": - return DisputeReasonInsufficientResponse, nil - case "REQUEST_DOCUMENTATION": - return DisputeReasonRequestDocumentation, nil case "EMV_LIABILITY_SHIFT": return DisputeReasonEmvLiabilityShift, nil } @@ -554,7 +530,6 @@ func (d DisputeReason) Ptr() *DisputeReason { type DisputeState string const ( - DisputeStateUnknownState DisputeState = "UNKNOWN_STATE" DisputeStateInquiryEvidenceRequired DisputeState = "INQUIRY_EVIDENCE_REQUIRED" DisputeStateInquiryProcessing DisputeState = "INQUIRY_PROCESSING" DisputeStateInquiryClosed DisputeState = "INQUIRY_CLOSED" @@ -563,13 +538,10 @@ const ( DisputeStateWon DisputeState = "WON" DisputeStateLost DisputeState = "LOST" DisputeStateAccepted DisputeState = "ACCEPTED" - DisputeStateWaitingThirdParty DisputeState = "WAITING_THIRD_PARTY" ) func NewDisputeStateFromString(s string) (DisputeState, error) { switch s { - case "UNKNOWN_STATE": - return DisputeStateUnknownState, nil case "INQUIRY_EVIDENCE_REQUIRED": return DisputeStateInquiryEvidenceRequired, nil case "INQUIRY_PROCESSING": @@ -586,8 +558,6 @@ func NewDisputeStateFromString(s string) (DisputeState, error) { return DisputeStateLost, nil case "ACCEPTED": return DisputeStateAccepted, nil - case "WAITING_THIRD_PARTY": - return DisputeStateWaitingThirdParty, nil } var t DisputeState return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/employees.go b/employees.go index ebe259d..3349c45 100644 --- a/employees.go +++ b/employees.go @@ -163,15 +163,12 @@ func (e *Employee) String() string { type EmployeeStatus string const ( - EmployeeStatusDoNotUse EmployeeStatus = "DO_NOT_USE" EmployeeStatusActive EmployeeStatus = "ACTIVE" EmployeeStatusInactive EmployeeStatus = "INACTIVE" ) func NewEmployeeStatusFromString(s string) (EmployeeStatus, error) { switch s { - case "DO_NOT_USE": - return EmployeeStatusDoNotUse, nil case "ACTIVE": return EmployeeStatusActive, nil case "INACTIVE": diff --git a/gift_cards.go b/gift_cards.go index 4d7280b..92f190c 100644 --- a/gift_cards.go +++ b/gift_cards.go @@ -442,15 +442,12 @@ func (g *GiftCard) String() string { type GiftCardGanSource string const ( - GiftCardGanSourceGanSourceDoNotUse GiftCardGanSource = "GAN_SOURCE_DO_NOT_USE" - GiftCardGanSourceSquare GiftCardGanSource = "SQUARE" - GiftCardGanSourceOther GiftCardGanSource = "OTHER" + GiftCardGanSourceSquare GiftCardGanSource = "SQUARE" + GiftCardGanSourceOther GiftCardGanSource = "OTHER" ) func NewGiftCardGanSourceFromString(s string) (GiftCardGanSource, error) { switch s { - case "GAN_SOURCE_DO_NOT_USE": - return GiftCardGanSourceGanSourceDoNotUse, nil case "SQUARE": return GiftCardGanSourceSquare, nil case "OTHER": @@ -468,21 +465,14 @@ func (g GiftCardGanSource) Ptr() *GiftCardGanSource { type GiftCardStatus string const ( - GiftCardStatusStatusDoNotUse GiftCardStatus = "STATUS_DO_NOT_USE" - GiftCardStatusNotActive GiftCardStatus = "NOT_ACTIVE" - GiftCardStatusActive GiftCardStatus = "ACTIVE" - GiftCardStatusDeactivated GiftCardStatus = "DEACTIVATED" - GiftCardStatusBlocked GiftCardStatus = "BLOCKED" - GiftCardStatusPending GiftCardStatus = "PENDING" - GiftCardStatusUnregistered GiftCardStatus = "UNREGISTERED" + GiftCardStatusActive GiftCardStatus = "ACTIVE" + GiftCardStatusDeactivated GiftCardStatus = "DEACTIVATED" + GiftCardStatusBlocked GiftCardStatus = "BLOCKED" + GiftCardStatusPending GiftCardStatus = "PENDING" ) func NewGiftCardStatusFromString(s string) (GiftCardStatus, error) { switch s { - case "STATUS_DO_NOT_USE": - return GiftCardStatusStatusDoNotUse, nil - case "NOT_ACTIVE": - return GiftCardStatusNotActive, nil case "ACTIVE": return GiftCardStatusActive, nil case "DEACTIVATED": @@ -491,8 +481,6 @@ func NewGiftCardStatusFromString(s string) (GiftCardStatus, error) { return GiftCardStatusBlocked, nil case "PENDING": return GiftCardStatusPending, nil - case "UNREGISTERED": - return GiftCardStatusUnregistered, nil } var t GiftCardStatus return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -506,15 +494,12 @@ func (g GiftCardStatus) Ptr() *GiftCardStatus { type GiftCardType string const ( - GiftCardTypeTypeDoNotUse GiftCardType = "TYPE_DO_NOT_USE" - GiftCardTypePhysical GiftCardType = "PHYSICAL" - GiftCardTypeDigital GiftCardType = "DIGITAL" + GiftCardTypePhysical GiftCardType = "PHYSICAL" + GiftCardTypeDigital GiftCardType = "DIGITAL" ) func NewGiftCardTypeFromString(s string) (GiftCardType, error) { switch s { - case "TYPE_DO_NOT_USE": - return GiftCardTypeTypeDoNotUse, nil case "PHYSICAL": return GiftCardTypePhysical, nil case "DIGITAL": diff --git a/inventory.go b/inventory.go index a8d8165..51caa02 100644 --- a/inventory.go +++ b/inventory.go @@ -447,9 +447,6 @@ type BatchRetrieveInventoryChangesRequest struct { // The filter to return results by `InventoryChangeType` values other than `TRANSFER`. // The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. Types []InventoryChangeType `json:"types,omitempty" url:"types,omitempty"` - // The filter to return results by `InventoryState` values. - // Use the `states` filter as its replacement. - Statuses []InventoryState `json:"statuses,omitempty" url:"statuses,omitempty"` // The filter to return `ADJUSTMENT` query results by // `InventoryState`. This filter is only applied when set. // The default value is null. @@ -495,13 +492,6 @@ func (b *BatchRetrieveInventoryChangesRequest) GetTypes() []InventoryChangeType return b.Types } -func (b *BatchRetrieveInventoryChangesRequest) GetStatuses() []InventoryState { - if b == nil { - return nil - } - return b.Statuses -} - func (b *BatchRetrieveInventoryChangesRequest) GetStates() []InventoryState { if b == nil { return nil @@ -885,14 +875,6 @@ type InventoryAdjustment struct { // system. ReferenceID *string `json:"reference_id,omitempty" url:"reference_id,omitempty"` // The [inventory state](entity:InventoryState) of the related quantity - // of items before the adjustment. Replaced by the `from_state` field. - // See [InventoryState](#type-inventorystate) for possible values - FromStatus *InventoryState `json:"from_status,omitempty" url:"from_status,omitempty"` - // The [inventory state](entity:InventoryState) of the related quantity - // of items after the adjustment. Replaced by the `to_state` field. - // See [InventoryState](#type-inventorystate) for possible values - ToStatus *InventoryState `json:"to_status,omitempty" url:"to_status,omitempty"` - // The [inventory state](entity:InventoryState) of the related quantity // of items before the adjustment. // See [InventoryState](#type-inventorystate) for possible values FromState *InventoryState `json:"from_state,omitempty" url:"from_state,omitempty"` @@ -901,14 +883,6 @@ type InventoryAdjustment struct { // See [InventoryState](#type-inventorystate) for possible values ToState *InventoryState `json:"to_state,omitempty" url:"to_state,omitempty"` // The Square-generated ID of the [Location](entity:Location) where the related - // quantity of items is being tracked before the adjustment. Replaced by - // `from_location_id` of [InventoryTransfer](entity:InventoryTransfer). - FromLocationID *string `json:"from_location_id,omitempty" url:"from_location_id,omitempty"` - // The Square-generated ID of the [Location](entity:Location) where the related - // quantity of items is being tracked after the adjustment. Replaced by - // `to_location_id` of [InventoryTransfer](entity:InventoryTransfer). - ToLocationID *string `json:"to_location_id,omitempty" url:"to_location_id,omitempty"` - // The Square-generated ID of the [Location](entity:Location) where the related // quantity of items is being tracked. LocationID *string `json:"location_id,omitempty" url:"location_id,omitempty"` // The Square-generated ID of the @@ -979,20 +953,6 @@ func (i *InventoryAdjustment) GetReferenceID() *string { return i.ReferenceID } -func (i *InventoryAdjustment) GetFromStatus() *InventoryState { - if i == nil { - return nil - } - return i.FromStatus -} - -func (i *InventoryAdjustment) GetToStatus() *InventoryState { - if i == nil { - return nil - } - return i.ToStatus -} - func (i *InventoryAdjustment) GetFromState() *InventoryState { if i == nil { return nil @@ -1007,20 +967,6 @@ func (i *InventoryAdjustment) GetToState() *InventoryState { return i.ToState } -func (i *InventoryAdjustment) GetFromLocationID() *string { - if i == nil { - return nil - } - return i.FromLocationID -} - -func (i *InventoryAdjustment) GetToLocationID() *string { - if i == nil { - return nil - } - return i.ToLocationID -} - func (i *InventoryAdjustment) GetLocationID() *string { if i == nil { return nil @@ -1346,25 +1292,19 @@ func (i *InventoryChange) String() string { type InventoryChangeType string const ( - InventoryChangeTypeInventoryChangeTypeDoNotUse InventoryChangeType = "INVENTORY_CHANGE_TYPE_DO_NOT_USE" - InventoryChangeTypePhysicalCount InventoryChangeType = "PHYSICAL_COUNT" - InventoryChangeTypeAdjustment InventoryChangeType = "ADJUSTMENT" - InventoryChangeTypeTransfer InventoryChangeType = "TRANSFER" - InventoryChangeTypeAvailability InventoryChangeType = "AVAILABILITY" + InventoryChangeTypePhysicalCount InventoryChangeType = "PHYSICAL_COUNT" + InventoryChangeTypeAdjustment InventoryChangeType = "ADJUSTMENT" + InventoryChangeTypeTransfer InventoryChangeType = "TRANSFER" ) func NewInventoryChangeTypeFromString(s string) (InventoryChangeType, error) { switch s { - case "INVENTORY_CHANGE_TYPE_DO_NOT_USE": - return InventoryChangeTypeInventoryChangeTypeDoNotUse, nil case "PHYSICAL_COUNT": return InventoryChangeTypePhysicalCount, nil case "ADJUSTMENT": return InventoryChangeTypeAdjustment, nil case "TRANSFER": return InventoryChangeTypeTransfer, nil - case "AVAILABILITY": - return InventoryChangeTypeAvailability, nil } var t InventoryChangeType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -1387,10 +1327,6 @@ type InventoryCount struct { // In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app. CatalogObjectType *string `json:"catalog_object_type,omitempty" url:"catalog_object_type,omitempty"` // The current [inventory state](entity:InventoryState) for the related - // quantity of items. Replaced by the `state` field. - // See [InventoryState](#type-inventorystate) for possible values - Status *InventoryState `json:"status,omitempty" url:"status,omitempty"` - // The current [inventory state](entity:InventoryState) for the related // quantity of items. // See [InventoryState](#type-inventorystate) for possible values State *InventoryState `json:"state,omitempty" url:"state,omitempty"` @@ -1428,13 +1364,6 @@ func (i *InventoryCount) GetCatalogObjectType() *string { return i.CatalogObjectType } -func (i *InventoryCount) GetStatus() *InventoryState { - if i == nil { - return nil - } - return i.Status -} - func (i *InventoryCount) GetState() *InventoryState { if i == nil { return nil @@ -1523,10 +1452,6 @@ type InventoryPhysicalCount struct { // In addition, it can also read the `"catalog_object_type": "ITEM"` field value that is set by the Square Restaurants app. CatalogObjectType *string `json:"catalog_object_type,omitempty" url:"catalog_object_type,omitempty"` // The current [inventory state](entity:InventoryState) for the related - // quantity of items. It is replaced by the `state` field. - // See [InventoryState](#type-inventorystate) for possible values - Status *InventoryState `json:"status,omitempty" url:"status,omitempty"` - // The current [inventory state](entity:InventoryState) for the related // quantity of items. // See [InventoryState](#type-inventorystate) for possible values State *InventoryState `json:"state,omitempty" url:"state,omitempty"` @@ -1585,13 +1510,6 @@ func (i *InventoryPhysicalCount) GetCatalogObjectType() *string { return i.CatalogObjectType } -func (i *InventoryPhysicalCount) GetStatus() *InventoryState { - if i == nil { - return nil - } - return i.Status -} - func (i *InventoryPhysicalCount) GetState() *InventoryState { if i == nil { return nil @@ -1684,7 +1602,6 @@ func (i *InventoryPhysicalCount) String() string { type InventoryState string const ( - InventoryStateInventoryStateDoNotUse InventoryState = "INVENTORY_STATE_DO_NOT_USE" InventoryStateCustom InventoryState = "CUSTOM" InventoryStateInStock InventoryState = "IN_STOCK" InventoryStateSold InventoryState = "SOLD" @@ -1705,8 +1622,6 @@ const ( func NewInventoryStateFromString(s string) (InventoryState, error) { switch s { - case "INVENTORY_STATE_DO_NOT_USE": - return InventoryStateInventoryStateDoNotUse, nil case "CUSTOM": return InventoryStateCustom, nil case "IN_STOCK": diff --git a/invoices.go b/invoices.go index 2a19649..ddcf59e 100644 --- a/invoices.go +++ b/invoices.go @@ -946,16 +946,13 @@ func (i *InvoiceAttachment) String() string { type InvoiceAutomaticPaymentSource string const ( - InvoiceAutomaticPaymentSourceInvoiceAutomaticPaymentSourceDoNotUse InvoiceAutomaticPaymentSource = "INVOICE_AUTOMATIC_PAYMENT_SOURCE_DO_NOT_USE" - InvoiceAutomaticPaymentSourceNone InvoiceAutomaticPaymentSource = "NONE" - InvoiceAutomaticPaymentSourceCardOnFile InvoiceAutomaticPaymentSource = "CARD_ON_FILE" - InvoiceAutomaticPaymentSourceBankOnFile InvoiceAutomaticPaymentSource = "BANK_ON_FILE" + InvoiceAutomaticPaymentSourceNone InvoiceAutomaticPaymentSource = "NONE" + InvoiceAutomaticPaymentSourceCardOnFile InvoiceAutomaticPaymentSource = "CARD_ON_FILE" + InvoiceAutomaticPaymentSourceBankOnFile InvoiceAutomaticPaymentSource = "BANK_ON_FILE" ) func NewInvoiceAutomaticPaymentSourceFromString(s string) (InvoiceAutomaticPaymentSource, error) { switch s { - case "INVOICE_AUTOMATIC_PAYMENT_SOURCE_DO_NOT_USE": - return InvoiceAutomaticPaymentSourceInvoiceAutomaticPaymentSourceDoNotUse, nil case "NONE": return InvoiceAutomaticPaymentSourceNone, nil case "CARD_ON_FILE": @@ -1047,15 +1044,12 @@ func (i *InvoiceCustomField) String() string { type InvoiceCustomFieldPlacement string const ( - InvoiceCustomFieldPlacementUnknownPlacementDoNotUse InvoiceCustomFieldPlacement = "UNKNOWN_PLACEMENT_DO_NOT_USE" - InvoiceCustomFieldPlacementAboveLineItems InvoiceCustomFieldPlacement = "ABOVE_LINE_ITEMS" - InvoiceCustomFieldPlacementBelowLineItems InvoiceCustomFieldPlacement = "BELOW_LINE_ITEMS" + InvoiceCustomFieldPlacementAboveLineItems InvoiceCustomFieldPlacement = "ABOVE_LINE_ITEMS" + InvoiceCustomFieldPlacementBelowLineItems InvoiceCustomFieldPlacement = "BELOW_LINE_ITEMS" ) func NewInvoiceCustomFieldPlacementFromString(s string) (InvoiceCustomFieldPlacement, error) { switch s { - case "UNKNOWN_PLACEMENT_DO_NOT_USE": - return InvoiceCustomFieldPlacementUnknownPlacementDoNotUse, nil case "ABOVE_LINE_ITEMS": return InvoiceCustomFieldPlacementAboveLineItems, nil case "BELOW_LINE_ITEMS": @@ -1073,16 +1067,13 @@ func (i InvoiceCustomFieldPlacement) Ptr() *InvoiceCustomFieldPlacement { type InvoiceDeliveryMethod string const ( - InvoiceDeliveryMethodInvoiceDeliveryMethodDoNotUse InvoiceDeliveryMethod = "INVOICE_DELIVERY_METHOD_DO_NOT_USE" - InvoiceDeliveryMethodEmail InvoiceDeliveryMethod = "EMAIL" - InvoiceDeliveryMethodShareManually InvoiceDeliveryMethod = "SHARE_MANUALLY" - InvoiceDeliveryMethodSms InvoiceDeliveryMethod = "SMS" + InvoiceDeliveryMethodEmail InvoiceDeliveryMethod = "EMAIL" + InvoiceDeliveryMethodShareManually InvoiceDeliveryMethod = "SHARE_MANUALLY" + InvoiceDeliveryMethodSms InvoiceDeliveryMethod = "SMS" ) func NewInvoiceDeliveryMethodFromString(s string) (InvoiceDeliveryMethod, error) { switch s { - case "INVOICE_DELIVERY_METHOD_DO_NOT_USE": - return InvoiceDeliveryMethodInvoiceDeliveryMethodDoNotUse, nil case "EMAIL": return InvoiceDeliveryMethodEmail, nil case "SHARE_MANUALLY": @@ -1252,16 +1243,13 @@ func (i *InvoicePaymentReminder) String() string { type InvoicePaymentReminderStatus string const ( - InvoicePaymentReminderStatusInvoicePaymentReminderStatusDoNotUse InvoicePaymentReminderStatus = "INVOICE_PAYMENT_REMINDER_STATUS_DO_NOT_USE" - InvoicePaymentReminderStatusPending InvoicePaymentReminderStatus = "PENDING" - InvoicePaymentReminderStatusNotApplicable InvoicePaymentReminderStatus = "NOT_APPLICABLE" - InvoicePaymentReminderStatusSent InvoicePaymentReminderStatus = "SENT" + InvoicePaymentReminderStatusPending InvoicePaymentReminderStatus = "PENDING" + InvoicePaymentReminderStatusNotApplicable InvoicePaymentReminderStatus = "NOT_APPLICABLE" + InvoicePaymentReminderStatusSent InvoicePaymentReminderStatus = "SENT" ) func NewInvoicePaymentReminderStatusFromString(s string) (InvoicePaymentReminderStatus, error) { switch s { - case "INVOICE_PAYMENT_REMINDER_STATUS_DO_NOT_USE": - return InvoicePaymentReminderStatusInvoicePaymentReminderStatusDoNotUse, nil case "PENDING": return InvoicePaymentReminderStatusPending, nil case "NOT_APPLICABLE": @@ -1713,20 +1701,17 @@ func (i *InvoiceRecipientTaxIDs) String() string { type InvoiceRequestMethod string const ( - InvoiceRequestMethodInvoiceRequestMethodDoNotUse InvoiceRequestMethod = "INVOICE_REQUEST_METHOD_DO_NOT_USE" - InvoiceRequestMethodEmail InvoiceRequestMethod = "EMAIL" - InvoiceRequestMethodChargeCardOnFile InvoiceRequestMethod = "CHARGE_CARD_ON_FILE" - InvoiceRequestMethodShareManually InvoiceRequestMethod = "SHARE_MANUALLY" - InvoiceRequestMethodChargeBankOnFile InvoiceRequestMethod = "CHARGE_BANK_ON_FILE" - InvoiceRequestMethodSms InvoiceRequestMethod = "SMS" - InvoiceRequestMethodSmsChargeCardOnFile InvoiceRequestMethod = "SMS_CHARGE_CARD_ON_FILE" - InvoiceRequestMethodSmsChargeBankOnFile InvoiceRequestMethod = "SMS_CHARGE_BANK_ON_FILE" + InvoiceRequestMethodEmail InvoiceRequestMethod = "EMAIL" + InvoiceRequestMethodChargeCardOnFile InvoiceRequestMethod = "CHARGE_CARD_ON_FILE" + InvoiceRequestMethodShareManually InvoiceRequestMethod = "SHARE_MANUALLY" + InvoiceRequestMethodChargeBankOnFile InvoiceRequestMethod = "CHARGE_BANK_ON_FILE" + InvoiceRequestMethodSms InvoiceRequestMethod = "SMS" + InvoiceRequestMethodSmsChargeCardOnFile InvoiceRequestMethod = "SMS_CHARGE_CARD_ON_FILE" + InvoiceRequestMethodSmsChargeBankOnFile InvoiceRequestMethod = "SMS_CHARGE_BANK_ON_FILE" ) func NewInvoiceRequestMethodFromString(s string) (InvoiceRequestMethod, error) { switch s { - case "INVOICE_REQUEST_METHOD_DO_NOT_USE": - return InvoiceRequestMethodInvoiceRequestMethodDoNotUse, nil case "EMAIL": return InvoiceRequestMethodEmail, nil case "CHARGE_CARD_ON_FILE": @@ -1755,16 +1740,13 @@ func (i InvoiceRequestMethod) Ptr() *InvoiceRequestMethod { type InvoiceRequestType string const ( - InvoiceRequestTypeInvoiceRequestTypeDoNotUse InvoiceRequestType = "INVOICE_REQUEST_TYPE_DO_NOT_USE" - InvoiceRequestTypeBalance InvoiceRequestType = "BALANCE" - InvoiceRequestTypeDeposit InvoiceRequestType = "DEPOSIT" - InvoiceRequestTypeInstallment InvoiceRequestType = "INSTALLMENT" + InvoiceRequestTypeBalance InvoiceRequestType = "BALANCE" + InvoiceRequestTypeDeposit InvoiceRequestType = "DEPOSIT" + InvoiceRequestTypeInstallment InvoiceRequestType = "INSTALLMENT" ) func NewInvoiceRequestTypeFromString(s string) (InvoiceRequestType, error) { switch s { - case "INVOICE_REQUEST_TYPE_DO_NOT_USE": - return InvoiceRequestTypeInvoiceRequestTypeDoNotUse, nil case "BALANCE": return InvoiceRequestTypeBalance, nil case "DEPOSIT": @@ -1784,7 +1766,7 @@ func (i InvoiceRequestType) Ptr() *InvoiceRequestType { type InvoiceSort struct { // The field to use for sorting. // See [InvoiceSortField](#type-invoicesortfield) for possible values - Field InvoiceSortField `json:"field" url:"field"` + Field InvoiceSortField `json:"field,omitempty" url:"field,omitempty"` // The order to use for sorting the results. // See [SortOrder](#type-sortorder) for possible values Order *SortOrder `json:"order,omitempty" url:"order,omitempty"` @@ -1793,13 +1775,6 @@ type InvoiceSort struct { rawJSON json.RawMessage } -func (i *InvoiceSort) GetField() InvoiceSortField { - if i == nil { - return "" - } - return i.Field -} - func (i *InvoiceSort) GetOrder() *SortOrder { if i == nil { return nil @@ -1840,49 +1815,26 @@ func (i *InvoiceSort) String() string { } // The field to use for sorting. -type InvoiceSortField string - -const ( - InvoiceSortFieldInvoiceSortFieldDoNotUse InvoiceSortField = "INVOICE_SORT_FIELD_DO_NOT_USE" - InvoiceSortFieldInvoiceSortDate InvoiceSortField = "INVOICE_SORT_DATE" -) - -func NewInvoiceSortFieldFromString(s string) (InvoiceSortField, error) { - switch s { - case "INVOICE_SORT_FIELD_DO_NOT_USE": - return InvoiceSortFieldInvoiceSortFieldDoNotUse, nil - case "INVOICE_SORT_DATE": - return InvoiceSortFieldInvoiceSortDate, nil - } - var t InvoiceSortField - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (i InvoiceSortField) Ptr() *InvoiceSortField { - return &i -} +type InvoiceSortField = string // Indicates the status of an invoice. type InvoiceStatus string const ( - InvoiceStatusInvoiceStatusDoNotUse InvoiceStatus = "INVOICE_STATUS_DO_NOT_USE" - InvoiceStatusDraft InvoiceStatus = "DRAFT" - InvoiceStatusUnpaid InvoiceStatus = "UNPAID" - InvoiceStatusScheduled InvoiceStatus = "SCHEDULED" - InvoiceStatusPartiallyPaid InvoiceStatus = "PARTIALLY_PAID" - InvoiceStatusPaid InvoiceStatus = "PAID" - InvoiceStatusPartiallyRefunded InvoiceStatus = "PARTIALLY_REFUNDED" - InvoiceStatusRefunded InvoiceStatus = "REFUNDED" - InvoiceStatusCanceled InvoiceStatus = "CANCELED" - InvoiceStatusFailed InvoiceStatus = "FAILED" - InvoiceStatusPaymentPending InvoiceStatus = "PAYMENT_PENDING" + InvoiceStatusDraft InvoiceStatus = "DRAFT" + InvoiceStatusUnpaid InvoiceStatus = "UNPAID" + InvoiceStatusScheduled InvoiceStatus = "SCHEDULED" + InvoiceStatusPartiallyPaid InvoiceStatus = "PARTIALLY_PAID" + InvoiceStatusPaid InvoiceStatus = "PAID" + InvoiceStatusPartiallyRefunded InvoiceStatus = "PARTIALLY_REFUNDED" + InvoiceStatusRefunded InvoiceStatus = "REFUNDED" + InvoiceStatusCanceled InvoiceStatus = "CANCELED" + InvoiceStatusFailed InvoiceStatus = "FAILED" + InvoiceStatusPaymentPending InvoiceStatus = "PAYMENT_PENDING" ) func NewInvoiceStatusFromString(s string) (InvoiceStatus, error) { switch s { - case "INVOICE_STATUS_DO_NOT_USE": - return InvoiceStatusInvoiceStatusDoNotUse, nil case "DRAFT": return InvoiceStatusDraft, nil case "UNPAID": diff --git a/mobile.go b/mobile.go index 35acd3d..aaf02fa 100644 --- a/mobile.go +++ b/mobile.go @@ -22,9 +22,6 @@ type CreateMobileAuthorizationCodeResponse struct { // The timestamp when `authorization_code` expires, in // [RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, "2016-09-04T23:59:33.123Z"). ExpiresAt *string `json:"expires_at,omitempty" url:"expires_at,omitempty"` - // An error object that provides details about how creation of the authorization - // code failed. - Error *Error `json:"error,omitempty" url:"error,omitempty"` // Any errors that occurred during the request. Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"` @@ -46,13 +43,6 @@ func (c *CreateMobileAuthorizationCodeResponse) GetExpiresAt() *string { return c.ExpiresAt } -func (c *CreateMobileAuthorizationCodeResponse) GetError() *Error { - if c == nil { - return nil - } - return c.Error -} - func (c *CreateMobileAuthorizationCodeResponse) GetErrors() []*Error { if c == nil { return nil diff --git a/o_auth.go b/o_auth.go index 9b09071..d92c2a8 100644 --- a/o_auth.go +++ b/o_auth.go @@ -8,40 +8,6 @@ import ( internal "github.com/square/square-go-sdk/internal" ) -type OAuthAuthorizeRequest struct { - // The Square-issued ID for your application, which is available on - // the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps). - ClientID string `json:"-" url:"client_id"` - // A space-separated list of the permissions that the application is requesting. - // Default: "`MERCHANT_PROFILE_READ PAYMENTS_READ SETTLEMENTS_READ BANK_ACCOUNTS_READ`" - Scope *OAuthPermission `json:"-" url:"scope,omitempty"` - // The locale to present the permission request form in. Square detects - // the appropriate locale automatically. Only provide this value if the - // application can definitively determine the preferred locale. - // - // Currently supported values: `en-IE`, `en-US`, `en-CA`, `es-US`, `fr-CA`, and - // `ja-JP`. - Locale *string `json:"-" url:"locale,omitempty"` - // If `false`, the user must log in to their Square account to - // view the Permission Request form, even if they already have a valid user - // session. This value has no effect in the Square Sandbox. - // Default: `true` - Session *bool `json:"-" url:"session,omitempty"` - // When provided, `state` is passed to the configured redirect URL after - // the Permission Request form is submitted. You can include `state` and verify - // its value to help protect against cross-site request forgery. - State *string `json:"-" url:"state,omitempty"` - // When provided, the OAuth flow uses PKCE to authorize. The `code_challenge` will be associated - // with the authorization_code and a `code_verifier` will need to passed in to obtain the access token. - CodeChallenge *string `json:"-" url:"code_challenge,omitempty"` - // The redirect URL assigned on the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps). - // This field is required to use a dynamic port at runtime (PKCE only). To use a dynamic port, use the literal "<port>" - // as a placeholder for a port in the **Redirect URL** box in the [Developer Dashboard](https://developer.squareup.com/apps), - // for example, "http://localhost:<port>". When you call the `Authorize` endpoint from an application, pass in the actual - // port in this field. For example: `https://connect.squareup.com/oauth2/authorize?client_id={YOUR_APP_ID}&scope=MERCHANT_PROFILE_READ&redirect_uri=http://localhost:8000` - RedirectURI *string `json:"-" url:"redirect_uri,omitempty"` -} - type ObtainTokenRequest struct { // The Square-issued ID of your application, which is available on the **OAuth** page in the // [Developer Dashboard](https://developer.squareup.com/apps). @@ -89,13 +55,6 @@ type ObtainTokenRequest struct { CodeVerifier *string `json:"code_verifier,omitempty" url:"-"` } -type RenewTokenRequest struct { - // Your application ID, which is available on the **OAuth** page in the [Developer Dashboard](https://developer.squareup.com/apps). - ClientID string `json:"-" url:"-"` - // The token you want to renew. - AccessToken *string `json:"access_token,omitempty" url:"-"` -} - type RevokeTokenRequest struct { // The Square-issued ID for your application, which is available on the **OAuth** page in the // [Developer Dashboard](https://developer.squareup.com/apps). @@ -112,256 +71,6 @@ type RevokeTokenRequest struct { RevokeOnlyAccessToken *bool `json:"revoke_only_access_token,omitempty" url:"-"` } -type AuthorizeResponse struct { - // A valid authorization code. Authorization codes are exchanged - // for OAuth access tokens with the `ObtainToken` endpoint. - Code *string `json:"code,omitempty" url:"code,omitempty"` - // The same value specified in the request. - State *string `json:"state,omitempty" url:"state,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (a *AuthorizeResponse) GetCode() *string { - if a == nil { - return nil - } - return a.Code -} - -func (a *AuthorizeResponse) GetState() *string { - if a == nil { - return nil - } - return a.State -} - -func (a *AuthorizeResponse) GetExtraProperties() map[string]interface{} { - return a.extraProperties -} - -func (a *AuthorizeResponse) UnmarshalJSON(data []byte) error { - type unmarshaler AuthorizeResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *a = AuthorizeResponse(value) - extraProperties, err := internal.ExtractExtraProperties(data, *a) - if err != nil { - return err - } - a.extraProperties = extraProperties - a.rawJSON = json.RawMessage(data) - return nil -} - -func (a *AuthorizeResponse) String() string { - if len(a.rawJSON) > 0 { - if value, err := internal.StringifyJSON(a.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(a); err == nil { - return value - } - return fmt.Sprintf("%#v", a) -} - -// When you direct your user to the permissions form, you specify the -// scope of the permissions your application will have. Personal access tokens -// have all available permissions (at the time the application was created) by default. -// -// **Important:** Never request more than the minimum permissions required for your application -// to function properly. -type OAuthPermission string - -const ( - OAuthPermissionBankAccountsRead OAuthPermission = "BANK_ACCOUNTS_READ" - OAuthPermissionCashDrawerRead OAuthPermission = "CASH_DRAWER_READ" - OAuthPermissionCustomersRead OAuthPermission = "CUSTOMERS_READ" - OAuthPermissionCustomersWrite OAuthPermission = "CUSTOMERS_WRITE" - OAuthPermissionDeviceCredentialManagement OAuthPermission = "DEVICE_CREDENTIAL_MANAGEMENT" - OAuthPermissionEmployeesRead OAuthPermission = "EMPLOYEES_READ" - OAuthPermissionEmployeesWrite OAuthPermission = "EMPLOYEES_WRITE" - OAuthPermissionInventoryRead OAuthPermission = "INVENTORY_READ" - OAuthPermissionInventoryWrite OAuthPermission = "INVENTORY_WRITE" - OAuthPermissionItemsRead OAuthPermission = "ITEMS_READ" - OAuthPermissionItemsWrite OAuthPermission = "ITEMS_WRITE" - OAuthPermissionLoyaltyRead OAuthPermission = "LOYALTY_READ" - OAuthPermissionLoyaltyWrite OAuthPermission = "LOYALTY_WRITE" - OAuthPermissionMerchantProfileRead OAuthPermission = "MERCHANT_PROFILE_READ" - OAuthPermissionOrdersRead OAuthPermission = "ORDERS_READ" - OAuthPermissionOrdersWrite OAuthPermission = "ORDERS_WRITE" - OAuthPermissionPaymentsRead OAuthPermission = "PAYMENTS_READ" - OAuthPermissionPaymentsWrite OAuthPermission = "PAYMENTS_WRITE" - OAuthPermissionPaymentsWriteAdditionalRecipients OAuthPermission = "PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS" - OAuthPermissionPaymentsWriteInPerson OAuthPermission = "PAYMENTS_WRITE_IN_PERSON" - OAuthPermissionSettlementsRead OAuthPermission = "SETTLEMENTS_READ" - OAuthPermissionTimecardsRead OAuthPermission = "TIMECARDS_READ" - OAuthPermissionTimecardsWrite OAuthPermission = "TIMECARDS_WRITE" - OAuthPermissionTimecardsSettingsRead OAuthPermission = "TIMECARDS_SETTINGS_READ" - OAuthPermissionTimecardsSettingsWrite OAuthPermission = "TIMECARDS_SETTINGS_WRITE" - OAuthPermissionAppointmentsRead OAuthPermission = "APPOINTMENTS_READ" - OAuthPermissionAppointmentsWrite OAuthPermission = "APPOINTMENTS_WRITE" - OAuthPermissionAppointmentsBusinessSettingsRead OAuthPermission = "APPOINTMENTS_BUSINESS_SETTINGS_READ" - OAuthPermissionInvoicesRead OAuthPermission = "INVOICES_READ" - OAuthPermissionInvoicesWrite OAuthPermission = "INVOICES_WRITE" - OAuthPermissionSubscriptionsRead OAuthPermission = "SUBSCRIPTIONS_READ" - OAuthPermissionSubscriptionsWrite OAuthPermission = "SUBSCRIPTIONS_WRITE" - OAuthPermissionDisputesRead OAuthPermission = "DISPUTES_READ" - OAuthPermissionDisputesWrite OAuthPermission = "DISPUTES_WRITE" - OAuthPermissionGiftcardsRead OAuthPermission = "GIFTCARDS_READ" - OAuthPermissionGiftcardsWrite OAuthPermission = "GIFTCARDS_WRITE" - OAuthPermissionOnlineStoreSnippetsWrite OAuthPermission = "ONLINE_STORE_SNIPPETS_WRITE" - OAuthPermissionOnlineStoreSnippetsRead OAuthPermission = "ONLINE_STORE_SNIPPETS_READ" - OAuthPermissionOnlineStoreSiteRead OAuthPermission = "ONLINE_STORE_SITE_READ" - OAuthPermissionPaymentsWriteSharedOnfile OAuthPermission = "PAYMENTS_WRITE_SHARED_ONFILE" - OAuthPermissionAppointmentsAllRead OAuthPermission = "APPOINTMENTS_ALL_READ" - OAuthPermissionAppointmentsAllWrite OAuthPermission = "APPOINTMENTS_ALL_WRITE" - OAuthPermissionMerchantProfileWrite OAuthPermission = "MERCHANT_PROFILE_WRITE" - OAuthPermissionVendorRead OAuthPermission = "VENDOR_READ" - OAuthPermissionVendorWrite OAuthPermission = "VENDOR_WRITE" - OAuthPermissionPayoutsRead OAuthPermission = "PAYOUTS_READ" - OAuthPermissionReservationsRead OAuthPermission = "RESERVATIONS_READ" - OAuthPermissionReservationsWrite OAuthPermission = "RESERVATIONS_WRITE" - OAuthPermissionRestaurantChecksRead OAuthPermission = "RESTAURANT_CHECKS_READ" - OAuthPermissionDevicesRead OAuthPermission = "DEVICES_READ" - OAuthPermissionChannelsRead OAuthPermission = "CHANNELS_READ" - OAuthPermissionChannelsCreate OAuthPermission = "CHANNELS_CREATE" - OAuthPermissionChannelsUpdate OAuthPermission = "CHANNELS_UPDATE" - OAuthPermissionAddonConfigurationsRead OAuthPermission = "ADDON_CONFIGURATIONS_READ" - OAuthPermissionAddonConfigurationsWrite OAuthPermission = "ADDON_CONFIGURATIONS_WRITE" - OAuthPermissionPermissionSetsRead OAuthPermission = "PERMISSION_SETS_READ" - OAuthPermissionPermissionSetsWrite OAuthPermission = "PERMISSION_SETS_WRITE" -) - -func NewOAuthPermissionFromString(s string) (OAuthPermission, error) { - switch s { - case "BANK_ACCOUNTS_READ": - return OAuthPermissionBankAccountsRead, nil - case "CASH_DRAWER_READ": - return OAuthPermissionCashDrawerRead, nil - case "CUSTOMERS_READ": - return OAuthPermissionCustomersRead, nil - case "CUSTOMERS_WRITE": - return OAuthPermissionCustomersWrite, nil - case "DEVICE_CREDENTIAL_MANAGEMENT": - return OAuthPermissionDeviceCredentialManagement, nil - case "EMPLOYEES_READ": - return OAuthPermissionEmployeesRead, nil - case "EMPLOYEES_WRITE": - return OAuthPermissionEmployeesWrite, nil - case "INVENTORY_READ": - return OAuthPermissionInventoryRead, nil - case "INVENTORY_WRITE": - return OAuthPermissionInventoryWrite, nil - case "ITEMS_READ": - return OAuthPermissionItemsRead, nil - case "ITEMS_WRITE": - return OAuthPermissionItemsWrite, nil - case "LOYALTY_READ": - return OAuthPermissionLoyaltyRead, nil - case "LOYALTY_WRITE": - return OAuthPermissionLoyaltyWrite, nil - case "MERCHANT_PROFILE_READ": - return OAuthPermissionMerchantProfileRead, nil - case "ORDERS_READ": - return OAuthPermissionOrdersRead, nil - case "ORDERS_WRITE": - return OAuthPermissionOrdersWrite, nil - case "PAYMENTS_READ": - return OAuthPermissionPaymentsRead, nil - case "PAYMENTS_WRITE": - return OAuthPermissionPaymentsWrite, nil - case "PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS": - return OAuthPermissionPaymentsWriteAdditionalRecipients, nil - case "PAYMENTS_WRITE_IN_PERSON": - return OAuthPermissionPaymentsWriteInPerson, nil - case "SETTLEMENTS_READ": - return OAuthPermissionSettlementsRead, nil - case "TIMECARDS_READ": - return OAuthPermissionTimecardsRead, nil - case "TIMECARDS_WRITE": - return OAuthPermissionTimecardsWrite, nil - case "TIMECARDS_SETTINGS_READ": - return OAuthPermissionTimecardsSettingsRead, nil - case "TIMECARDS_SETTINGS_WRITE": - return OAuthPermissionTimecardsSettingsWrite, nil - case "APPOINTMENTS_READ": - return OAuthPermissionAppointmentsRead, nil - case "APPOINTMENTS_WRITE": - return OAuthPermissionAppointmentsWrite, nil - case "APPOINTMENTS_BUSINESS_SETTINGS_READ": - return OAuthPermissionAppointmentsBusinessSettingsRead, nil - case "INVOICES_READ": - return OAuthPermissionInvoicesRead, nil - case "INVOICES_WRITE": - return OAuthPermissionInvoicesWrite, nil - case "SUBSCRIPTIONS_READ": - return OAuthPermissionSubscriptionsRead, nil - case "SUBSCRIPTIONS_WRITE": - return OAuthPermissionSubscriptionsWrite, nil - case "DISPUTES_READ": - return OAuthPermissionDisputesRead, nil - case "DISPUTES_WRITE": - return OAuthPermissionDisputesWrite, nil - case "GIFTCARDS_READ": - return OAuthPermissionGiftcardsRead, nil - case "GIFTCARDS_WRITE": - return OAuthPermissionGiftcardsWrite, nil - case "ONLINE_STORE_SNIPPETS_WRITE": - return OAuthPermissionOnlineStoreSnippetsWrite, nil - case "ONLINE_STORE_SNIPPETS_READ": - return OAuthPermissionOnlineStoreSnippetsRead, nil - case "ONLINE_STORE_SITE_READ": - return OAuthPermissionOnlineStoreSiteRead, nil - case "PAYMENTS_WRITE_SHARED_ONFILE": - return OAuthPermissionPaymentsWriteSharedOnfile, nil - case "APPOINTMENTS_ALL_READ": - return OAuthPermissionAppointmentsAllRead, nil - case "APPOINTMENTS_ALL_WRITE": - return OAuthPermissionAppointmentsAllWrite, nil - case "MERCHANT_PROFILE_WRITE": - return OAuthPermissionMerchantProfileWrite, nil - case "VENDOR_READ": - return OAuthPermissionVendorRead, nil - case "VENDOR_WRITE": - return OAuthPermissionVendorWrite, nil - case "PAYOUTS_READ": - return OAuthPermissionPayoutsRead, nil - case "RESERVATIONS_READ": - return OAuthPermissionReservationsRead, nil - case "RESERVATIONS_WRITE": - return OAuthPermissionReservationsWrite, nil - case "RESTAURANT_CHECKS_READ": - return OAuthPermissionRestaurantChecksRead, nil - case "DEVICES_READ": - return OAuthPermissionDevicesRead, nil - case "CHANNELS_READ": - return OAuthPermissionChannelsRead, nil - case "CHANNELS_CREATE": - return OAuthPermissionChannelsCreate, nil - case "CHANNELS_UPDATE": - return OAuthPermissionChannelsUpdate, nil - case "ADDON_CONFIGURATIONS_READ": - return OAuthPermissionAddonConfigurationsRead, nil - case "ADDON_CONFIGURATIONS_WRITE": - return OAuthPermissionAddonConfigurationsWrite, nil - case "PERMISSION_SETS_READ": - return OAuthPermissionPermissionSetsRead, nil - case "PERMISSION_SETS_WRITE": - return OAuthPermissionPermissionSetsWrite, nil - } - var t OAuthPermission - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (o OAuthPermission) Ptr() *OAuthPermission { - return &o -} - type ObtainTokenResponse struct { // A valid OAuth access token. // Provide the access token in a header with every request to Connect API @@ -507,114 +216,6 @@ func (o *ObtainTokenResponse) String() string { return fmt.Sprintf("%#v", o) } -type RenewTokenResponse struct { - // The renewed access token. - // This value might be different from the `access_token` you provided in your request. - // You provide this token in a header with every request to Connect API endpoints. - // See [Request and response headers](https://developer.squareup.com/docs/api/connect/v2/#requestandresponseheaders) for the format of this header. - AccessToken *string `json:"access_token,omitempty" url:"access_token,omitempty"` - // This value is always _bearer_. - TokenType *string `json:"token_type,omitempty" url:"token_type,omitempty"` - // The date when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format. - ExpiresAt *string `json:"expires_at,omitempty" url:"expires_at,omitempty"` - // The ID of the authorizing merchant's business. - MerchantID *string `json:"merchant_id,omitempty" url:"merchant_id,omitempty"` - // **LEGACY FIELD**. The ID of the merchant subscription associated with - // the authorization. The ID is only present if the merchant signed up for a subscription - // during authorization. - SubscriptionID *string `json:"subscription_id,omitempty" url:"subscription_id,omitempty"` - // **LEGACY FIELD**. The ID of the subscription plan the merchant signed - // up for. The ID is only present if the merchant signed up for a subscription plan during - // authorization. - PlanID *string `json:"plan_id,omitempty" url:"plan_id,omitempty"` - // Any errors that occurred during the request. - Errors []*Error `json:"errors,omitempty" url:"errors,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (r *RenewTokenResponse) GetAccessToken() *string { - if r == nil { - return nil - } - return r.AccessToken -} - -func (r *RenewTokenResponse) GetTokenType() *string { - if r == nil { - return nil - } - return r.TokenType -} - -func (r *RenewTokenResponse) GetExpiresAt() *string { - if r == nil { - return nil - } - return r.ExpiresAt -} - -func (r *RenewTokenResponse) GetMerchantID() *string { - if r == nil { - return nil - } - return r.MerchantID -} - -func (r *RenewTokenResponse) GetSubscriptionID() *string { - if r == nil { - return nil - } - return r.SubscriptionID -} - -func (r *RenewTokenResponse) GetPlanID() *string { - if r == nil { - return nil - } - return r.PlanID -} - -func (r *RenewTokenResponse) GetErrors() []*Error { - if r == nil { - return nil - } - return r.Errors -} - -func (r *RenewTokenResponse) GetExtraProperties() map[string]interface{} { - return r.extraProperties -} - -func (r *RenewTokenResponse) UnmarshalJSON(data []byte) error { - type unmarshaler RenewTokenResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *r = RenewTokenResponse(value) - extraProperties, err := internal.ExtractExtraProperties(data, *r) - if err != nil { - return err - } - r.extraProperties = extraProperties - r.rawJSON = json.RawMessage(data) - return nil -} - -func (r *RenewTokenResponse) String() string { - if len(r.rawJSON) > 0 { - if value, err := internal.StringifyJSON(r.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(r); err == nil { - return value - } - return fmt.Sprintf("%#v", r) -} - // Defines the fields that are included in the response body of // a request to the `RetrieveTokenStatus` endpoint. type RetrieveTokenStatusResponse struct { diff --git a/oauth/client.go b/oauth/client.go index 30201d0..c9f34c1 100644 --- a/oauth/client.go +++ b/oauth/client.go @@ -38,129 +38,6 @@ func NewClient(opts ...option.RequestOption) *Client { } } -// As part of a URL sent to a seller to authorize permissions for -// the developer, `Authorize` displays an authorization page and a -// list of requested permissions. -// -// The completed URL looks similar to the following example: -// https://connect.squareup.com/oauth2/authorize?client_id={YOUR_APP_ID}&scope=CUSTOMERS_WRITE+CUSTOMERS_READ&session=False&state=82201dd8d83d23cc8a48caf52b -// -// The seller can approve or deny the permissions. If approved,` Authorize` -// returns an `AuthorizeResponse` that is sent to the redirect URL and includes -// a state string and an authorization code. The code is used in the `ObtainToken` -// call to obtain an access token and a refresh token that the developer uses -// to manage resources on behalf of the seller. -// -// **Important:** The `AuthorizeResponse` is sent to the redirect URL that you set on -// the **OAuth** page of your application in the Developer Dashboard. -// -// If an error occurs or the seller denies the request, `Authorize` returns an -// error response that includes `error` and `error_description` values. If the -// error is due to the seller denying the request, the error value is `access_denied` -// and the `error_description` is `user_denied`. -func (c *Client) Authorize( - ctx context.Context, - request *squaregosdk.OAuthAuthorizeRequest, - opts ...option.RequestOption, -) (*squaregosdk.AuthorizeResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "https://connect.squareupsandbox.com", - ) - endpointURL := baseURL + "/oauth2/authorize" - queryParams, err := internal.QueryValues(request) - if err != nil { - return nil, err - } - if len(queryParams) > 0 { - endpointURL += "?" + queryParams.Encode() - } - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - - var response *squaregosdk.AuthorizeResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodGet, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - -// `RenewToken` is deprecated. For information about refreshing OAuth access tokens, see -// [Migrate from Renew to Refresh OAuth Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens). -// -// Renews an OAuth access token before it expires. -// -// OAuth access tokens besides your application's personal access token expire after 30 days. -// You can also renew expired tokens within 15 days of their expiration. -// You cannot renew an access token that has been expired for more than 15 days. -// Instead, the associated user must recomplete the OAuth flow from the beginning. -// -// **Important:** The `Authorization` header for this endpoint must have the -// following format: -// -// ``` -// Authorization: Client APPLICATION_SECRET -// ``` -// -// Replace `APPLICATION_SECRET` with the application secret on the **Credentials** -// page in the [Developer Dashboard](https://developer.squareup.com/apps). -func (c *Client) RenewToken( - ctx context.Context, - request *squaregosdk.RenewTokenRequest, - opts ...option.RequestOption, -) (*squaregosdk.RenewTokenResponse, error) { - options := core.NewRequestOptions(opts...) - baseURL := internal.ResolveBaseURL( - options.BaseURL, - c.baseURL, - "https://connect.squareupsandbox.com", - ) - endpointURL := internal.EncodeURL( - baseURL+"/oauth2/clients/%v/access-token/renew", - request.ClientID, - ) - headers := internal.MergeHeaders( - c.header.Clone(), - options.ToHeader(), - ) - headers.Set("Content-Type", "application/json") - - var response *squaregosdk.RenewTokenResponse - if err := c.caller.Call( - ctx, - &internal.CallParams{ - URL: endpointURL, - Method: http.MethodPost, - Headers: headers, - MaxAttempts: options.MaxAttempts, - BodyProperties: options.BodyProperties, - QueryParameters: options.QueryParameters, - Client: options.HTTPClient, - Request: request, - Response: &response, - }, - ); err != nil { - return nil, err - } - return response, nil -} - // Revokes an access token generated with the OAuth flow. // // If an account has more than one OAuth access token for your application, this @@ -316,3 +193,36 @@ func (c *Client) RetrieveTokenStatus( } return response, nil } + +func (c *Client) Authorize( + ctx context.Context, + opts ...option.RequestOption, +) error { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + c.baseURL, + "https://connect.squareupsandbox.com", + ) + endpointURL := baseURL + "/oauth2/authorize" + headers := internal.MergeHeaders( + c.header.Clone(), + options.ToHeader(), + ) + + if err := c.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + }, + ); err != nil { + return err + } + return nil +} diff --git a/orders.go b/orders.go index 0a862f1..1c536a4 100644 --- a/orders.go +++ b/orders.go @@ -1092,31 +1092,19 @@ func (s *SearchOrdersSort) String() string { type SearchOrdersSortField string const ( - SearchOrdersSortFieldDoNotUse SearchOrdersSortField = "DO_NOT_USE" SearchOrdersSortFieldCreatedAt SearchOrdersSortField = "CREATED_AT" SearchOrdersSortFieldUpdatedAt SearchOrdersSortField = "UPDATED_AT" SearchOrdersSortFieldClosedAt SearchOrdersSortField = "CLOSED_AT" - SearchOrdersSortFieldPaidAt SearchOrdersSortField = "PAID_AT" - SearchOrdersSortFieldScore SearchOrdersSortField = "SCORE" - SearchOrdersSortFieldDueAt SearchOrdersSortField = "DUE_AT" ) func NewSearchOrdersSortFieldFromString(s string) (SearchOrdersSortField, error) { switch s { - case "DO_NOT_USE": - return SearchOrdersSortFieldDoNotUse, nil case "CREATED_AT": return SearchOrdersSortFieldCreatedAt, nil case "UPDATED_AT": return SearchOrdersSortFieldUpdatedAt, nil case "CLOSED_AT": return SearchOrdersSortFieldClosedAt, nil - case "PAID_AT": - return SearchOrdersSortFieldPaidAt, nil - case "SCORE": - return SearchOrdersSortFieldScore, nil - case "DUE_AT": - return SearchOrdersSortFieldDueAt, nil } var t SearchOrdersSortField return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/payments.go b/payments.go index bc86408..a9d16b7 100644 --- a/payments.go +++ b/payments.go @@ -2289,7 +2289,6 @@ func (r *RiskEvaluation) String() string { type RiskEvaluationRiskLevel string const ( - RiskEvaluationRiskLevelDoNotUse RiskEvaluationRiskLevel = "DO_NOT_USE" RiskEvaluationRiskLevelPending RiskEvaluationRiskLevel = "PENDING" RiskEvaluationRiskLevelNormal RiskEvaluationRiskLevel = "NORMAL" RiskEvaluationRiskLevelModerate RiskEvaluationRiskLevel = "MODERATE" @@ -2298,8 +2297,6 @@ const ( func NewRiskEvaluationRiskLevelFromString(s string) (RiskEvaluationRiskLevel, error) { switch s { - case "DO_NOT_USE": - return RiskEvaluationRiskLevelDoNotUse, nil case "PENDING": return RiskEvaluationRiskLevelPending, nil case "NORMAL": diff --git a/payouts.go b/payouts.go index 8d4fd1a..9503579 100644 --- a/payouts.go +++ b/payouts.go @@ -61,7 +61,6 @@ type PayoutsListRequest struct { type ActivityType string const ( - ActivityTypeUnknownPayoutEntryTypeDoNotUse ActivityType = "UNKNOWN_PAYOUT_ENTRY_TYPE_DO_NOT_USE" ActivityTypeAdjustment ActivityType = "ADJUSTMENT" ActivityTypeAppFeeRefund ActivityType = "APP_FEE_REFUND" ActivityTypeAppFeeRevenue ActivityType = "APP_FEE_REVENUE" @@ -69,6 +68,7 @@ const ( ActivityTypeAutomaticSavingsReversed ActivityType = "AUTOMATIC_SAVINGS_REVERSED" ActivityTypeCharge ActivityType = "CHARGE" ActivityTypeDepositFee ActivityType = "DEPOSIT_FEE" + ActivityTypeDepositFeeReversed ActivityType = "DEPOSIT_FEE_REVERSED" ActivityTypeDispute ActivityType = "DISPUTE" ActivityTypeEscheatment ActivityType = "ESCHEATMENT" ActivityTypeFee ActivityType = "FEE" @@ -101,14 +101,8 @@ const ( ActivityTypeAutomaticBitcoinConversionsReversed ActivityType = "AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED" ActivityTypeCreditCardRepayment ActivityType = "CREDIT_CARD_REPAYMENT" ActivityTypeCreditCardRepaymentReversed ActivityType = "CREDIT_CARD_REPAYMENT_REVERSED" - ActivityTypeSquareCardPayout ActivityType = "SQUARE_CARD_PAYOUT" - ActivityTypeReturnedSquareCardPayout ActivityType = "RETURNED_SQUARE_CARD_PAYOUT" - ActivityTypeManualPayout ActivityType = "MANUAL_PAYOUT" - ActivityTypeReturnedManualPayout ActivityType = "RETURNED_MANUAL_PAYOUT" ActivityTypeLocalOffersCashback ActivityType = "LOCAL_OFFERS_CASHBACK" ActivityTypeLocalOffersFee ActivityType = "LOCAL_OFFERS_FEE" - ActivityTypeGiftCardPool ActivityType = "GIFT_CARD_POOL" - ActivityTypeGiftCardPoolReversed ActivityType = "GIFT_CARD_POOL_REVERSED" ActivityTypePercentageProcessingEnrollment ActivityType = "PERCENTAGE_PROCESSING_ENROLLMENT" ActivityTypePercentageProcessingDeactivation ActivityType = "PERCENTAGE_PROCESSING_DEACTIVATION" ActivityTypePercentageProcessingRepayment ActivityType = "PERCENTAGE_PROCESSING_REPAYMENT" @@ -120,18 +114,15 @@ const ( ActivityTypeGiftCardLoadFeeRefund ActivityType = "GIFT_CARD_LOAD_FEE_REFUND" ActivityTypeUndoGiftCardLoadFeeRefund ActivityType = "UNDO_GIFT_CARD_LOAD_FEE_REFUND" ActivityTypeBalanceFoldersTransfer ActivityType = "BALANCE_FOLDERS_TRANSFER" - ActivityTypeCashForBusinessFeeRefund ActivityType = "CASH_FOR_BUSINESS_FEE_REFUND" - ActivityTypeCashForBusinessDisputeOffset ActivityType = "CASH_FOR_BUSINESS_DISPUTE_OFFSET" - ActivityTypeCashForBusinessDisputeOffsetReversed ActivityType = "CASH_FOR_BUSINESS_DISPUTE_OFFSET_REVERSED" ActivityTypeBalanceFoldersTransferReversed ActivityType = "BALANCE_FOLDERS_TRANSFER_REVERSED" ActivityTypeGiftCardPoolTransfer ActivityType = "GIFT_CARD_POOL_TRANSFER" ActivityTypeGiftCardPoolTransferReversed ActivityType = "GIFT_CARD_POOL_TRANSFER_REVERSED" + ActivityTypeSquarePayrollTransfer ActivityType = "SQUARE_PAYROLL_TRANSFER" + ActivityTypeSquarePayrollTransferReversed ActivityType = "SQUARE_PAYROLL_TRANSFER_REVERSED" ) func NewActivityTypeFromString(s string) (ActivityType, error) { switch s { - case "UNKNOWN_PAYOUT_ENTRY_TYPE_DO_NOT_USE": - return ActivityTypeUnknownPayoutEntryTypeDoNotUse, nil case "ADJUSTMENT": return ActivityTypeAdjustment, nil case "APP_FEE_REFUND": @@ -146,6 +137,8 @@ func NewActivityTypeFromString(s string) (ActivityType, error) { return ActivityTypeCharge, nil case "DEPOSIT_FEE": return ActivityTypeDepositFee, nil + case "DEPOSIT_FEE_REVERSED": + return ActivityTypeDepositFeeReversed, nil case "DISPUTE": return ActivityTypeDispute, nil case "ESCHEATMENT": @@ -210,22 +203,10 @@ func NewActivityTypeFromString(s string) (ActivityType, error) { return ActivityTypeCreditCardRepayment, nil case "CREDIT_CARD_REPAYMENT_REVERSED": return ActivityTypeCreditCardRepaymentReversed, nil - case "SQUARE_CARD_PAYOUT": - return ActivityTypeSquareCardPayout, nil - case "RETURNED_SQUARE_CARD_PAYOUT": - return ActivityTypeReturnedSquareCardPayout, nil - case "MANUAL_PAYOUT": - return ActivityTypeManualPayout, nil - case "RETURNED_MANUAL_PAYOUT": - return ActivityTypeReturnedManualPayout, nil case "LOCAL_OFFERS_CASHBACK": return ActivityTypeLocalOffersCashback, nil case "LOCAL_OFFERS_FEE": return ActivityTypeLocalOffersFee, nil - case "GIFT_CARD_POOL": - return ActivityTypeGiftCardPool, nil - case "GIFT_CARD_POOL_REVERSED": - return ActivityTypeGiftCardPoolReversed, nil case "PERCENTAGE_PROCESSING_ENROLLMENT": return ActivityTypePercentageProcessingEnrollment, nil case "PERCENTAGE_PROCESSING_DEACTIVATION": @@ -248,18 +229,16 @@ func NewActivityTypeFromString(s string) (ActivityType, error) { return ActivityTypeUndoGiftCardLoadFeeRefund, nil case "BALANCE_FOLDERS_TRANSFER": return ActivityTypeBalanceFoldersTransfer, nil - case "CASH_FOR_BUSINESS_FEE_REFUND": - return ActivityTypeCashForBusinessFeeRefund, nil - case "CASH_FOR_BUSINESS_DISPUTE_OFFSET": - return ActivityTypeCashForBusinessDisputeOffset, nil - case "CASH_FOR_BUSINESS_DISPUTE_OFFSET_REVERSED": - return ActivityTypeCashForBusinessDisputeOffsetReversed, nil case "BALANCE_FOLDERS_TRANSFER_REVERSED": return ActivityTypeBalanceFoldersTransferReversed, nil case "GIFT_CARD_POOL_TRANSFER": return ActivityTypeGiftCardPoolTransfer, nil case "GIFT_CARD_POOL_TRANSFER_REVERSED": return ActivityTypeGiftCardPoolTransferReversed, nil + case "SQUARE_PAYROLL_TRANSFER": + return ActivityTypeSquarePayrollTransfer, nil + case "SQUARE_PAYROLL_TRANSFER_REVERSED": + return ActivityTypeSquarePayrollTransferReversed, nil } var t ActivityType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -331,18 +310,14 @@ func (d *Destination) String() string { type DestinationType string const ( - DestinationTypeUnknownDestinationTypeDoNotUse DestinationType = "UNKNOWN_DESTINATION_TYPE_DO_NOT_USE" - DestinationTypeBankAccount DestinationType = "BANK_ACCOUNT" - DestinationTypeCard DestinationType = "CARD" - DestinationTypeSquareBalance DestinationType = "SQUARE_BALANCE" - DestinationTypeSquareStoredBalance DestinationType = "SQUARE_STORED_BALANCE" - DestinationTypeDestinationTypePending DestinationType = "DESTINATION_TYPE_PENDING" + DestinationTypeBankAccount DestinationType = "BANK_ACCOUNT" + DestinationTypeCard DestinationType = "CARD" + DestinationTypeSquareBalance DestinationType = "SQUARE_BALANCE" + DestinationTypeSquareStoredBalance DestinationType = "SQUARE_STORED_BALANCE" ) func NewDestinationTypeFromString(s string) (DestinationType, error) { switch s { - case "UNKNOWN_DESTINATION_TYPE_DO_NOT_USE": - return DestinationTypeUnknownDestinationTypeDoNotUse, nil case "BANK_ACCOUNT": return DestinationTypeBankAccount, nil case "CARD": @@ -351,8 +326,6 @@ func NewDestinationTypeFromString(s string) (DestinationType, error) { return DestinationTypeSquareBalance, nil case "SQUARE_STORED_BALANCE": return DestinationTypeSquareStoredBalance, nil - case "DESTINATION_TYPE_PENDING": - return DestinationTypeDestinationTypePending, nil } var t DestinationType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -879,6 +852,53 @@ func (p *PaymentBalanceActivityDepositFeeDetail) String() string { return fmt.Sprintf("%#v", p) } +type PaymentBalanceActivityDepositFeeReversedDetail struct { + // The ID of the payout that triggered this deposit fee activity. + PayoutID *string `json:"payout_id,omitempty" url:"payout_id,omitempty"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *PaymentBalanceActivityDepositFeeReversedDetail) GetPayoutID() *string { + if p == nil { + return nil + } + return p.PayoutID +} + +func (p *PaymentBalanceActivityDepositFeeReversedDetail) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *PaymentBalanceActivityDepositFeeReversedDetail) UnmarshalJSON(data []byte) error { + type unmarshaler PaymentBalanceActivityDepositFeeReversedDetail + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PaymentBalanceActivityDepositFeeReversedDetail(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *PaymentBalanceActivityDepositFeeReversedDetail) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + type PaymentBalanceActivityDisputeDetail struct { // The ID of the payment associated with this activity. PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"` @@ -1520,6 +1540,100 @@ func (p *PaymentBalanceActivitySquareCapitalReversedPaymentDetail) String() stri return fmt.Sprintf("%#v", p) } +type PaymentBalanceActivitySquarePayrollTransferDetail struct { + // The ID of the payment associated with this activity. + PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *PaymentBalanceActivitySquarePayrollTransferDetail) GetPaymentID() *string { + if p == nil { + return nil + } + return p.PaymentID +} + +func (p *PaymentBalanceActivitySquarePayrollTransferDetail) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *PaymentBalanceActivitySquarePayrollTransferDetail) UnmarshalJSON(data []byte) error { + type unmarshaler PaymentBalanceActivitySquarePayrollTransferDetail + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PaymentBalanceActivitySquarePayrollTransferDetail(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *PaymentBalanceActivitySquarePayrollTransferDetail) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + +type PaymentBalanceActivitySquarePayrollTransferReversedDetail struct { + // The ID of the payment associated with this activity. + PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *PaymentBalanceActivitySquarePayrollTransferReversedDetail) GetPaymentID() *string { + if p == nil { + return nil + } + return p.PaymentID +} + +func (p *PaymentBalanceActivitySquarePayrollTransferReversedDetail) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *PaymentBalanceActivitySquarePayrollTransferReversedDetail) UnmarshalJSON(data []byte) error { + type unmarshaler PaymentBalanceActivitySquarePayrollTransferReversedDetail + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PaymentBalanceActivitySquarePayrollTransferReversedDetail(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *PaymentBalanceActivitySquarePayrollTransferReversedDetail) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + type PaymentBalanceActivityTaxOnFeeDetail struct { // The ID of the payment associated with this activity. PaymentID *string `json:"payment_id,omitempty" url:"payment_id,omitempty"` @@ -1861,6 +1975,8 @@ type PayoutEntry struct { TypeChargeDetails *PaymentBalanceActivityChargeDetail `json:"type_charge_details,omitempty" url:"type_charge_details,omitempty"` // Details of any fees involved with deposits such as for instant deposits. TypeDepositFeeDetails *PaymentBalanceActivityDepositFeeDetail `json:"type_deposit_fee_details,omitempty" url:"type_deposit_fee_details,omitempty"` + // Details of any reversal or refund of fees involved with deposits such as for instant deposits. + TypeDepositFeeReversedDetails *PaymentBalanceActivityDepositFeeReversedDetail `json:"type_deposit_fee_reversed_details,omitempty" url:"type_deposit_fee_reversed_details,omitempty"` // Details of any balance change due to a dispute event. TypeDisputeDetails *PaymentBalanceActivityDisputeDetail `json:"type_dispute_details,omitempty" url:"type_dispute_details,omitempty"` // Details of adjustments due to the Square processing fee. @@ -1893,6 +2009,10 @@ type PayoutEntry struct { TypeThirdPartyFeeDetails *PaymentBalanceActivityThirdPartyFeeDetail `json:"type_third_party_fee_details,omitempty" url:"type_third_party_fee_details,omitempty"` // Details of refunded fees from a 3rd party platform. TypeThirdPartyFeeRefundDetails *PaymentBalanceActivityThirdPartyFeeRefundDetail `json:"type_third_party_fee_refund_details,omitempty" url:"type_third_party_fee_refund_details,omitempty"` + // Details of a payroll payment that was transferred to a team member’s bank account. + TypeSquarePayrollTransferDetails *PaymentBalanceActivitySquarePayrollTransferDetail `json:"type_square_payroll_transfer_details,omitempty" url:"type_square_payroll_transfer_details,omitempty"` + // Details of a payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square. + TypeSquarePayrollTransferReversedDetails *PaymentBalanceActivitySquarePayrollTransferReversedDetail `json:"type_square_payroll_transfer_reversed_details,omitempty" url:"type_square_payroll_transfer_reversed_details,omitempty"` extraProperties map[string]interface{} rawJSON json.RawMessage @@ -1989,6 +2109,13 @@ func (p *PayoutEntry) GetTypeDepositFeeDetails() *PaymentBalanceActivityDepositF return p.TypeDepositFeeDetails } +func (p *PayoutEntry) GetTypeDepositFeeReversedDetails() *PaymentBalanceActivityDepositFeeReversedDetail { + if p == nil { + return nil + } + return p.TypeDepositFeeReversedDetails +} + func (p *PayoutEntry) GetTypeDisputeDetails() *PaymentBalanceActivityDisputeDetail { if p == nil { return nil @@ -2101,6 +2228,20 @@ func (p *PayoutEntry) GetTypeThirdPartyFeeRefundDetails() *PaymentBalanceActivit return p.TypeThirdPartyFeeRefundDetails } +func (p *PayoutEntry) GetTypeSquarePayrollTransferDetails() *PaymentBalanceActivitySquarePayrollTransferDetail { + if p == nil { + return nil + } + return p.TypeSquarePayrollTransferDetails +} + +func (p *PayoutEntry) GetTypeSquarePayrollTransferReversedDetails() *PaymentBalanceActivitySquarePayrollTransferReversedDetail { + if p == nil { + return nil + } + return p.TypeSquarePayrollTransferReversedDetails +} + func (p *PayoutEntry) GetExtraProperties() map[string]interface{} { return p.extraProperties } @@ -2204,15 +2345,12 @@ func (p *PayoutFee) String() string { type PayoutFeeType string const ( - PayoutFeeTypeUnknownPayoutFeeTypeDoNotUse PayoutFeeType = "UNKNOWN_PAYOUT_FEE_TYPE_DO_NOT_USE" - PayoutFeeTypeTransferFee PayoutFeeType = "TRANSFER_FEE" - PayoutFeeTypeTaxOnTransferFee PayoutFeeType = "TAX_ON_TRANSFER_FEE" + PayoutFeeTypeTransferFee PayoutFeeType = "TRANSFER_FEE" + PayoutFeeTypeTaxOnTransferFee PayoutFeeType = "TAX_ON_TRANSFER_FEE" ) func NewPayoutFeeTypeFromString(s string) (PayoutFeeType, error) { switch s { - case "UNKNOWN_PAYOUT_FEE_TYPE_DO_NOT_USE": - return PayoutFeeTypeUnknownPayoutFeeTypeDoNotUse, nil case "TRANSFER_FEE": return PayoutFeeTypeTransferFee, nil case "TAX_ON_TRANSFER_FEE": @@ -2230,25 +2368,19 @@ func (p PayoutFeeType) Ptr() *PayoutFeeType { type PayoutStatus string const ( - PayoutStatusUnknownPayoutStatusDoNotUse PayoutStatus = "UNKNOWN_PAYOUT_STATUS_DO_NOT_USE" - PayoutStatusSent PayoutStatus = "SENT" - PayoutStatusFailed PayoutStatus = "FAILED" - PayoutStatusPaid PayoutStatus = "PAID" - PayoutStatusPending PayoutStatus = "PENDING" + PayoutStatusSent PayoutStatus = "SENT" + PayoutStatusFailed PayoutStatus = "FAILED" + PayoutStatusPaid PayoutStatus = "PAID" ) func NewPayoutStatusFromString(s string) (PayoutStatus, error) { switch s { - case "UNKNOWN_PAYOUT_STATUS_DO_NOT_USE": - return PayoutStatusUnknownPayoutStatusDoNotUse, nil case "SENT": return PayoutStatusSent, nil case "FAILED": return PayoutStatusFailed, nil case "PAID": return PayoutStatusPaid, nil - case "PENDING": - return PayoutStatusPending, nil } var t PayoutStatus return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -2265,15 +2397,12 @@ func (p PayoutStatus) Ptr() *PayoutStatus { type PayoutType string const ( - PayoutTypeUnknownPayoutTypeDoNotUse PayoutType = "UNKNOWN_PAYOUT_TYPE_DO_NOT_USE" - PayoutTypeBatch PayoutType = "BATCH" - PayoutTypeSimple PayoutType = "SIMPLE" + PayoutTypeBatch PayoutType = "BATCH" + PayoutTypeSimple PayoutType = "SIMPLE" ) func NewPayoutTypeFromString(s string) (PayoutType, error) { switch s { - case "UNKNOWN_PAYOUT_TYPE_DO_NOT_USE": - return PayoutTypeUnknownPayoutTypeDoNotUse, nil case "BATCH": return PayoutTypeBatch, nil case "SIMPLE": diff --git a/refunds.go b/refunds.go index 86c6c75..30803a7 100644 --- a/refunds.go +++ b/refunds.go @@ -46,11 +46,13 @@ type RefundPaymentRequest struct { // The unique ID of the payment being refunded. // Required when unlinked=false, otherwise must not be set. PaymentID *string `json:"payment_id,omitempty" url:"-"` - // The ID indicating where funds will be refunded to, if this is an unlinked refund. - // This can be any of the following: A token generated by Web Payments SDK; - // a card-on-file identifier. - // Required for requests specifying unlinked=true. - // Otherwise, if included when `unlinked=false`, will throw an error. + // The ID indicating where funds will be refunded to. Required for unlinked refunds. For more + // information, see [Process an Unlinked Refund](https://developer.squareup.com/docs/refunds-api/unlinked-refunds). + // + // For refunds linked to Square payments, `destination_id` is usually omitted; in this case, funds + // will be returned to the original payment source. The field may be specified in order to request + // a cross-method refund to a gift card. For more information, + // see [Cross-method refunds to gift cards](https://developer.squareup.com/docs/payments-api/refund-payments#cross-method-refunds-to-gift-cards). DestinationID *string `json:"destination_id,omitempty" url:"-"` // Indicates that the refund is not linked to a Square payment. // If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not @@ -74,6 +76,11 @@ type RefundPaymentRequest struct { PaymentVersionToken *string `json:"payment_version_token,omitempty" url:"-"` // An optional [TeamMember](entity:TeamMember) ID to associate with this refund. TeamMemberID *string `json:"team_member_id,omitempty" url:"-"` + // Additional details required when recording an unlinked cash refund (`destination_id` is CASH). + CashDetails *DestinationDetailsCashRefundDetails `json:"cash_details,omitempty" url:"-"` + // Additional details required when recording an unlinked external refund + // (`destination_id` is EXTERNAL). + ExternalDetails *DestinationDetailsExternalRefundDetails `json:"external_details,omitempty" url:"-"` } type RefundsGetRequest struct { @@ -131,6 +138,10 @@ type RefundsListRequest struct { type DestinationDetails struct { // Details about a card refund. Only populated if the destination_type is `CARD`. CardDetails *DestinationDetailsCardRefundDetails `json:"card_details,omitempty" url:"card_details,omitempty"` + // Details about a cash refund. Only populated if the destination_type is `CASH`. + CashDetails *DestinationDetailsCashRefundDetails `json:"cash_details,omitempty" url:"cash_details,omitempty"` + // Details about an external refund. Only populated if the destination_type is `EXTERNAL`. + ExternalDetails *DestinationDetailsExternalRefundDetails `json:"external_details,omitempty" url:"external_details,omitempty"` extraProperties map[string]interface{} rawJSON json.RawMessage @@ -143,6 +154,20 @@ func (d *DestinationDetails) GetCardDetails() *DestinationDetailsCardRefundDetai return d.CardDetails } +func (d *DestinationDetails) GetCashDetails() *DestinationDetailsCashRefundDetails { + if d == nil { + return nil + } + return d.CashDetails +} + +func (d *DestinationDetails) GetExternalDetails() *DestinationDetailsExternalRefundDetails { + if d == nil { + return nil + } + return d.ExternalDetails +} + func (d *DestinationDetails) GetExtraProperties() map[string]interface{} { return d.extraProperties } @@ -241,6 +266,146 @@ func (d *DestinationDetailsCardRefundDetails) String() string { return fmt.Sprintf("%#v", d) } +// Stores details about a cash refund. Contains only non-confidential information. +type DestinationDetailsCashRefundDetails struct { + // The amount and currency of the money supplied by the seller. + SellerSuppliedMoney *Money `json:"seller_supplied_money,omitempty" url:"seller_supplied_money,omitempty"` + // The amount of change due back to the seller. + // This read-only field is calculated + // from the `amount_money` and `seller_supplied_money` fields. + ChangeBackMoney *Money `json:"change_back_money,omitempty" url:"change_back_money,omitempty"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DestinationDetailsCashRefundDetails) GetSellerSuppliedMoney() *Money { + if d == nil { + return nil + } + return d.SellerSuppliedMoney +} + +func (d *DestinationDetailsCashRefundDetails) GetChangeBackMoney() *Money { + if d == nil { + return nil + } + return d.ChangeBackMoney +} + +func (d *DestinationDetailsCashRefundDetails) GetExtraProperties() map[string]interface{} { + return d.extraProperties +} + +func (d *DestinationDetailsCashRefundDetails) UnmarshalJSON(data []byte) error { + type unmarshaler DestinationDetailsCashRefundDetails + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DestinationDetailsCashRefundDetails(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DestinationDetailsCashRefundDetails) String() string { + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +// Stores details about an external refund. Contains only non-confidential information. +type DestinationDetailsExternalRefundDetails struct { + // The type of external refund the seller paid to the buyer. It can be one of the + // following: + // + // - CHECK - Refunded using a physical check. + // - BANK_TRANSFER - Refunded using external bank transfer. + // - OTHER_GIFT_CARD - Refunded using a non-Square gift card. + // - CRYPTO - Refunded using a crypto currency. + // - SQUARE_CASH - Refunded using Square Cash App. + // - SOCIAL - Refunded using peer-to-peer payment applications. + // - EXTERNAL - A third-party application gathered this refund outside of Square. + // - EMONEY - Refunded using an E-money provider. + // - CARD - A credit or debit card that Square does not support. + // - STORED_BALANCE - Use for house accounts, store credit, and so forth. + // - FOOD_VOUCHER - Restaurant voucher provided by employers to employees to pay for meals + // - OTHER - A type not listed here. + Type string `json:"type" url:"type"` + // A description of the external refund source. For example, + // "Food Delivery Service". + Source string `json:"source" url:"source"` + // An ID to associate the refund to its originating source. + SourceID *string `json:"source_id,omitempty" url:"source_id,omitempty"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DestinationDetailsExternalRefundDetails) GetType() string { + if d == nil { + return "" + } + return d.Type +} + +func (d *DestinationDetailsExternalRefundDetails) GetSource() string { + if d == nil { + return "" + } + return d.Source +} + +func (d *DestinationDetailsExternalRefundDetails) GetSourceID() *string { + if d == nil { + return nil + } + return d.SourceID +} + +func (d *DestinationDetailsExternalRefundDetails) GetExtraProperties() map[string]interface{} { + return d.extraProperties +} + +func (d *DestinationDetailsExternalRefundDetails) UnmarshalJSON(data []byte) error { + type unmarshaler DestinationDetailsExternalRefundDetails + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DestinationDetailsExternalRefundDetails(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DestinationDetailsExternalRefundDetails) String() string { + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + // Defines the response returned by [GetRefund](api-endpoint:Refunds-GetPaymentRefund). // // Note: If there are errors processing the request, the refund field might not be @@ -418,6 +583,8 @@ type PaymentRefund struct { UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,omitempty"` // An optional ID of the team member associated with taking the payment. TeamMemberID *string `json:"team_member_id,omitempty" url:"team_member_id,omitempty"` + // An optional ID for a Terminal refund. + TerminalRefundID *string `json:"terminal_refund_id,omitempty" url:"terminal_refund_id,omitempty"` extraProperties map[string]interface{} rawJSON json.RawMessage @@ -528,6 +695,13 @@ func (p *PaymentRefund) GetTeamMemberID() *string { return p.TeamMemberID } +func (p *PaymentRefund) GetTerminalRefundID() *string { + if p == nil { + return nil + } + return p.TerminalRefundID +} + func (p *PaymentRefund) GetExtraProperties() map[string]interface{} { return p.extraProperties } diff --git a/subscriptions.go b/subscriptions.go index db920e9..66e034e 100644 --- a/subscriptions.go +++ b/subscriptions.go @@ -44,10 +44,6 @@ type SubscriptionsDeleteActionRequest struct { type SwapPlanRequest struct { // The ID of the subscription to swap the subscription plan for. SubscriptionID string `json:"-" url:"-"` - // The ID of the new subscription plan. - // - // Retired in favour of `new_plan_variation_id`. - NewPlanID *string `json:"new_plan_id,omitempty" url:"-"` // The ID of the new subscription plan variation. // // This field is required. @@ -70,14 +66,6 @@ type CreateSubscriptionRequest struct { IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"` // The ID of the location the subscription is associated with. LocationID string `json:"location_id" url:"-"` - // The ID of the [subscription plan](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations) created using the Catalog API. - // - // Retired in favour of `plan_variation_id`. - // - // For more information, see - // [Set Up and Manage a Subscription Plan](https://developer.squareup.com/docs/subscriptions-api/setup-plan) and - // [Subscriptions Walkthrough](https://developer.squareup.com/docs/subscriptions-api/walkthrough). - PlanID *string `json:"plan_id,omitempty" url:"-"` // The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) created using the Catalog API. PlanVariationID *string `json:"plan_variation_id,omitempty" url:"-"` // The ID of the [customer](entity:Customer) subscribing to the subscription plan variation. @@ -399,15 +387,12 @@ func (c *ChangeBillingAnchorDateResponse) String() string { type ChangeTiming string const ( - ChangeTimingDefaultChangeTimingTypeDoNotUse ChangeTiming = "DEFAULT_CHANGE_TIMING_TYPE_DO_NOT_USE" - ChangeTimingImmediate ChangeTiming = "IMMEDIATE" - ChangeTimingEndOfBillingCycle ChangeTiming = "END_OF_BILLING_CYCLE" + ChangeTimingImmediate ChangeTiming = "IMMEDIATE" + ChangeTimingEndOfBillingCycle ChangeTiming = "END_OF_BILLING_CYCLE" ) func NewChangeTimingFromString(s string) (ChangeTiming, error) { switch s { - case "DEFAULT_CHANGE_TIMING_TYPE_DO_NOT_USE": - return ChangeTimingDefaultChangeTimingTypeDoNotUse, nil case "IMMEDIATE": return ChangeTimingImmediate, nil case "END_OF_BILLING_CYCLE": @@ -1130,8 +1115,6 @@ type Subscription struct { ID *string `json:"id,omitempty" url:"id,omitempty"` // The ID of the location associated with the subscription. LocationID *string `json:"location_id,omitempty" url:"location_id,omitempty"` - // The ID of the subscribed-to [subscription plan](entity:CatalogSubscriptionPlan). - PlanID *string `json:"plan_id,omitempty" url:"plan_id,omitempty"` // The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). PlanVariationID *string `json:"plan_variation_id,omitempty" url:"plan_variation_id,omitempty"` // The ID of the subscribing [customer](entity:Customer) profile. @@ -1180,16 +1163,6 @@ type Subscription struct { // The ID of the [subscriber's](entity:Customer) [card](entity:Card) // used to charge for the subscription. CardID *string `json:"card_id,omitempty" url:"card_id,omitempty"` - // The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) up to when the subscriber is invoiced for the - // subscription. - // - // After the invoice is sent for a given billing period, - // this date will be the last day of the billing period. - // For example, - // suppose for the month of May a subscriber gets an invoice - // (or charged the card) on May 1. For the monthly billing scenario, - // this date is then set to May 31. - PaidUntilDate *string `json:"paid_until_date,omitempty" url:"paid_until_date,omitempty"` // Timezone that will be used in date calculations for the subscription. // Defaults to the timezone of the location based on `location_id`. // Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). @@ -1225,13 +1198,6 @@ func (s *Subscription) GetLocationID() *string { return s.LocationID } -func (s *Subscription) GetPlanID() *string { - if s == nil { - return nil - } - return s.PlanID -} - func (s *Subscription) GetPlanVariationID() *string { if s == nil { return nil @@ -1316,13 +1282,6 @@ func (s *Subscription) GetCardID() *string { return s.CardID } -func (s *Subscription) GetPaidUntilDate() *string { - if s == nil { - return nil - } - return s.PaidUntilDate -} - func (s *Subscription) GetTimezone() *string { if s == nil { return nil @@ -1399,8 +1358,6 @@ type SubscriptionAction struct { Type *SubscriptionActionType `json:"type,omitempty" url:"type,omitempty"` // The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. EffectiveDate *string `json:"effective_date,omitempty" url:"effective_date,omitempty"` - // The target subscription plan a subscription switches to, for a `SWAP_PLAN` action. - NewPlanID *string `json:"new_plan_id,omitempty" url:"new_plan_id,omitempty"` // The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. MonthlyBillingAnchorDate *int `json:"monthly_billing_anchor_date,omitempty" url:"monthly_billing_anchor_date,omitempty"` // A list of Phases, to pass phase-specific information used in the swap. @@ -1433,13 +1390,6 @@ func (s *SubscriptionAction) GetEffectiveDate() *string { return s.EffectiveDate } -func (s *SubscriptionAction) GetNewPlanID() *string { - if s == nil { - return nil - } - return s.NewPlanID -} - func (s *SubscriptionAction) GetMonthlyBillingAnchorDate() *int { if s == nil { return nil @@ -1497,18 +1447,15 @@ func (s *SubscriptionAction) String() string { type SubscriptionActionType string const ( - SubscriptionActionTypeDefaultSubscriptionActionTypeDoNotUse SubscriptionActionType = "DEFAULT_SUBSCRIPTION_ACTION_TYPE_DO_NOT_USE" - SubscriptionActionTypeCancel SubscriptionActionType = "CANCEL" - SubscriptionActionTypePause SubscriptionActionType = "PAUSE" - SubscriptionActionTypeResume SubscriptionActionType = "RESUME" - SubscriptionActionTypeSwapPlan SubscriptionActionType = "SWAP_PLAN" - SubscriptionActionTypeChangeBillingAnchorDate SubscriptionActionType = "CHANGE_BILLING_ANCHOR_DATE" + SubscriptionActionTypeCancel SubscriptionActionType = "CANCEL" + SubscriptionActionTypePause SubscriptionActionType = "PAUSE" + SubscriptionActionTypeResume SubscriptionActionType = "RESUME" + SubscriptionActionTypeSwapPlan SubscriptionActionType = "SWAP_PLAN" + SubscriptionActionTypeChangeBillingAnchorDate SubscriptionActionType = "CHANGE_BILLING_ANCHOR_DATE" ) func NewSubscriptionActionTypeFromString(s string) (SubscriptionActionType, error) { switch s { - case "DEFAULT_SUBSCRIPTION_ACTION_TYPE_DO_NOT_USE": - return SubscriptionActionTypeDefaultSubscriptionActionTypeDoNotUse, nil case "CANCEL": return SubscriptionActionTypeCancel, nil case "PAUSE": @@ -1537,8 +1484,6 @@ type SubscriptionEvent struct { SubscriptionEventType SubscriptionEventSubscriptionEventType `json:"subscription_event_type" url:"subscription_event_type"` // The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. EffectiveDate string `json:"effective_date" url:"effective_date"` - // The ID of the subscription plan associated with the subscription. - PlanID *string `json:"plan_id,omitempty" url:"plan_id,omitempty"` // The day-of-the-month the billing anchor date was changed to, if applicable. MonthlyBillingAnchorDate *int `json:"monthly_billing_anchor_date,omitempty" url:"monthly_billing_anchor_date,omitempty"` // Additional information about the subscription event. @@ -1573,13 +1518,6 @@ func (s *SubscriptionEvent) GetEffectiveDate() string { return s.EffectiveDate } -func (s *SubscriptionEvent) GetPlanID() *string { - if s == nil { - return nil - } - return s.PlanID -} - func (s *SubscriptionEvent) GetMonthlyBillingAnchorDate() *int { if s == nil { return nil @@ -1708,7 +1646,6 @@ const ( SubscriptionEventInfoCodeCustomerNoEmail SubscriptionEventInfoCode = "CUSTOMER_NO_EMAIL" SubscriptionEventInfoCodeCustomerNoName SubscriptionEventInfoCode = "CUSTOMER_NO_NAME" SubscriptionEventInfoCodeUserProvided SubscriptionEventInfoCode = "USER_PROVIDED" - SubscriptionEventInfoCodeInvoiceInvalid SubscriptionEventInfoCode = "INVOICE_INVALID" ) func NewSubscriptionEventInfoCodeFromString(s string) (SubscriptionEventInfoCode, error) { @@ -1725,8 +1662,6 @@ func NewSubscriptionEventInfoCodeFromString(s string) (SubscriptionEventInfoCode return SubscriptionEventInfoCodeCustomerNoName, nil case "USER_PROVIDED": return SubscriptionEventInfoCodeUserProvided, nil - case "INVOICE_INVALID": - return SubscriptionEventInfoCodeInvoiceInvalid, nil } var t SubscriptionEventInfoCode return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -1740,20 +1675,17 @@ func (s SubscriptionEventInfoCode) Ptr() *SubscriptionEventInfoCode { type SubscriptionEventSubscriptionEventType string const ( - SubscriptionEventSubscriptionEventTypeDefaultSubscriptionEventTypeDoNotUse SubscriptionEventSubscriptionEventType = "DEFAULT_SUBSCRIPTION_EVENT_TYPE_DO_NOT_USE" - SubscriptionEventSubscriptionEventTypeStartSubscription SubscriptionEventSubscriptionEventType = "START_SUBSCRIPTION" - SubscriptionEventSubscriptionEventTypePlanChange SubscriptionEventSubscriptionEventType = "PLAN_CHANGE" - SubscriptionEventSubscriptionEventTypeStopSubscription SubscriptionEventSubscriptionEventType = "STOP_SUBSCRIPTION" - SubscriptionEventSubscriptionEventTypeDeactivateSubscription SubscriptionEventSubscriptionEventType = "DEACTIVATE_SUBSCRIPTION" - SubscriptionEventSubscriptionEventTypeResumeSubscription SubscriptionEventSubscriptionEventType = "RESUME_SUBSCRIPTION" - SubscriptionEventSubscriptionEventTypePauseSubscription SubscriptionEventSubscriptionEventType = "PAUSE_SUBSCRIPTION" - SubscriptionEventSubscriptionEventTypeBillingAnchorDateChanged SubscriptionEventSubscriptionEventType = "BILLING_ANCHOR_DATE_CHANGED" + SubscriptionEventSubscriptionEventTypeStartSubscription SubscriptionEventSubscriptionEventType = "START_SUBSCRIPTION" + SubscriptionEventSubscriptionEventTypePlanChange SubscriptionEventSubscriptionEventType = "PLAN_CHANGE" + SubscriptionEventSubscriptionEventTypeStopSubscription SubscriptionEventSubscriptionEventType = "STOP_SUBSCRIPTION" + SubscriptionEventSubscriptionEventTypeDeactivateSubscription SubscriptionEventSubscriptionEventType = "DEACTIVATE_SUBSCRIPTION" + SubscriptionEventSubscriptionEventTypeResumeSubscription SubscriptionEventSubscriptionEventType = "RESUME_SUBSCRIPTION" + SubscriptionEventSubscriptionEventTypePauseSubscription SubscriptionEventSubscriptionEventType = "PAUSE_SUBSCRIPTION" + SubscriptionEventSubscriptionEventTypeBillingAnchorDateChanged SubscriptionEventSubscriptionEventType = "BILLING_ANCHOR_DATE_CHANGED" ) func NewSubscriptionEventSubscriptionEventTypeFromString(s string) (SubscriptionEventSubscriptionEventType, error) { switch s { - case "DEFAULT_SUBSCRIPTION_EVENT_TYPE_DO_NOT_USE": - return SubscriptionEventSubscriptionEventTypeDefaultSubscriptionEventTypeDoNotUse, nil case "START_SUBSCRIPTION": return SubscriptionEventSubscriptionEventTypeStartSubscription, nil case "PLAN_CHANGE": @@ -1831,18 +1763,15 @@ func (s *SubscriptionSource) String() string { type SubscriptionStatus string const ( - SubscriptionStatusDefaultSubscriptionStatusDoNotUse SubscriptionStatus = "DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE" - SubscriptionStatusPending SubscriptionStatus = "PENDING" - SubscriptionStatusActive SubscriptionStatus = "ACTIVE" - SubscriptionStatusCanceled SubscriptionStatus = "CANCELED" - SubscriptionStatusDeactivated SubscriptionStatus = "DEACTIVATED" - SubscriptionStatusPaused SubscriptionStatus = "PAUSED" + SubscriptionStatusPending SubscriptionStatus = "PENDING" + SubscriptionStatusActive SubscriptionStatus = "ACTIVE" + SubscriptionStatusCanceled SubscriptionStatus = "CANCELED" + SubscriptionStatusDeactivated SubscriptionStatus = "DEACTIVATED" + SubscriptionStatusPaused SubscriptionStatus = "PAUSED" ) func NewSubscriptionStatusFromString(s string) (SubscriptionStatus, error) { switch s { - case "DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE": - return SubscriptionStatusDefaultSubscriptionStatusDoNotUse, nil case "PENDING": return SubscriptionStatusPending, nil case "ACTIVE": diff --git a/team_members.go b/team_members.go index 7e2b140..710b78d 100644 --- a/team_members.go +++ b/team_members.go @@ -719,15 +719,12 @@ func (t *TeamMemberAssignedLocations) String() string { type TeamMemberAssignedLocationsAssignmentType string const ( - TeamMemberAssignedLocationsAssignmentTypeDoNotUse TeamMemberAssignedLocationsAssignmentType = "DO_NOT_USE" TeamMemberAssignedLocationsAssignmentTypeAllCurrentAndFutureLocations TeamMemberAssignedLocationsAssignmentType = "ALL_CURRENT_AND_FUTURE_LOCATIONS" TeamMemberAssignedLocationsAssignmentTypeExplicitLocations TeamMemberAssignedLocationsAssignmentType = "EXPLICIT_LOCATIONS" ) func NewTeamMemberAssignedLocationsAssignmentTypeFromString(s string) (TeamMemberAssignedLocationsAssignmentType, error) { switch s { - case "DO_NOT_USE": - return TeamMemberAssignedLocationsAssignmentTypeDoNotUse, nil case "ALL_CURRENT_AND_FUTURE_LOCATIONS": return TeamMemberAssignedLocationsAssignmentTypeAllCurrentAndFutureLocations, nil case "EXPLICIT_LOCATIONS": @@ -745,15 +742,12 @@ func (t TeamMemberAssignedLocationsAssignmentType) Ptr() *TeamMemberAssignedLoca type TeamMemberStatus string const ( - TeamMemberStatusStatusDoNotUse TeamMemberStatus = "STATUS_DO_NOT_USE" - TeamMemberStatusActive TeamMemberStatus = "ACTIVE" - TeamMemberStatusInactive TeamMemberStatus = "INACTIVE" + TeamMemberStatusActive TeamMemberStatus = "ACTIVE" + TeamMemberStatusInactive TeamMemberStatus = "INACTIVE" ) func NewTeamMemberStatusFromString(s string) (TeamMemberStatus, error) { switch s { - case "STATUS_DO_NOT_USE": - return TeamMemberStatusStatusDoNotUse, nil case "ACTIVE": return TeamMemberStatusActive, nil case "INACTIVE": diff --git a/terminal/actions.go b/terminal/actions.go index ff9ccc7..642dd25 100644 --- a/terminal/actions.go +++ b/terminal/actions.go @@ -6,7 +6,7 @@ import ( squaregosdk "github.com/square/square-go-sdk" ) -type CancelTerminalActionRequest struct { +type ActionsCancelRequest struct { // Unique ID for the desired `TerminalAction`. ActionID string `json:"-" url:"-"` } diff --git a/terminal/actions/client.go b/terminal/actions/client.go index d31febd..f40dd27 100644 --- a/terminal/actions/client.go +++ b/terminal/actions/client.go @@ -160,7 +160,7 @@ func (c *Client) Get( // Cancels a Terminal action request if the status of the request permits it. func (c *Client) Cancel( ctx context.Context, - request *terminal.CancelTerminalActionRequest, + request *terminal.ActionsCancelRequest, opts ...option.RequestOption, ) (*squaregosdk.CancelTerminalActionResponse, error) { options := core.NewRequestOptions(opts...) @@ -177,7 +177,6 @@ func (c *Client) Cancel( c.header.Clone(), options.ToHeader(), ) - headers.Set("Content-Type", "application/json") var response *squaregosdk.CancelTerminalActionResponse if err := c.caller.Call( @@ -190,7 +189,6 @@ func (c *Client) Cancel( BodyProperties: options.BodyProperties, QueryParameters: options.QueryParameters, Client: options.HTTPClient, - Request: request, Response: &response, }, ); err != nil { diff --git a/terminal/checkouts.go b/terminal/checkouts.go index a0bc100..a5a6903 100644 --- a/terminal/checkouts.go +++ b/terminal/checkouts.go @@ -6,7 +6,7 @@ import ( squaregosdk "github.com/square/square-go-sdk" ) -type CancelTerminalCheckoutRequest struct { +type CheckoutsCancelRequest struct { // The unique ID for the desired `TerminalCheckout`. CheckoutID string `json:"-" url:"-"` } diff --git a/terminal/checkouts/client.go b/terminal/checkouts/client.go index 65a8033..607e3f8 100644 --- a/terminal/checkouts/client.go +++ b/terminal/checkouts/client.go @@ -161,7 +161,7 @@ func (c *Client) Get( // Cancels a Terminal checkout request if the status of the request permits it. func (c *Client) Cancel( ctx context.Context, - request *terminal.CancelTerminalCheckoutRequest, + request *terminal.CheckoutsCancelRequest, opts ...option.RequestOption, ) (*squaregosdk.CancelTerminalCheckoutResponse, error) { options := core.NewRequestOptions(opts...) @@ -178,7 +178,6 @@ func (c *Client) Cancel( c.header.Clone(), options.ToHeader(), ) - headers.Set("Content-Type", "application/json") var response *squaregosdk.CancelTerminalCheckoutResponse if err := c.caller.Call( @@ -191,7 +190,6 @@ func (c *Client) Cancel( BodyProperties: options.BodyProperties, QueryParameters: options.QueryParameters, Client: options.HTTPClient, - Request: request, Response: &response, }, ); err != nil { diff --git a/terminal/refunds.go b/terminal/refunds.go index 4f7fd8d..a8160a6 100644 --- a/terminal/refunds.go +++ b/terminal/refunds.go @@ -6,7 +6,7 @@ import ( squaregosdk "github.com/square/square-go-sdk" ) -type CancelTerminalRefundRequest struct { +type RefundsCancelRequest struct { // The unique ID for the desired `TerminalRefund`. TerminalRefundID string `json:"-" url:"-"` } diff --git a/terminal/refunds/client.go b/terminal/refunds/client.go index 9621ffd..7549b20 100644 --- a/terminal/refunds/client.go +++ b/terminal/refunds/client.go @@ -160,7 +160,7 @@ func (c *Client) Get( // Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. func (c *Client) Cancel( ctx context.Context, - request *terminal.CancelTerminalRefundRequest, + request *terminal.RefundsCancelRequest, opts ...option.RequestOption, ) (*squaregosdk.CancelTerminalRefundResponse, error) { options := core.NewRequestOptions(opts...) @@ -177,7 +177,6 @@ func (c *Client) Cancel( c.header.Clone(), options.ToHeader(), ) - headers.Set("Content-Type", "application/json") var response *squaregosdk.CancelTerminalRefundResponse if err := c.caller.Call( @@ -190,7 +189,6 @@ func (c *Client) Cancel( BodyProperties: options.BodyProperties, QueryParameters: options.QueryParameters, Client: options.HTTPClient, - Request: request, Response: &response, }, ); err != nil { diff --git a/types.go b/types.go index ffb755d..b65cbbe 100644 --- a/types.go +++ b/types.go @@ -153,34 +153,19 @@ func (a *AccumulateLoyaltyPointsResponse) String() string { type ActionCancelReason string const ( - ActionCancelReasonActionCancelReasonDoNotUse ActionCancelReason = "ACTION_CANCEL_REASON_DO_NOT_USE" - ActionCancelReasonBuyerCanceled ActionCancelReason = "BUYER_CANCELED" - ActionCancelReasonSellerCanceled ActionCancelReason = "SELLER_CANCELED" - ActionCancelReasonTimedOut ActionCancelReason = "TIMED_OUT" - ActionCancelReasonUnsupported ActionCancelReason = "UNSUPPORTED" - ActionCancelReasonSellerDismissed ActionCancelReason = "SELLER_DISMISSED" - ActionCancelReasonTerminalTimedOut ActionCancelReason = "TERMINAL_TIMED_OUT" - ActionCancelReasonTerminalError ActionCancelReason = "TERMINAL_ERROR" + ActionCancelReasonBuyerCanceled ActionCancelReason = "BUYER_CANCELED" + ActionCancelReasonSellerCanceled ActionCancelReason = "SELLER_CANCELED" + ActionCancelReasonTimedOut ActionCancelReason = "TIMED_OUT" ) func NewActionCancelReasonFromString(s string) (ActionCancelReason, error) { switch s { - case "ACTION_CANCEL_REASON_DO_NOT_USE": - return ActionCancelReasonActionCancelReasonDoNotUse, nil case "BUYER_CANCELED": return ActionCancelReasonBuyerCanceled, nil case "SELLER_CANCELED": return ActionCancelReasonSellerCanceled, nil case "TIMED_OUT": return ActionCancelReasonTimedOut, nil - case "UNSUPPORTED": - return ActionCancelReasonUnsupported, nil - case "SELLER_DISMISSED": - return ActionCancelReasonSellerDismissed, nil - case "TERMINAL_TIMED_OUT": - return ActionCancelReasonTerminalTimedOut, nil - case "TERMINAL_ERROR": - return ActionCancelReasonTerminalError, nil } var t ActionCancelReason return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -546,201 +531,6 @@ func (a *AdjustLoyaltyPointsResponse) String() string { return fmt.Sprintf("%#v", a) } -// Represents a batched request included in a call to the **SubmitBatch** -// endpoint. -type BatchRequest struct { - // HTTP method for the API call. - // See [BatchRequestHttpMethod](#type-batchrequesthttpmethod) for possible values - Method BatchRequestHTTPMethod `json:"method" url:"method"` - // Endpoint path for the API call. - RelativePath string `json:"relative_path" url:"relative_path"` - // [Square access token](https://developer.squareup.com/docs/build-basics/access-tokens) for the API - // call. - AccessToken string `json:"access_token" url:"access_token"` - // Request body for the API call. Only used for API calls using POST. - Body map[string]*string `json:"body,omitempty" url:"body,omitempty"` - // Client-provided value to identify the request. - RequestID *string `json:"request_id,omitempty" url:"request_id,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (b *BatchRequest) GetMethod() BatchRequestHTTPMethod { - if b == nil { - return "" - } - return b.Method -} - -func (b *BatchRequest) GetRelativePath() string { - if b == nil { - return "" - } - return b.RelativePath -} - -func (b *BatchRequest) GetAccessToken() string { - if b == nil { - return "" - } - return b.AccessToken -} - -func (b *BatchRequest) GetBody() map[string]*string { - if b == nil { - return nil - } - return b.Body -} - -func (b *BatchRequest) GetRequestID() *string { - if b == nil { - return nil - } - return b.RequestID -} - -func (b *BatchRequest) GetExtraProperties() map[string]interface{} { - return b.extraProperties -} - -func (b *BatchRequest) UnmarshalJSON(data []byte) error { - type unmarshaler BatchRequest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *b = BatchRequest(value) - extraProperties, err := internal.ExtractExtraProperties(data, *b) - if err != nil { - return err - } - b.extraProperties = extraProperties - b.rawJSON = json.RawMessage(data) - return nil -} - -func (b *BatchRequest) String() string { - if len(b.rawJSON) > 0 { - if value, err := internal.StringifyJSON(b.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(b); err == nil { - return value - } - return fmt.Sprintf("%#v", b) -} - -// Indicates the applicable HTTP method. -type BatchRequestHTTPMethod string - -const ( - BatchRequestHTTPMethodGet BatchRequestHTTPMethod = "GET" - BatchRequestHTTPMethodPost BatchRequestHTTPMethod = "POST" - BatchRequestHTTPMethodPut BatchRequestHTTPMethod = "PUT" - BatchRequestHTTPMethodDelete BatchRequestHTTPMethod = "DELETE" -) - -func NewBatchRequestHTTPMethodFromString(s string) (BatchRequestHTTPMethod, error) { - switch s { - case "GET": - return BatchRequestHTTPMethodGet, nil - case "POST": - return BatchRequestHTTPMethodPost, nil - case "PUT": - return BatchRequestHTTPMethodPut, nil - case "DELETE": - return BatchRequestHTTPMethodDelete, nil - } - var t BatchRequestHTTPMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (b BatchRequestHTTPMethod) Ptr() *BatchRequestHTTPMethod { - return &b -} - -// Represents an individual response for a batched request to the -// **SubmitBatch** endpoint. -type BatchResponse struct { - // HTTP status code for the response - StatusCode *int `json:"status_code,omitempty" url:"status_code,omitempty"` - // The body of the response (if any). - Body map[string]string `json:"body,omitempty" url:"body,omitempty"` - // Contains any important headers for the response, indexed by header - // name. For example, if the response includes a pagination header, the header - // value is available from `headers["Link"]`. - Headers map[string]string `json:"headers,omitempty" url:"headers,omitempty"` - // The value provided in a request for `request_id` in the corresponding - // `BatchRequest` (if any). - RequestID *string `json:"request_id,omitempty" url:"request_id,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (b *BatchResponse) GetStatusCode() *int { - if b == nil { - return nil - } - return b.StatusCode -} - -func (b *BatchResponse) GetBody() map[string]string { - if b == nil { - return nil - } - return b.Body -} - -func (b *BatchResponse) GetHeaders() map[string]string { - if b == nil { - return nil - } - return b.Headers -} - -func (b *BatchResponse) GetRequestID() *string { - if b == nil { - return nil - } - return b.RequestID -} - -func (b *BatchResponse) GetExtraProperties() map[string]interface{} { - return b.extraProperties -} - -func (b *BatchResponse) UnmarshalJSON(data []byte) error { - type unmarshaler BatchResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *b = BatchResponse(value) - extraProperties, err := internal.ExtractExtraProperties(data, *b) - if err != nil { - return err - } - b.extraProperties = extraProperties - b.rawJSON = json.RawMessage(data) - return nil -} - -func (b *BatchResponse) String() string { - if len(b.rawJSON) > 0 { - if value, err := internal.StringifyJSON(b.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(b); err == nil { - return value - } - return fmt.Sprintf("%#v", b) -} - // A record of an employee's break during a shift. type Break struct { // The UUID for this object. @@ -1822,16 +1612,6 @@ type CashDrawerShift struct { EndedAt *string `json:"ended_at,omitempty" url:"ended_at,omitempty"` // The time when the shift was closed, in ISO 8601 format. ClosedAt *string `json:"closed_at,omitempty" url:"closed_at,omitempty"` - // The IDs of all employees that were logged into Square Point of Sale at any - // point while the cash drawer shift was open. - EmployeeIDs []string `json:"employee_ids,omitempty" url:"employee_ids,omitempty"` - // The ID of the employee that started the cash drawer shift. - OpeningEmployeeID *string `json:"opening_employee_id,omitempty" url:"opening_employee_id,omitempty"` - // The ID of the employee that ended the cash drawer shift. - EndingEmployeeID *string `json:"ending_employee_id,omitempty" url:"ending_employee_id,omitempty"` - // The ID of the employee that closed the cash drawer shift by auditing - // the cash drawer contents. - ClosingEmployeeID *string `json:"closing_employee_id,omitempty" url:"closing_employee_id,omitempty"` // The free-form text description of a cash drawer by an employee. Description *string `json:"description,omitempty" url:"description,omitempty"` // The amount of money in the cash drawer at the start of the shift. @@ -1923,34 +1703,6 @@ func (c *CashDrawerShift) GetClosedAt() *string { return c.ClosedAt } -func (c *CashDrawerShift) GetEmployeeIDs() []string { - if c == nil { - return nil - } - return c.EmployeeIDs -} - -func (c *CashDrawerShift) GetOpeningEmployeeID() *string { - if c == nil { - return nil - } - return c.OpeningEmployeeID -} - -func (c *CashDrawerShift) GetEndingEmployeeID() *string { - if c == nil { - return nil - } - return c.EndingEmployeeID -} - -func (c *CashDrawerShift) GetClosingEmployeeID() *string { - if c == nil { - return nil - } - return c.ClosingEmployeeID -} - func (c *CashDrawerShift) GetDescription() *string { if c == nil { return nil @@ -2098,8 +1850,6 @@ func (c *CashDrawerShift) String() string { type CashDrawerShiftEvent struct { // The unique ID of the event. ID *string `json:"id,omitempty" url:"id,omitempty"` - // The ID of the employee that created the event. - EmployeeID *string `json:"employee_id,omitempty" url:"employee_id,omitempty"` // The type of cash drawer shift event. // See [CashDrawerEventType](#type-cashdrawereventtype) for possible values EventType *CashDrawerEventType `json:"event_type,omitempty" url:"event_type,omitempty"` @@ -2127,13 +1877,6 @@ func (c *CashDrawerShiftEvent) GetID() *string { return c.ID } -func (c *CashDrawerShiftEvent) GetEmployeeID() *string { - if c == nil { - return nil - } - return c.EmployeeID -} - func (c *CashDrawerShiftEvent) GetEventType() *CashDrawerEventType { if c == nil { return nil @@ -2529,16 +2272,13 @@ func (c *CatalogCategory) String() string { type CatalogCategoryType string const ( - CatalogCategoryTypeCatalogCategoryTypeDoNotUse CatalogCategoryType = "CATALOG_CATEGORY_TYPE_DO_NOT_USE" - CatalogCategoryTypeRegularCategory CatalogCategoryType = "REGULAR_CATEGORY" - CatalogCategoryTypeMenuCategory CatalogCategoryType = "MENU_CATEGORY" - CatalogCategoryTypeKitchenCategory CatalogCategoryType = "KITCHEN_CATEGORY" + CatalogCategoryTypeRegularCategory CatalogCategoryType = "REGULAR_CATEGORY" + CatalogCategoryTypeMenuCategory CatalogCategoryType = "MENU_CATEGORY" + CatalogCategoryTypeKitchenCategory CatalogCategoryType = "KITCHEN_CATEGORY" ) func NewCatalogCategoryTypeFromString(s string) (CatalogCategoryType, error) { switch s { - case "CATALOG_CATEGORY_TYPE_DO_NOT_USE": - return CatalogCategoryTypeCatalogCategoryTypeDoNotUse, nil case "REGULAR_CATEGORY": return CatalogCategoryTypeRegularCategory, nil case "MENU_CATEGORY": @@ -2728,7 +2468,6 @@ func (c *CatalogCustomAttributeDefinition) String() string { type CatalogCustomAttributeDefinitionAppVisibility string const ( - CatalogCustomAttributeDefinitionAppVisibilityAppVisibilityDoNotUse CatalogCustomAttributeDefinitionAppVisibility = "APP_VISIBILITY_DO_NOT_USE" CatalogCustomAttributeDefinitionAppVisibilityAppVisibilityHidden CatalogCustomAttributeDefinitionAppVisibility = "APP_VISIBILITY_HIDDEN" CatalogCustomAttributeDefinitionAppVisibilityAppVisibilityReadOnly CatalogCustomAttributeDefinitionAppVisibility = "APP_VISIBILITY_READ_ONLY" CatalogCustomAttributeDefinitionAppVisibilityAppVisibilityReadWriteValues CatalogCustomAttributeDefinitionAppVisibility = "APP_VISIBILITY_READ_WRITE_VALUES" @@ -2736,8 +2475,6 @@ const ( func NewCatalogCustomAttributeDefinitionAppVisibilityFromString(s string) (CatalogCustomAttributeDefinitionAppVisibility, error) { switch s { - case "APP_VISIBILITY_DO_NOT_USE": - return CatalogCustomAttributeDefinitionAppVisibilityAppVisibilityDoNotUse, nil case "APP_VISIBILITY_HIDDEN": return CatalogCustomAttributeDefinitionAppVisibilityAppVisibilityHidden, nil case "APP_VISIBILITY_READ_ONLY": @@ -2932,15 +2669,12 @@ func (c *CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection type CatalogCustomAttributeDefinitionSellerVisibility string const ( - CatalogCustomAttributeDefinitionSellerVisibilitySellerVisibilityDoNotUse CatalogCustomAttributeDefinitionSellerVisibility = "SELLER_VISIBILITY_DO_NOT_USE" CatalogCustomAttributeDefinitionSellerVisibilitySellerVisibilityHidden CatalogCustomAttributeDefinitionSellerVisibility = "SELLER_VISIBILITY_HIDDEN" CatalogCustomAttributeDefinitionSellerVisibilitySellerVisibilityReadWriteValues CatalogCustomAttributeDefinitionSellerVisibility = "SELLER_VISIBILITY_READ_WRITE_VALUES" ) func NewCatalogCustomAttributeDefinitionSellerVisibilityFromString(s string) (CatalogCustomAttributeDefinitionSellerVisibility, error) { switch s { - case "SELLER_VISIBILITY_DO_NOT_USE": - return CatalogCustomAttributeDefinitionSellerVisibilitySellerVisibilityDoNotUse, nil case "SELLER_VISIBILITY_HIDDEN": return CatalogCustomAttributeDefinitionSellerVisibilitySellerVisibilityHidden, nil case "SELLER_VISIBILITY_READ_WRITE_VALUES": @@ -3010,34 +2744,22 @@ func (c *CatalogCustomAttributeDefinitionStringConfig) String() string { type CatalogCustomAttributeDefinitionType string const ( - CatalogCustomAttributeDefinitionTypeAttributeTypeDoNotUse CatalogCustomAttributeDefinitionType = "ATTRIBUTE_TYPE_DO_NOT_USE" - CatalogCustomAttributeDefinitionTypeString CatalogCustomAttributeDefinitionType = "STRING" - CatalogCustomAttributeDefinitionTypeInteger CatalogCustomAttributeDefinitionType = "INTEGER" - CatalogCustomAttributeDefinitionTypeBoolean CatalogCustomAttributeDefinitionType = "BOOLEAN" - CatalogCustomAttributeDefinitionTypeNumber CatalogCustomAttributeDefinitionType = "NUMBER" - CatalogCustomAttributeDefinitionTypeSelection CatalogCustomAttributeDefinitionType = "SELECTION" - CatalogCustomAttributeDefinitionTypeStringInt CatalogCustomAttributeDefinitionType = "STRING_INT" - CatalogCustomAttributeDefinitionTypeTokenInt CatalogCustomAttributeDefinitionType = "TOKEN_INT" + CatalogCustomAttributeDefinitionTypeString CatalogCustomAttributeDefinitionType = "STRING" + CatalogCustomAttributeDefinitionTypeBoolean CatalogCustomAttributeDefinitionType = "BOOLEAN" + CatalogCustomAttributeDefinitionTypeNumber CatalogCustomAttributeDefinitionType = "NUMBER" + CatalogCustomAttributeDefinitionTypeSelection CatalogCustomAttributeDefinitionType = "SELECTION" ) func NewCatalogCustomAttributeDefinitionTypeFromString(s string) (CatalogCustomAttributeDefinitionType, error) { switch s { - case "ATTRIBUTE_TYPE_DO_NOT_USE": - return CatalogCustomAttributeDefinitionTypeAttributeTypeDoNotUse, nil case "STRING": return CatalogCustomAttributeDefinitionTypeString, nil - case "INTEGER": - return CatalogCustomAttributeDefinitionTypeInteger, nil case "BOOLEAN": return CatalogCustomAttributeDefinitionTypeBoolean, nil case "NUMBER": return CatalogCustomAttributeDefinitionTypeNumber, nil case "SELECTION": return CatalogCustomAttributeDefinitionTypeSelection, nil - case "STRING_INT": - return CatalogCustomAttributeDefinitionTypeStringInt, nil - case "TOKEN_INT": - return CatalogCustomAttributeDefinitionTypeTokenInt, nil } var t CatalogCustomAttributeDefinitionType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -3602,9 +3324,6 @@ type CatalogItem struct { // and max limits that are specific to this item. Modifier lists // may also be added to or deleted from an item using `UpdateItemModifierLists`. ModifierListInfo []*CatalogItemModifierListInfo `json:"modifier_list_info,omitempty" url:"modifier_list_info,omitempty"` - // **Retired**. The URL of an image representing this item. Retired - // in favor of `image_id` in [CatalogObject](entity:CatalogObject). - ImageURL *string `json:"image_url,omitempty" url:"image_url,omitempty"` // A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have // at least one variation. Variations []*CatalogObject `json:"variations,omitempty" url:"variations,omitempty"` @@ -3759,13 +3478,6 @@ func (c *CatalogItem) GetModifierListInfo() []*CatalogItemModifierListInfo { return c.ModifierListInfo } -func (c *CatalogItem) GetImageURL() *string { - if c == nil { - return nil - } - return c.ImageURL -} - func (c *CatalogItem) GetVariations() []*CatalogObject { if c == nil { return nil @@ -4034,20 +3746,17 @@ func (c *CatalogItemFoodAndBeverageDetailsDietaryPreference) String() string { type CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference string const ( - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceStandardDietaryPreferenceDoNotUse CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "STANDARD_DIETARY_PREFERENCE_DO_NOT_USE" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceDairyFree CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "DAIRY_FREE" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceGlutenFree CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "GLUTEN_FREE" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceHalal CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "HALAL" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceKosher CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "KOSHER" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceNutFree CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "NUT_FREE" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceVegan CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "VEGAN" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceVegetarian CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "VEGETARIAN" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceDairyFree CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "DAIRY_FREE" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceGlutenFree CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "GLUTEN_FREE" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceHalal CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "HALAL" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceKosher CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "KOSHER" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceNutFree CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "NUT_FREE" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceVegan CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "VEGAN" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceVegetarian CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference = "VEGETARIAN" ) func NewCatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceFromString(s string) (CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference, error) { switch s { - case "STANDARD_DIETARY_PREFERENCE_DO_NOT_USE": - return CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceStandardDietaryPreferenceDoNotUse, nil case "DAIRY_FREE": return CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreferenceDairyFree, nil case "GLUTEN_FREE": @@ -4075,15 +3784,12 @@ func (c CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPrefere type CatalogItemFoodAndBeverageDetailsDietaryPreferenceType string const ( - CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeDietaryPreferenceTypeDoNotUse CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "DIETARY_PREFERENCE_TYPE_DO_NOT_USE" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeStandard CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "STANDARD" - CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeCustom CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "CUSTOM" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeStandard CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "STANDARD" + CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeCustom CatalogItemFoodAndBeverageDetailsDietaryPreferenceType = "CUSTOM" ) func NewCatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeFromString(s string) (CatalogItemFoodAndBeverageDetailsDietaryPreferenceType, error) { switch s { - case "DIETARY_PREFERENCE_TYPE_DO_NOT_USE": - return CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeDietaryPreferenceTypeDoNotUse, nil case "STANDARD": return CatalogItemFoodAndBeverageDetailsDietaryPreferenceTypeStandard, nil case "CUSTOM": @@ -4169,27 +3875,24 @@ func (c *CatalogItemFoodAndBeverageDetailsIngredient) String() string { type CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient string const ( - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientStandardIngredientDoNotUse CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "STANDARD_INGREDIENT_DO_NOT_USE" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientCelery CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "CELERY" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientCrustaceans CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "CRUSTACEANS" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientEggs CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "EGGS" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientFish CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "FISH" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientGluten CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "GLUTEN" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientLupin CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "LUPIN" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientMilk CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "MILK" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientMolluscs CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "MOLLUSCS" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientMustard CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "MUSTARD" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientPeanuts CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "PEANUTS" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientSesame CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "SESAME" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientSoy CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "SOY" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientSulphites CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "SULPHITES" - CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientTreeNuts CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "TREE_NUTS" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientCelery CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "CELERY" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientCrustaceans CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "CRUSTACEANS" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientEggs CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "EGGS" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientFish CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "FISH" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientGluten CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "GLUTEN" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientLupin CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "LUPIN" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientMilk CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "MILK" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientMolluscs CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "MOLLUSCS" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientMustard CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "MUSTARD" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientPeanuts CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "PEANUTS" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientSesame CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "SESAME" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientSoy CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "SOY" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientSulphites CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "SULPHITES" + CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientTreeNuts CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient = "TREE_NUTS" ) func NewCatalogItemFoodAndBeverageDetailsIngredientStandardIngredientFromString(s string) (CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient, error) { switch s { - case "STANDARD_INGREDIENT_DO_NOT_USE": - return CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientStandardIngredientDoNotUse, nil case "CELERY": return CatalogItemFoodAndBeverageDetailsIngredientStandardIngredientCelery, nil case "CRUSTACEANS": @@ -4633,17 +4336,12 @@ const ( CatalogItemProductTypeRegular CatalogItemProductType = "REGULAR" CatalogItemProductTypeGiftCard CatalogItemProductType = "GIFT_CARD" CatalogItemProductTypeAppointmentsService CatalogItemProductType = "APPOINTMENTS_SERVICE" - CatalogItemProductTypeClassTicket CatalogItemProductType = "CLASS_TICKET" CatalogItemProductTypeFoodAndBev CatalogItemProductType = "FOOD_AND_BEV" CatalogItemProductTypeEvent CatalogItemProductType = "EVENT" CatalogItemProductTypeDigital CatalogItemProductType = "DIGITAL" CatalogItemProductTypeDonation CatalogItemProductType = "DONATION" - CatalogItemProductTypeMembership CatalogItemProductType = "MEMBERSHIP" - CatalogItemProductTypeCreditPackage CatalogItemProductType = "CREDIT_PACKAGE" - CatalogItemProductTypeCombo CatalogItemProductType = "COMBO" CatalogItemProductTypeLegacySquareOnlineService CatalogItemProductType = "LEGACY_SQUARE_ONLINE_SERVICE" CatalogItemProductTypeLegacySquareOnlineMembership CatalogItemProductType = "LEGACY_SQUARE_ONLINE_MEMBERSHIP" - CatalogItemProductTypeAppointmentsMembership CatalogItemProductType = "APPOINTMENTS_MEMBERSHIP" ) func NewCatalogItemProductTypeFromString(s string) (CatalogItemProductType, error) { @@ -4654,8 +4352,6 @@ func NewCatalogItemProductTypeFromString(s string) (CatalogItemProductType, erro return CatalogItemProductTypeGiftCard, nil case "APPOINTMENTS_SERVICE": return CatalogItemProductTypeAppointmentsService, nil - case "CLASS_TICKET": - return CatalogItemProductTypeClassTicket, nil case "FOOD_AND_BEV": return CatalogItemProductTypeFoodAndBev, nil case "EVENT": @@ -4664,18 +4360,10 @@ func NewCatalogItemProductTypeFromString(s string) (CatalogItemProductType, erro return CatalogItemProductTypeDigital, nil case "DONATION": return CatalogItemProductTypeDonation, nil - case "MEMBERSHIP": - return CatalogItemProductTypeMembership, nil - case "CREDIT_PACKAGE": - return CatalogItemProductTypeCreditPackage, nil - case "COMBO": - return CatalogItemProductTypeCombo, nil case "LEGACY_SQUARE_ONLINE_SERVICE": return CatalogItemProductTypeLegacySquareOnlineService, nil case "LEGACY_SQUARE_ONLINE_MEMBERSHIP": return CatalogItemProductTypeLegacySquareOnlineMembership, nil - case "APPOINTMENTS_MEMBERSHIP": - return CatalogItemProductTypeAppointmentsMembership, nil } var t CatalogItemProductType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -10464,32 +10152,14 @@ func (c *CatalogObjectTimePeriod) String() string { type CatalogObjectType string const ( - CatalogObjectTypeCatalogObjectTypeDoNotUse CatalogObjectType = "CATALOG_OBJECT_TYPE_DO_NOT_USE" CatalogObjectTypeItem CatalogObjectType = "ITEM" CatalogObjectTypeImage CatalogObjectType = "IMAGE" - CatalogObjectTypePageTile CatalogObjectType = "PAGE_TILE" CatalogObjectTypeCategory CatalogObjectType = "CATEGORY" CatalogObjectTypeItemVariation CatalogObjectType = "ITEM_VARIATION" CatalogObjectTypeTax CatalogObjectType = "TAX" - CatalogObjectTypePlaceholder CatalogObjectType = "PLACEHOLDER" CatalogObjectTypeDiscount CatalogObjectType = "DISCOUNT" CatalogObjectTypeModifierList CatalogObjectType = "MODIFIER_LIST" CatalogObjectTypeModifier CatalogObjectType = "MODIFIER" - CatalogObjectTypeDiningOption CatalogObjectType = "DINING_OPTION" - CatalogObjectTypeTaxExemption CatalogObjectType = "TAX_EXEMPTION" - CatalogObjectTypeConfiguration CatalogObjectType = "CONFIGURATION" - CatalogObjectTypeTicketGroup CatalogObjectType = "TICKET_GROUP" - CatalogObjectTypeTicketTemplate CatalogObjectType = "TICKET_TEMPLATE" - CatalogObjectTypePage CatalogObjectType = "PAGE" - CatalogObjectTypeMenu CatalogObjectType = "MENU" - CatalogObjectTypeTag CatalogObjectType = "TAG" - CatalogObjectTypeFloorPlan CatalogObjectType = "FLOOR_PLAN" - CatalogObjectTypeFloorPlanTile CatalogObjectType = "FLOOR_PLAN_TILE" - CatalogObjectTypeVoidReason CatalogObjectType = "VOID_REASON" - CatalogObjectTypeFavoritesListPosition CatalogObjectType = "FAVORITES_LIST_POSITION" - CatalogObjectTypeMenuGroup CatalogObjectType = "MENU_GROUP" - CatalogObjectTypeItemVariationVendorInfo CatalogObjectType = "ITEM_VARIATION_VENDOR_INFO" - CatalogObjectTypeServiceCharge CatalogObjectType = "SERVICE_CHARGE" CatalogObjectTypePricingRule CatalogObjectType = "PRICING_RULE" CatalogObjectTypeProductSet CatalogObjectType = "PRODUCT_SET" CatalogObjectTypeTimePeriod CatalogObjectType = "TIME_PERIOD" @@ -10499,73 +10169,28 @@ const ( CatalogObjectTypeItemOptionVal CatalogObjectType = "ITEM_OPTION_VAL" CatalogObjectTypeCustomAttributeDefinition CatalogObjectType = "CUSTOM_ATTRIBUTE_DEFINITION" CatalogObjectTypeQuickAmountsSettings CatalogObjectType = "QUICK_AMOUNTS_SETTINGS" - CatalogObjectTypeComponent CatalogObjectType = "COMPONENT" - CatalogObjectTypeComposition CatalogObjectType = "COMPOSITION" - CatalogObjectTypeResource CatalogObjectType = "RESOURCE" - CatalogObjectTypeCheckoutLink CatalogObjectType = "CHECKOUT_LINK" - CatalogObjectTypeAddress CatalogObjectType = "ADDRESS" CatalogObjectTypeSubscriptionPlan CatalogObjectType = "SUBSCRIPTION_PLAN" CatalogObjectTypeAvailabilityPeriod CatalogObjectType = "AVAILABILITY_PERIOD" - CatalogObjectTypeCreditRedemptionPolicy CatalogObjectType = "CREDIT_REDEMPTION_POLICY" - CatalogObjectTypeAgeRestriction CatalogObjectType = "AGE_RESTRICTION" - CatalogObjectTypeSalePrice CatalogObjectType = "SALE_PRICE" - CatalogObjectTypeTaxCategory CatalogObjectType = "TAX_CATEGORY" ) func NewCatalogObjectTypeFromString(s string) (CatalogObjectType, error) { switch s { - case "CATALOG_OBJECT_TYPE_DO_NOT_USE": - return CatalogObjectTypeCatalogObjectTypeDoNotUse, nil case "ITEM": return CatalogObjectTypeItem, nil case "IMAGE": return CatalogObjectTypeImage, nil - case "PAGE_TILE": - return CatalogObjectTypePageTile, nil case "CATEGORY": return CatalogObjectTypeCategory, nil case "ITEM_VARIATION": return CatalogObjectTypeItemVariation, nil case "TAX": return CatalogObjectTypeTax, nil - case "PLACEHOLDER": - return CatalogObjectTypePlaceholder, nil case "DISCOUNT": return CatalogObjectTypeDiscount, nil case "MODIFIER_LIST": return CatalogObjectTypeModifierList, nil case "MODIFIER": return CatalogObjectTypeModifier, nil - case "DINING_OPTION": - return CatalogObjectTypeDiningOption, nil - case "TAX_EXEMPTION": - return CatalogObjectTypeTaxExemption, nil - case "CONFIGURATION": - return CatalogObjectTypeConfiguration, nil - case "TICKET_GROUP": - return CatalogObjectTypeTicketGroup, nil - case "TICKET_TEMPLATE": - return CatalogObjectTypeTicketTemplate, nil - case "PAGE": - return CatalogObjectTypePage, nil - case "MENU": - return CatalogObjectTypeMenu, nil - case "TAG": - return CatalogObjectTypeTag, nil - case "FLOOR_PLAN": - return CatalogObjectTypeFloorPlan, nil - case "FLOOR_PLAN_TILE": - return CatalogObjectTypeFloorPlanTile, nil - case "VOID_REASON": - return CatalogObjectTypeVoidReason, nil - case "FAVORITES_LIST_POSITION": - return CatalogObjectTypeFavoritesListPosition, nil - case "MENU_GROUP": - return CatalogObjectTypeMenuGroup, nil - case "ITEM_VARIATION_VENDOR_INFO": - return CatalogObjectTypeItemVariationVendorInfo, nil - case "SERVICE_CHARGE": - return CatalogObjectTypeServiceCharge, nil case "PRICING_RULE": return CatalogObjectTypePricingRule, nil case "PRODUCT_SET": @@ -10584,28 +10209,10 @@ func NewCatalogObjectTypeFromString(s string) (CatalogObjectType, error) { return CatalogObjectTypeCustomAttributeDefinition, nil case "QUICK_AMOUNTS_SETTINGS": return CatalogObjectTypeQuickAmountsSettings, nil - case "COMPONENT": - return CatalogObjectTypeComponent, nil - case "COMPOSITION": - return CatalogObjectTypeComposition, nil - case "RESOURCE": - return CatalogObjectTypeResource, nil - case "CHECKOUT_LINK": - return CatalogObjectTypeCheckoutLink, nil - case "ADDRESS": - return CatalogObjectTypeAddress, nil case "SUBSCRIPTION_PLAN": return CatalogObjectTypeSubscriptionPlan, nil case "AVAILABILITY_PERIOD": return CatalogObjectTypeAvailabilityPeriod, nil - case "CREDIT_REDEMPTION_POLICY": - return CatalogObjectTypeCreditRedemptionPolicy, nil - case "AGE_RESTRICTION": - return CatalogObjectTypeAgeRestriction, nil - case "SALE_PRICE": - return CatalogObjectTypeSalePrice, nil - case "TAX_CATEGORY": - return CatalogObjectTypeTaxCategory, nil } var t CatalogObjectType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -11032,15 +10639,12 @@ func (c *CatalogQuickAmount) String() string { type CatalogQuickAmountType string const ( - CatalogQuickAmountTypeQuickAmountTypeDoNotUse CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_DO_NOT_USE" - CatalogQuickAmountTypeQuickAmountTypeManual CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_MANUAL" - CatalogQuickAmountTypeQuickAmountTypeAuto CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_AUTO" + CatalogQuickAmountTypeQuickAmountTypeManual CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_MANUAL" + CatalogQuickAmountTypeQuickAmountTypeAuto CatalogQuickAmountType = "QUICK_AMOUNT_TYPE_AUTO" ) func NewCatalogQuickAmountTypeFromString(s string) (CatalogQuickAmountType, error) { switch s { - case "QUICK_AMOUNT_TYPE_DO_NOT_USE": - return CatalogQuickAmountTypeQuickAmountTypeDoNotUse, nil case "QUICK_AMOUNT_TYPE_MANUAL": return CatalogQuickAmountTypeQuickAmountTypeManual, nil case "QUICK_AMOUNT_TYPE_AUTO": @@ -11126,16 +10730,13 @@ func (c *CatalogQuickAmountsSettings) String() string { type CatalogQuickAmountsSettingsOption string const ( - CatalogQuickAmountsSettingsOptionQuickAmountsSettingsOptionDoNotUse CatalogQuickAmountsSettingsOption = "QUICK_AMOUNTS_SETTINGS_OPTION_DO_NOT_USE" - CatalogQuickAmountsSettingsOptionDisabled CatalogQuickAmountsSettingsOption = "DISABLED" - CatalogQuickAmountsSettingsOptionManual CatalogQuickAmountsSettingsOption = "MANUAL" - CatalogQuickAmountsSettingsOptionAuto CatalogQuickAmountsSettingsOption = "AUTO" + CatalogQuickAmountsSettingsOptionDisabled CatalogQuickAmountsSettingsOption = "DISABLED" + CatalogQuickAmountsSettingsOptionManual CatalogQuickAmountsSettingsOption = "MANUAL" + CatalogQuickAmountsSettingsOptionAuto CatalogQuickAmountsSettingsOption = "AUTO" ) func NewCatalogQuickAmountsSettingsOptionFromString(s string) (CatalogQuickAmountsSettingsOption, error) { switch s { - case "QUICK_AMOUNTS_SETTINGS_OPTION_DO_NOT_USE": - return CatalogQuickAmountsSettingsOptionQuickAmountsSettingsOptionDoNotUse, nil case "DISABLED": return CatalogQuickAmountsSettingsOptionDisabled, nil case "MANUAL": @@ -11238,14 +10839,6 @@ type CatalogSubscriptionPlan struct { // A list of SubscriptionPhase containing the [SubscriptionPhase](entity:SubscriptionPhase) for this plan. // This field it required. Not including this field will throw a REQUIRED_FIELD_MISSING error Phases []*SubscriptionPhase `json:"phases,omitempty" url:"phases,omitempty"` - // The day of the month the billing period starts. - // - // Retired in favour of the corresponding plan variation field. - MonthlyBillingAnchorDate *int64 `json:"monthly_billing_anchor_date,omitempty" url:"monthly_billing_anchor_date,omitempty"` - // Whether bills for this plan can be split for proration. - // - // Retired in favour of the corresponding plan variation field. - CanProrate *bool `json:"can_prorate,omitempty" url:"can_prorate,omitempty"` // The list of subscription plan variations available for this product SubscriptionPlanVariations []*CatalogObject `json:"subscription_plan_variations,omitempty" url:"subscription_plan_variations,omitempty"` // The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations. @@ -11273,20 +10866,6 @@ func (c *CatalogSubscriptionPlan) GetPhases() []*SubscriptionPhase { return c.Phases } -func (c *CatalogSubscriptionPlan) GetMonthlyBillingAnchorDate() *int64 { - if c == nil { - return nil - } - return c.MonthlyBillingAnchorDate -} - -func (c *CatalogSubscriptionPlan) GetCanProrate() *bool { - if c == nil { - return nil - } - return c.CanProrate -} - func (c *CatalogSubscriptionPlan) GetSubscriptionPlanVariations() []*CatalogObject { if c == nil { return nil @@ -11778,7 +11357,6 @@ func (c *CheckoutOptions) String() string { type CheckoutOptionsPaymentType string const ( - CheckoutOptionsPaymentTypePaymentTypeDoNotUse CheckoutOptionsPaymentType = "PAYMENT_TYPE_DO_NOT_USE" CheckoutOptionsPaymentTypeCardPresent CheckoutOptionsPaymentType = "CARD_PRESENT" CheckoutOptionsPaymentTypeManualCardEntry CheckoutOptionsPaymentType = "MANUAL_CARD_ENTRY" CheckoutOptionsPaymentTypeFelicaID CheckoutOptionsPaymentType = "FELICA_ID" @@ -11786,13 +11364,10 @@ const ( CheckoutOptionsPaymentTypeFelicaTransportationGroup CheckoutOptionsPaymentType = "FELICA_TRANSPORTATION_GROUP" CheckoutOptionsPaymentTypeFelicaAll CheckoutOptionsPaymentType = "FELICA_ALL" CheckoutOptionsPaymentTypePaypay CheckoutOptionsPaymentType = "PAYPAY" - CheckoutOptionsPaymentTypeCashApp CheckoutOptionsPaymentType = "CASH_APP" ) func NewCheckoutOptionsPaymentTypeFromString(s string) (CheckoutOptionsPaymentType, error) { switch s { - case "PAYMENT_TYPE_DO_NOT_USE": - return CheckoutOptionsPaymentTypePaymentTypeDoNotUse, nil case "CARD_PRESENT": return CheckoutOptionsPaymentTypeCardPresent, nil case "MANUAL_CARD_ENTRY": @@ -11807,8 +11382,6 @@ func NewCheckoutOptionsPaymentTypeFromString(s string) (CheckoutOptionsPaymentTy return CheckoutOptionsPaymentTypeFelicaAll, nil case "PAYPAY": return CheckoutOptionsPaymentTypePaypay, nil - case "CASH_APP": - return CheckoutOptionsPaymentTypeCashApp, nil } var t CheckoutOptionsPaymentType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -13864,6 +13437,7 @@ const ( CurrencySgd Currency = "SGD" CurrencyShp Currency = "SHP" CurrencySll Currency = "SLL" + CurrencySle Currency = "SLE" CurrencySos Currency = "SOS" CurrencySrd Currency = "SRD" CurrencySsp Currency = "SSP" @@ -14183,6 +13757,8 @@ func NewCurrencyFromString(s string) (Currency, error) { return CurrencyShp, nil case "SLL": return CurrencySll, nil + case "SLE": + return CurrencySle, nil case "SOS": return CurrencySos, nil case "SRD": @@ -14560,7 +14136,6 @@ func (c *CustomAttributeDefinition) String() string { type CustomAttributeDefinitionVisibility string const ( - CustomAttributeDefinitionVisibilityVisibilityDoNotUse CustomAttributeDefinitionVisibility = "VISIBILITY_DO_NOT_USE" CustomAttributeDefinitionVisibilityVisibilityHidden CustomAttributeDefinitionVisibility = "VISIBILITY_HIDDEN" CustomAttributeDefinitionVisibilityVisibilityReadOnly CustomAttributeDefinitionVisibility = "VISIBILITY_READ_ONLY" CustomAttributeDefinitionVisibilityVisibilityReadWriteValues CustomAttributeDefinitionVisibility = "VISIBILITY_READ_WRITE_VALUES" @@ -14568,8 +14143,6 @@ const ( func NewCustomAttributeDefinitionVisibilityFromString(s string) (CustomAttributeDefinitionVisibility, error) { switch s { - case "VISIBILITY_DO_NOT_USE": - return CustomAttributeDefinitionVisibilityVisibilityDoNotUse, nil case "VISIBILITY_HIDDEN": return CustomAttributeDefinitionVisibilityVisibilityHidden, nil case "VISIBILITY_READ_ONLY": @@ -14871,15 +14444,12 @@ func (d *DataCollectionOptions) String() string { type DataCollectionOptionsInputType string const ( - DataCollectionOptionsInputTypeInvalidType DataCollectionOptionsInputType = "INVALID_TYPE" DataCollectionOptionsInputTypeEmail DataCollectionOptionsInputType = "EMAIL" DataCollectionOptionsInputTypePhoneNumber DataCollectionOptionsInputType = "PHONE_NUMBER" ) func NewDataCollectionOptionsInputTypeFromString(s string) (DataCollectionOptionsInputType, error) { switch s { - case "INVALID_TYPE": - return DataCollectionOptionsInputTypeInvalidType, nil case "EMAIL": return DataCollectionOptionsInputTypeEmail, nil case "PHONE_NUMBER": @@ -15575,7 +15145,7 @@ type DeviceCode struct { // The unique id of the device that used this code. Populated when the device is paired up. DeviceID *string `json:"device_id,omitempty" url:"device_id,omitempty"` // The targeting product type of the device code. - ProductType ProductType `json:"product_type" url:"product_type"` + ProductType ProductType `json:"product_type,omitempty" url:"product_type,omitempty"` // The location assigned to this code. LocationID *string `json:"location_id,omitempty" url:"location_id,omitempty"` // The pairing status of the device code. @@ -15622,13 +15192,6 @@ func (d *DeviceCode) GetDeviceID() *string { return d.DeviceID } -func (d *DeviceCode) GetProductType() ProductType { - if d == nil { - return "" - } - return d.ProductType -} - func (d *DeviceCode) GetLocationID() *string { if d == nil { return nil @@ -16045,7 +15608,6 @@ func (d *DisputeEvidenceFile) String() string { type DisputeEvidenceType string const ( - DisputeEvidenceTypeUnknownType DisputeEvidenceType = "UNKNOWN_TYPE" DisputeEvidenceTypeGenericEvidence DisputeEvidenceType = "GENERIC_EVIDENCE" DisputeEvidenceTypeOnlineOrAppAccessLog DisputeEvidenceType = "ONLINE_OR_APP_ACCESS_LOG" DisputeEvidenceTypeAuthorizationDocumentation DisputeEvidenceType = "AUTHORIZATION_DOCUMENTATION" @@ -16065,8 +15627,6 @@ const ( func NewDisputeEvidenceTypeFromString(s string) (DisputeEvidenceType, error) { switch s { - case "UNKNOWN_TYPE": - return DisputeEvidenceTypeUnknownType, nil case "GENERIC_EVIDENCE": return DisputeEvidenceTypeGenericEvidence, nil case "ONLINE_OR_APP_ACCESS_LOG": @@ -16309,192 +15869,156 @@ func (e ErrorCategory) Ptr() *ErrorCategory { type ErrorCode string const ( - ErrorCodeInternalServerError ErrorCode = "INTERNAL_SERVER_ERROR" - ErrorCodeUnauthorized ErrorCode = "UNAUTHORIZED" - ErrorCodeAccessTokenExpired ErrorCode = "ACCESS_TOKEN_EXPIRED" - ErrorCodeAccessTokenRevoked ErrorCode = "ACCESS_TOKEN_REVOKED" - ErrorCodeClientDisabled ErrorCode = "CLIENT_DISABLED" - ErrorCodeForbidden ErrorCode = "FORBIDDEN" - ErrorCodeInsufficientScopes ErrorCode = "INSUFFICIENT_SCOPES" - ErrorCodeApplicationDisabled ErrorCode = "APPLICATION_DISABLED" - ErrorCodeV1Application ErrorCode = "V1_APPLICATION" - ErrorCodeV1AccessToken ErrorCode = "V1_ACCESS_TOKEN" - ErrorCodeCardProcessingNotEnabled ErrorCode = "CARD_PROCESSING_NOT_ENABLED" - ErrorCodeMerchantSubscriptionNotFound ErrorCode = "MERCHANT_SUBSCRIPTION_NOT_FOUND" - ErrorCodeBadRequest ErrorCode = "BAD_REQUEST" - ErrorCodeMissingRequiredParameter ErrorCode = "MISSING_REQUIRED_PARAMETER" - ErrorCodeIncorrectType ErrorCode = "INCORRECT_TYPE" - ErrorCodeInvalidTime ErrorCode = "INVALID_TIME" - ErrorCodeInvalidTimeRange ErrorCode = "INVALID_TIME_RANGE" - ErrorCodeInvalidValue ErrorCode = "INVALID_VALUE" - ErrorCodeInvalidCursor ErrorCode = "INVALID_CURSOR" - ErrorCodeUnknownQueryParameter ErrorCode = "UNKNOWN_QUERY_PARAMETER" - ErrorCodeConflictingParameters ErrorCode = "CONFLICTING_PARAMETERS" - ErrorCodeExpectedJSONBody ErrorCode = "EXPECTED_JSON_BODY" - ErrorCodeInvalidSortOrder ErrorCode = "INVALID_SORT_ORDER" - ErrorCodeValueRegexMismatch ErrorCode = "VALUE_REGEX_MISMATCH" - ErrorCodeValueTooShort ErrorCode = "VALUE_TOO_SHORT" - ErrorCodeValueTooLong ErrorCode = "VALUE_TOO_LONG" - ErrorCodeValueTooLow ErrorCode = "VALUE_TOO_LOW" - ErrorCodeValueTooHigh ErrorCode = "VALUE_TOO_HIGH" - ErrorCodeValueEmpty ErrorCode = "VALUE_EMPTY" - ErrorCodeArrayLengthTooLong ErrorCode = "ARRAY_LENGTH_TOO_LONG" - ErrorCodeArrayLengthTooShort ErrorCode = "ARRAY_LENGTH_TOO_SHORT" - ErrorCodeArrayEmpty ErrorCode = "ARRAY_EMPTY" - ErrorCodeExpectedBoolean ErrorCode = "EXPECTED_BOOLEAN" - ErrorCodeExpectedInteger ErrorCode = "EXPECTED_INTEGER" - ErrorCodeExpectedFloat ErrorCode = "EXPECTED_FLOAT" - ErrorCodeExpectedString ErrorCode = "EXPECTED_STRING" - ErrorCodeExpectedObject ErrorCode = "EXPECTED_OBJECT" - ErrorCodeExpectedArray ErrorCode = "EXPECTED_ARRAY" - ErrorCodeExpectedMap ErrorCode = "EXPECTED_MAP" - ErrorCodeExpectedBase64EncodedByteArray ErrorCode = "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" - ErrorCodeInvalidArrayValue ErrorCode = "INVALID_ARRAY_VALUE" - ErrorCodeInvalidEnumValue ErrorCode = "INVALID_ENUM_VALUE" - ErrorCodeInvalidContentType ErrorCode = "INVALID_CONTENT_TYPE" - ErrorCodeInvalidFormValue ErrorCode = "INVALID_FORM_VALUE" - ErrorCodeCustomerNotFound ErrorCode = "CUSTOMER_NOT_FOUND" - ErrorCodeBuyerNotFound ErrorCode = "BUYER_NOT_FOUND" - ErrorCodeOneInstrumentExpected ErrorCode = "ONE_INSTRUMENT_EXPECTED" - ErrorCodeNoFieldsSet ErrorCode = "NO_FIELDS_SET" - ErrorCodeDeprecatedFieldSet ErrorCode = "DEPRECATED_FIELD_SET" - ErrorCodeRetiredFieldSet ErrorCode = "RETIRED_FIELD_SET" - ErrorCodeTooManyMapEntries ErrorCode = "TOO_MANY_MAP_ENTRIES" - ErrorCodeMapKeyLengthTooShort ErrorCode = "MAP_KEY_LENGTH_TOO_SHORT" - ErrorCodeMapKeyLengthTooLong ErrorCode = "MAP_KEY_LENGTH_TOO_LONG" - ErrorCodeCustomerMissingName ErrorCode = "CUSTOMER_MISSING_NAME" - ErrorCodeCustomerMissingEmail ErrorCode = "CUSTOMER_MISSING_EMAIL" - ErrorCodeInvalidPauseLength ErrorCode = "INVALID_PAUSE_LENGTH" - ErrorCodeInvalidDate ErrorCode = "INVALID_DATE" - ErrorCodeJobTemplateNameTaken ErrorCode = "JOB_TEMPLATE_NAME_TAKEN" - ErrorCodeClientNotSupported ErrorCode = "CLIENT_NOT_SUPPORTED" - ErrorCodeUnsupportedCountry ErrorCode = "UNSUPPORTED_COUNTRY" - ErrorCodeUnsupportedCurrency ErrorCode = "UNSUPPORTED_CURRENCY" - ErrorCodeAppleTtpPinToken ErrorCode = "APPLE_TTP_PIN_TOKEN" - ErrorCodeCardExpired ErrorCode = "CARD_EXPIRED" - ErrorCodeInvalidExpiration ErrorCode = "INVALID_EXPIRATION" - ErrorCodeInvalidExpirationYear ErrorCode = "INVALID_EXPIRATION_YEAR" - ErrorCodeInvalidExpirationDate ErrorCode = "INVALID_EXPIRATION_DATE" - ErrorCodeUnsupportedCardBrand ErrorCode = "UNSUPPORTED_CARD_BRAND" - ErrorCodeUnsupportedEntryMethod ErrorCode = "UNSUPPORTED_ENTRY_METHOD" - ErrorCodeInvalidEncryptedCard ErrorCode = "INVALID_ENCRYPTED_CARD" - ErrorCodeInvalidCard ErrorCode = "INVALID_CARD" - ErrorCodePaymentAmountMismatch ErrorCode = "PAYMENT_AMOUNT_MISMATCH" - ErrorCodeGenericDecline ErrorCode = "GENERIC_DECLINE" - ErrorCodeCvvFailure ErrorCode = "CVV_FAILURE" - ErrorCodeAddressVerificationFailure ErrorCode = "ADDRESS_VERIFICATION_FAILURE" - ErrorCodeInvalidAccount ErrorCode = "INVALID_ACCOUNT" - ErrorCodeCurrencyMismatch ErrorCode = "CURRENCY_MISMATCH" - ErrorCodeInsufficientFunds ErrorCode = "INSUFFICIENT_FUNDS" - ErrorCodeInsufficientPermissions ErrorCode = "INSUFFICIENT_PERMISSIONS" - ErrorCodeCardholderInsufficientPermissions ErrorCode = "CARDHOLDER_INSUFFICIENT_PERMISSIONS" - ErrorCodeInvalidLocation ErrorCode = "INVALID_LOCATION" - ErrorCodeTransactionLimit ErrorCode = "TRANSACTION_LIMIT" - ErrorCodeVoiceFailure ErrorCode = "VOICE_FAILURE" - ErrorCodePanFailure ErrorCode = "PAN_FAILURE" - ErrorCodeExpirationFailure ErrorCode = "EXPIRATION_FAILURE" - ErrorCodeCardNotSupported ErrorCode = "CARD_NOT_SUPPORTED" - ErrorCodeIssuerInstallmentError ErrorCode = "ISSUER_INSTALLMENT_ERROR" - ErrorCodeInvalidPin ErrorCode = "INVALID_PIN" - ErrorCodeMissingPin ErrorCode = "MISSING_PIN" - ErrorCodeMissingAccountType ErrorCode = "MISSING_ACCOUNT_TYPE" - ErrorCodeInvalidPostalCode ErrorCode = "INVALID_POSTAL_CODE" - ErrorCodeInvalidFees ErrorCode = "INVALID_FEES" - ErrorCodeManuallyEnteredPaymentNotSupported ErrorCode = "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" - ErrorCodePaymentLimitExceeded ErrorCode = "PAYMENT_LIMIT_EXCEEDED" - ErrorCodeGiftCardAvailableAmount ErrorCode = "GIFT_CARD_AVAILABLE_AMOUNT" - ErrorCodeGiftCardBuyerDailyLimitReached ErrorCode = "GIFT_CARD_BUYER_DAILY_LIMIT_REACHED" - ErrorCodeGiftCardInvalidAmount ErrorCode = "GIFT_CARD_INVALID_AMOUNT" - ErrorCodeGiftCardMaxValueReached ErrorCode = "GIFT_CARD_MAX_VALUE_REACHED" - ErrorCodeGiftCardMerchantMaxOutstandingBalanceReached ErrorCode = "GIFT_CARD_MERCHANT_MAX_OUTSTANDING_BALANCE_REACHED" - ErrorCodeGiftCardValueAdditionLimitReached ErrorCode = "GIFT_CARD_VALUE_ADDITION_LIMIT_REACHED" - ErrorCodeAccountUnusable ErrorCode = "ACCOUNT_UNUSABLE" - ErrorCodeBuyerRefusedPayment ErrorCode = "BUYER_REFUSED_PAYMENT" - ErrorCodeDelayedTransactionExpired ErrorCode = "DELAYED_TRANSACTION_EXPIRED" - ErrorCodeDelayedTransactionCanceled ErrorCode = "DELAYED_TRANSACTION_CANCELED" - ErrorCodeDelayedTransactionCaptured ErrorCode = "DELAYED_TRANSACTION_CAPTURED" - ErrorCodeDelayedTransactionFailed ErrorCode = "DELAYED_TRANSACTION_FAILED" - ErrorCodeCardTokenExpired ErrorCode = "CARD_TOKEN_EXPIRED" - ErrorCodeCardTokenUsed ErrorCode = "CARD_TOKEN_USED" - ErrorCodeAmountTooHigh ErrorCode = "AMOUNT_TOO_HIGH" - ErrorCodeUnsupportedInstrumentType ErrorCode = "UNSUPPORTED_INSTRUMENT_TYPE" - ErrorCodeRefundAmountInvalid ErrorCode = "REFUND_AMOUNT_INVALID" - ErrorCodeRefundAlreadyPending ErrorCode = "REFUND_ALREADY_PENDING" - ErrorCodePaymentNotRefundable ErrorCode = "PAYMENT_NOT_REFUNDABLE" - ErrorCodeRefundDeclined ErrorCode = "REFUND_DECLINED" - ErrorCodeInsufficientPermissionsForRefund ErrorCode = "INSUFFICIENT_PERMISSIONS_FOR_REFUND" - ErrorCodeInvalidCardData ErrorCode = "INVALID_CARD_DATA" - ErrorCodeSourceUsed ErrorCode = "SOURCE_USED" - ErrorCodeSourceExpired ErrorCode = "SOURCE_EXPIRED" - ErrorCodeUnsupportedLoyaltyRewardTier ErrorCode = "UNSUPPORTED_LOYALTY_REWARD_TIER" - ErrorCodeLocationMismatch ErrorCode = "LOCATION_MISMATCH" - ErrorCodeOrderExpired ErrorCode = "ORDER_EXPIRED" - ErrorCodeOrderAlreadyUsed ErrorCode = "ORDER_ALREADY_USED" - ErrorCodeOrderTooManyCatalogObjects ErrorCode = "ORDER_TOO_MANY_CATALOG_OBJECTS" - ErrorCodeInsufficientInventory ErrorCode = "INSUFFICIENT_INVENTORY" - ErrorCodePriceMismatch ErrorCode = "PRICE_MISMATCH" - ErrorCodeVersionMismatch ErrorCode = "VERSION_MISMATCH" - ErrorCodeIdempotencyKeyReused ErrorCode = "IDEMPOTENCY_KEY_REUSED" - ErrorCodeUnexpectedValue ErrorCode = "UNEXPECTED_VALUE" - ErrorCodeSandboxNotSupported ErrorCode = "SANDBOX_NOT_SUPPORTED" - ErrorCodeInvalidEmailAddress ErrorCode = "INVALID_EMAIL_ADDRESS" - ErrorCodeInvalidPhoneNumber ErrorCode = "INVALID_PHONE_NUMBER" - ErrorCodeCheckoutExpired ErrorCode = "CHECKOUT_EXPIRED" - ErrorCodeBadCertificate ErrorCode = "BAD_CERTIFICATE" - ErrorCodeInvalidSquareVersionFormat ErrorCode = "INVALID_SQUARE_VERSION_FORMAT" - ErrorCodeAPIVersionIncompatible ErrorCode = "API_VERSION_INCOMPATIBLE" - ErrorCodeInvalidURL ErrorCode = "INVALID_URL" - ErrorCodeHTTPSOnly ErrorCode = "HTTPS_ONLY" - ErrorCodeUnreachableURL ErrorCode = "UNREACHABLE_URL" - ErrorCodeSessionExpired ErrorCode = "SESSION_EXPIRED" - ErrorCodeInvalidVerificationCode ErrorCode = "INVALID_VERIFICATION_CODE" - ErrorCodeCardPresenceRequired ErrorCode = "CARD_PRESENCE_REQUIRED" - ErrorCodeUnsupportedSourceType ErrorCode = "UNSUPPORTED_SOURCE_TYPE" - ErrorCodeCardMismatch ErrorCode = "CARD_MISMATCH" - ErrorCodePlaidError ErrorCode = "PLAID_ERROR" - ErrorCodePlaidErrorItemLoginRequired ErrorCode = "PLAID_ERROR_ITEM_LOGIN_REQUIRED" - ErrorCodePlaidErrorRateLimit ErrorCode = "PLAID_ERROR_RATE_LIMIT" - ErrorCodeCalculateFulfillmentRatesNoProfilesConfigured ErrorCode = "CALCULATE_FULFILLMENT_RATES_NO_PROFILES_CONFIGURED" - ErrorCodeCalculateFulfillmentRatesShipmentDestinationNotConfigured ErrorCode = "CALCULATE_FULFILLMENT_RATES_SHIPMENT_DESTINATION_NOT_CONFIGURED" - ErrorCodeCalculateFulfillmentRatesInvalidRecipientAddress ErrorCode = "CALCULATE_FULFILLMENT_RATES_INVALID_RECIPIENT_ADDRESS" - ErrorCodeCalculateFulfillmentRatesFulfillmentTypeNotSupported ErrorCode = "CALCULATE_FULFILLMENT_RATES_FULFILLMENT_TYPE_NOT_SUPPORTED" - ErrorCodeFulfillmentRateProfileDuplicateItem ErrorCode = "FULFILLMENT_RATE_PROFILE_DUPLICATE_ITEM" - ErrorCodeFulfillmentRateProfileInvalidItem ErrorCode = "FULFILLMENT_RATE_PROFILE_INVALID_ITEM" - ErrorCodeCardDeclined ErrorCode = "CARD_DECLINED" - ErrorCodeVerifyCvvFailure ErrorCode = "VERIFY_CVV_FAILURE" - ErrorCodeVerifyAvsFailure ErrorCode = "VERIFY_AVS_FAILURE" - ErrorCodeCardDeclinedCallIssuer ErrorCode = "CARD_DECLINED_CALL_ISSUER" - ErrorCodeCardDeclinedVerificationRequired ErrorCode = "CARD_DECLINED_VERIFICATION_REQUIRED" - ErrorCodeBadExpiration ErrorCode = "BAD_EXPIRATION" - ErrorCodeChipInsertionRequired ErrorCode = "CHIP_INSERTION_REQUIRED" - ErrorCodeAllowablePinTriesExceeded ErrorCode = "ALLOWABLE_PIN_TRIES_EXCEEDED" - ErrorCodeReservationDeclined ErrorCode = "RESERVATION_DECLINED" - ErrorCodeBlockedByBlocklist ErrorCode = "BLOCKED_BY_BLOCKLIST" - ErrorCodeFulfillmentPreferencesRestrictedDateNotUnique ErrorCode = "FULFILLMENT_PREFERENCES_RESTRICTED_DATE_NOT_UNIQUE" - ErrorCodeFulfillmentPreferencesInvalidSchedulingDatetime ErrorCode = "FULFILLMENT_PREFERENCES_INVALID_SCHEDULING_DATETIME" - ErrorCodeFulfillmentPreferencesInvalidFulfillmentAvailabilityWindow ErrorCode = "FULFILLMENT_PREFERENCES_INVALID_FULFILLMENT_AVAILABILITY_WINDOW" - ErrorCodeFulfillmentPreferencesFulfillmentScheduleNotAllowed ErrorCode = "FULFILLMENT_PREFERENCES_FULFILLMENT_SCHEDULE_NOT_ALLOWED" - ErrorCodeFulfillmentPreferencesAssignmentIsImmutable ErrorCode = "FULFILLMENT_PREFERENCES_ASSIGNMENT_IS_IMMUTABLE" - ErrorCodeInvalidTimezone ErrorCode = "INVALID_TIMEZONE" - ErrorCodeUnknownBodyParameter ErrorCode = "UNKNOWN_BODY_PARAMETER" - ErrorCodeFulfillmentPreferencesConflictingAssignmentType ErrorCode = "FULFILLMENT_PREFERENCES_CONFLICTING_ASSIGNMENT_TYPE" - ErrorCodeNotFound ErrorCode = "NOT_FOUND" - ErrorCodeApplePaymentProcessingCertificateHashNotFound ErrorCode = "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" - ErrorCodeMethodNotAllowed ErrorCode = "METHOD_NOT_ALLOWED" - ErrorCodeNotAcceptable ErrorCode = "NOT_ACCEPTABLE" - ErrorCodeRequestTimeout ErrorCode = "REQUEST_TIMEOUT" - ErrorCodeConflict ErrorCode = "CONFLICT" - ErrorCodeGone ErrorCode = "GONE" - ErrorCodeRequestEntityTooLarge ErrorCode = "REQUEST_ENTITY_TOO_LARGE" - ErrorCodeUnsupportedMediaType ErrorCode = "UNSUPPORTED_MEDIA_TYPE" - ErrorCodeUnprocessableEntity ErrorCode = "UNPROCESSABLE_ENTITY" - ErrorCodeRateLimited ErrorCode = "RATE_LIMITED" - ErrorCodeClientClosedRequest ErrorCode = "CLIENT_CLOSED_REQUEST" - ErrorCodeNotImplemented ErrorCode = "NOT_IMPLEMENTED" - ErrorCodeBadGateway ErrorCode = "BAD_GATEWAY" - ErrorCodeServiceUnavailable ErrorCode = "SERVICE_UNAVAILABLE" - ErrorCodeTemporaryError ErrorCode = "TEMPORARY_ERROR" - ErrorCodeGatewayTimeout ErrorCode = "GATEWAY_TIMEOUT" + ErrorCodeInternalServerError ErrorCode = "INTERNAL_SERVER_ERROR" + ErrorCodeUnauthorized ErrorCode = "UNAUTHORIZED" + ErrorCodeAccessTokenExpired ErrorCode = "ACCESS_TOKEN_EXPIRED" + ErrorCodeAccessTokenRevoked ErrorCode = "ACCESS_TOKEN_REVOKED" + ErrorCodeClientDisabled ErrorCode = "CLIENT_DISABLED" + ErrorCodeForbidden ErrorCode = "FORBIDDEN" + ErrorCodeInsufficientScopes ErrorCode = "INSUFFICIENT_SCOPES" + ErrorCodeApplicationDisabled ErrorCode = "APPLICATION_DISABLED" + ErrorCodeV1Application ErrorCode = "V1_APPLICATION" + ErrorCodeV1AccessToken ErrorCode = "V1_ACCESS_TOKEN" + ErrorCodeCardProcessingNotEnabled ErrorCode = "CARD_PROCESSING_NOT_ENABLED" + ErrorCodeMerchantSubscriptionNotFound ErrorCode = "MERCHANT_SUBSCRIPTION_NOT_FOUND" + ErrorCodeBadRequest ErrorCode = "BAD_REQUEST" + ErrorCodeMissingRequiredParameter ErrorCode = "MISSING_REQUIRED_PARAMETER" + ErrorCodeIncorrectType ErrorCode = "INCORRECT_TYPE" + ErrorCodeInvalidTime ErrorCode = "INVALID_TIME" + ErrorCodeInvalidTimeRange ErrorCode = "INVALID_TIME_RANGE" + ErrorCodeInvalidValue ErrorCode = "INVALID_VALUE" + ErrorCodeInvalidCursor ErrorCode = "INVALID_CURSOR" + ErrorCodeUnknownQueryParameter ErrorCode = "UNKNOWN_QUERY_PARAMETER" + ErrorCodeConflictingParameters ErrorCode = "CONFLICTING_PARAMETERS" + ErrorCodeExpectedJSONBody ErrorCode = "EXPECTED_JSON_BODY" + ErrorCodeInvalidSortOrder ErrorCode = "INVALID_SORT_ORDER" + ErrorCodeValueRegexMismatch ErrorCode = "VALUE_REGEX_MISMATCH" + ErrorCodeValueTooShort ErrorCode = "VALUE_TOO_SHORT" + ErrorCodeValueTooLong ErrorCode = "VALUE_TOO_LONG" + ErrorCodeValueTooLow ErrorCode = "VALUE_TOO_LOW" + ErrorCodeValueTooHigh ErrorCode = "VALUE_TOO_HIGH" + ErrorCodeValueEmpty ErrorCode = "VALUE_EMPTY" + ErrorCodeArrayLengthTooLong ErrorCode = "ARRAY_LENGTH_TOO_LONG" + ErrorCodeArrayLengthTooShort ErrorCode = "ARRAY_LENGTH_TOO_SHORT" + ErrorCodeArrayEmpty ErrorCode = "ARRAY_EMPTY" + ErrorCodeExpectedBoolean ErrorCode = "EXPECTED_BOOLEAN" + ErrorCodeExpectedInteger ErrorCode = "EXPECTED_INTEGER" + ErrorCodeExpectedFloat ErrorCode = "EXPECTED_FLOAT" + ErrorCodeExpectedString ErrorCode = "EXPECTED_STRING" + ErrorCodeExpectedObject ErrorCode = "EXPECTED_OBJECT" + ErrorCodeExpectedArray ErrorCode = "EXPECTED_ARRAY" + ErrorCodeExpectedMap ErrorCode = "EXPECTED_MAP" + ErrorCodeExpectedBase64EncodedByteArray ErrorCode = "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" + ErrorCodeInvalidArrayValue ErrorCode = "INVALID_ARRAY_VALUE" + ErrorCodeInvalidEnumValue ErrorCode = "INVALID_ENUM_VALUE" + ErrorCodeInvalidContentType ErrorCode = "INVALID_CONTENT_TYPE" + ErrorCodeInvalidFormValue ErrorCode = "INVALID_FORM_VALUE" + ErrorCodeCustomerNotFound ErrorCode = "CUSTOMER_NOT_FOUND" + ErrorCodeOneInstrumentExpected ErrorCode = "ONE_INSTRUMENT_EXPECTED" + ErrorCodeNoFieldsSet ErrorCode = "NO_FIELDS_SET" + ErrorCodeTooManyMapEntries ErrorCode = "TOO_MANY_MAP_ENTRIES" + ErrorCodeMapKeyLengthTooShort ErrorCode = "MAP_KEY_LENGTH_TOO_SHORT" + ErrorCodeMapKeyLengthTooLong ErrorCode = "MAP_KEY_LENGTH_TOO_LONG" + ErrorCodeCustomerMissingName ErrorCode = "CUSTOMER_MISSING_NAME" + ErrorCodeCustomerMissingEmail ErrorCode = "CUSTOMER_MISSING_EMAIL" + ErrorCodeInvalidPauseLength ErrorCode = "INVALID_PAUSE_LENGTH" + ErrorCodeInvalidDate ErrorCode = "INVALID_DATE" + ErrorCodeUnsupportedCountry ErrorCode = "UNSUPPORTED_COUNTRY" + ErrorCodeUnsupportedCurrency ErrorCode = "UNSUPPORTED_CURRENCY" + ErrorCodeAppleTtpPinToken ErrorCode = "APPLE_TTP_PIN_TOKEN" + ErrorCodeCardExpired ErrorCode = "CARD_EXPIRED" + ErrorCodeInvalidExpiration ErrorCode = "INVALID_EXPIRATION" + ErrorCodeInvalidExpirationYear ErrorCode = "INVALID_EXPIRATION_YEAR" + ErrorCodeInvalidExpirationDate ErrorCode = "INVALID_EXPIRATION_DATE" + ErrorCodeUnsupportedCardBrand ErrorCode = "UNSUPPORTED_CARD_BRAND" + ErrorCodeUnsupportedEntryMethod ErrorCode = "UNSUPPORTED_ENTRY_METHOD" + ErrorCodeInvalidEncryptedCard ErrorCode = "INVALID_ENCRYPTED_CARD" + ErrorCodeInvalidCard ErrorCode = "INVALID_CARD" + ErrorCodePaymentAmountMismatch ErrorCode = "PAYMENT_AMOUNT_MISMATCH" + ErrorCodeGenericDecline ErrorCode = "GENERIC_DECLINE" + ErrorCodeCvvFailure ErrorCode = "CVV_FAILURE" + ErrorCodeAddressVerificationFailure ErrorCode = "ADDRESS_VERIFICATION_FAILURE" + ErrorCodeInvalidAccount ErrorCode = "INVALID_ACCOUNT" + ErrorCodeCurrencyMismatch ErrorCode = "CURRENCY_MISMATCH" + ErrorCodeInsufficientFunds ErrorCode = "INSUFFICIENT_FUNDS" + ErrorCodeInsufficientPermissions ErrorCode = "INSUFFICIENT_PERMISSIONS" + ErrorCodeCardholderInsufficientPermissions ErrorCode = "CARDHOLDER_INSUFFICIENT_PERMISSIONS" + ErrorCodeInvalidLocation ErrorCode = "INVALID_LOCATION" + ErrorCodeTransactionLimit ErrorCode = "TRANSACTION_LIMIT" + ErrorCodeVoiceFailure ErrorCode = "VOICE_FAILURE" + ErrorCodePanFailure ErrorCode = "PAN_FAILURE" + ErrorCodeExpirationFailure ErrorCode = "EXPIRATION_FAILURE" + ErrorCodeCardNotSupported ErrorCode = "CARD_NOT_SUPPORTED" + ErrorCodeInvalidPin ErrorCode = "INVALID_PIN" + ErrorCodeMissingPin ErrorCode = "MISSING_PIN" + ErrorCodeMissingAccountType ErrorCode = "MISSING_ACCOUNT_TYPE" + ErrorCodeInvalidPostalCode ErrorCode = "INVALID_POSTAL_CODE" + ErrorCodeInvalidFees ErrorCode = "INVALID_FEES" + ErrorCodeManuallyEnteredPaymentNotSupported ErrorCode = "MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED" + ErrorCodePaymentLimitExceeded ErrorCode = "PAYMENT_LIMIT_EXCEEDED" + ErrorCodeGiftCardAvailableAmount ErrorCode = "GIFT_CARD_AVAILABLE_AMOUNT" + ErrorCodeAccountUnusable ErrorCode = "ACCOUNT_UNUSABLE" + ErrorCodeBuyerRefusedPayment ErrorCode = "BUYER_REFUSED_PAYMENT" + ErrorCodeDelayedTransactionExpired ErrorCode = "DELAYED_TRANSACTION_EXPIRED" + ErrorCodeDelayedTransactionCanceled ErrorCode = "DELAYED_TRANSACTION_CANCELED" + ErrorCodeDelayedTransactionCaptured ErrorCode = "DELAYED_TRANSACTION_CAPTURED" + ErrorCodeDelayedTransactionFailed ErrorCode = "DELAYED_TRANSACTION_FAILED" + ErrorCodeCardTokenExpired ErrorCode = "CARD_TOKEN_EXPIRED" + ErrorCodeCardTokenUsed ErrorCode = "CARD_TOKEN_USED" + ErrorCodeAmountTooHigh ErrorCode = "AMOUNT_TOO_HIGH" + ErrorCodeUnsupportedInstrumentType ErrorCode = "UNSUPPORTED_INSTRUMENT_TYPE" + ErrorCodeRefundAmountInvalid ErrorCode = "REFUND_AMOUNT_INVALID" + ErrorCodeRefundAlreadyPending ErrorCode = "REFUND_ALREADY_PENDING" + ErrorCodePaymentNotRefundable ErrorCode = "PAYMENT_NOT_REFUNDABLE" + ErrorCodePaymentNotRefundableDueToDispute ErrorCode = "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE" + ErrorCodeRefundDeclined ErrorCode = "REFUND_DECLINED" + ErrorCodeInsufficientPermissionsForRefund ErrorCode = "INSUFFICIENT_PERMISSIONS_FOR_REFUND" + ErrorCodeInvalidCardData ErrorCode = "INVALID_CARD_DATA" + ErrorCodeSourceUsed ErrorCode = "SOURCE_USED" + ErrorCodeSourceExpired ErrorCode = "SOURCE_EXPIRED" + ErrorCodeUnsupportedLoyaltyRewardTier ErrorCode = "UNSUPPORTED_LOYALTY_REWARD_TIER" + ErrorCodeLocationMismatch ErrorCode = "LOCATION_MISMATCH" + ErrorCodeIdempotencyKeyReused ErrorCode = "IDEMPOTENCY_KEY_REUSED" + ErrorCodeUnexpectedValue ErrorCode = "UNEXPECTED_VALUE" + ErrorCodeSandboxNotSupported ErrorCode = "SANDBOX_NOT_SUPPORTED" + ErrorCodeInvalidEmailAddress ErrorCode = "INVALID_EMAIL_ADDRESS" + ErrorCodeInvalidPhoneNumber ErrorCode = "INVALID_PHONE_NUMBER" + ErrorCodeCheckoutExpired ErrorCode = "CHECKOUT_EXPIRED" + ErrorCodeBadCertificate ErrorCode = "BAD_CERTIFICATE" + ErrorCodeInvalidSquareVersionFormat ErrorCode = "INVALID_SQUARE_VERSION_FORMAT" + ErrorCodeAPIVersionIncompatible ErrorCode = "API_VERSION_INCOMPATIBLE" + ErrorCodeCardPresenceRequired ErrorCode = "CARD_PRESENCE_REQUIRED" + ErrorCodeUnsupportedSourceType ErrorCode = "UNSUPPORTED_SOURCE_TYPE" + ErrorCodeCardMismatch ErrorCode = "CARD_MISMATCH" + ErrorCodePlaidError ErrorCode = "PLAID_ERROR" + ErrorCodePlaidErrorItemLoginRequired ErrorCode = "PLAID_ERROR_ITEM_LOGIN_REQUIRED" + ErrorCodePlaidErrorRateLimit ErrorCode = "PLAID_ERROR_RATE_LIMIT" + ErrorCodeCardDeclined ErrorCode = "CARD_DECLINED" + ErrorCodeVerifyCvvFailure ErrorCode = "VERIFY_CVV_FAILURE" + ErrorCodeVerifyAvsFailure ErrorCode = "VERIFY_AVS_FAILURE" + ErrorCodeCardDeclinedCallIssuer ErrorCode = "CARD_DECLINED_CALL_ISSUER" + ErrorCodeCardDeclinedVerificationRequired ErrorCode = "CARD_DECLINED_VERIFICATION_REQUIRED" + ErrorCodeBadExpiration ErrorCode = "BAD_EXPIRATION" + ErrorCodeChipInsertionRequired ErrorCode = "CHIP_INSERTION_REQUIRED" + ErrorCodeAllowablePinTriesExceeded ErrorCode = "ALLOWABLE_PIN_TRIES_EXCEEDED" + ErrorCodeReservationDeclined ErrorCode = "RESERVATION_DECLINED" + ErrorCodeUnknownBodyParameter ErrorCode = "UNKNOWN_BODY_PARAMETER" + ErrorCodeNotFound ErrorCode = "NOT_FOUND" + ErrorCodeApplePaymentProcessingCertificateHashNotFound ErrorCode = "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND" + ErrorCodeMethodNotAllowed ErrorCode = "METHOD_NOT_ALLOWED" + ErrorCodeNotAcceptable ErrorCode = "NOT_ACCEPTABLE" + ErrorCodeRequestTimeout ErrorCode = "REQUEST_TIMEOUT" + ErrorCodeConflict ErrorCode = "CONFLICT" + ErrorCodeGone ErrorCode = "GONE" + ErrorCodeRequestEntityTooLarge ErrorCode = "REQUEST_ENTITY_TOO_LARGE" + ErrorCodeUnsupportedMediaType ErrorCode = "UNSUPPORTED_MEDIA_TYPE" + ErrorCodeUnprocessableEntity ErrorCode = "UNPROCESSABLE_ENTITY" + ErrorCodeRateLimited ErrorCode = "RATE_LIMITED" + ErrorCodeNotImplemented ErrorCode = "NOT_IMPLEMENTED" + ErrorCodeBadGateway ErrorCode = "BAD_GATEWAY" + ErrorCodeServiceUnavailable ErrorCode = "SERVICE_UNAVAILABLE" + ErrorCodeTemporaryError ErrorCode = "TEMPORARY_ERROR" + ErrorCodeGatewayTimeout ErrorCode = "GATEWAY_TIMEOUT" ) func NewErrorCodeFromString(s string) (ErrorCode, error) { @@ -16589,16 +16113,10 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeInvalidFormValue, nil case "CUSTOMER_NOT_FOUND": return ErrorCodeCustomerNotFound, nil - case "BUYER_NOT_FOUND": - return ErrorCodeBuyerNotFound, nil case "ONE_INSTRUMENT_EXPECTED": return ErrorCodeOneInstrumentExpected, nil case "NO_FIELDS_SET": return ErrorCodeNoFieldsSet, nil - case "DEPRECATED_FIELD_SET": - return ErrorCodeDeprecatedFieldSet, nil - case "RETIRED_FIELD_SET": - return ErrorCodeRetiredFieldSet, nil case "TOO_MANY_MAP_ENTRIES": return ErrorCodeTooManyMapEntries, nil case "MAP_KEY_LENGTH_TOO_SHORT": @@ -16613,10 +16131,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeInvalidPauseLength, nil case "INVALID_DATE": return ErrorCodeInvalidDate, nil - case "JOB_TEMPLATE_NAME_TAKEN": - return ErrorCodeJobTemplateNameTaken, nil - case "CLIENT_NOT_SUPPORTED": - return ErrorCodeClientNotSupported, nil case "UNSUPPORTED_COUNTRY": return ErrorCodeUnsupportedCountry, nil case "UNSUPPORTED_CURRENCY": @@ -16669,8 +16183,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeExpirationFailure, nil case "CARD_NOT_SUPPORTED": return ErrorCodeCardNotSupported, nil - case "ISSUER_INSTALLMENT_ERROR": - return ErrorCodeIssuerInstallmentError, nil case "INVALID_PIN": return ErrorCodeInvalidPin, nil case "MISSING_PIN": @@ -16687,16 +16199,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodePaymentLimitExceeded, nil case "GIFT_CARD_AVAILABLE_AMOUNT": return ErrorCodeGiftCardAvailableAmount, nil - case "GIFT_CARD_BUYER_DAILY_LIMIT_REACHED": - return ErrorCodeGiftCardBuyerDailyLimitReached, nil - case "GIFT_CARD_INVALID_AMOUNT": - return ErrorCodeGiftCardInvalidAmount, nil - case "GIFT_CARD_MAX_VALUE_REACHED": - return ErrorCodeGiftCardMaxValueReached, nil - case "GIFT_CARD_MERCHANT_MAX_OUTSTANDING_BALANCE_REACHED": - return ErrorCodeGiftCardMerchantMaxOutstandingBalanceReached, nil - case "GIFT_CARD_VALUE_ADDITION_LIMIT_REACHED": - return ErrorCodeGiftCardValueAdditionLimitReached, nil case "ACCOUNT_UNUSABLE": return ErrorCodeAccountUnusable, nil case "BUYER_REFUSED_PAYMENT": @@ -16723,6 +16225,8 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeRefundAlreadyPending, nil case "PAYMENT_NOT_REFUNDABLE": return ErrorCodePaymentNotRefundable, nil + case "PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE": + return ErrorCodePaymentNotRefundableDueToDispute, nil case "REFUND_DECLINED": return ErrorCodeRefundDeclined, nil case "INSUFFICIENT_PERMISSIONS_FOR_REFUND": @@ -16737,18 +16241,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeUnsupportedLoyaltyRewardTier, nil case "LOCATION_MISMATCH": return ErrorCodeLocationMismatch, nil - case "ORDER_EXPIRED": - return ErrorCodeOrderExpired, nil - case "ORDER_ALREADY_USED": - return ErrorCodeOrderAlreadyUsed, nil - case "ORDER_TOO_MANY_CATALOG_OBJECTS": - return ErrorCodeOrderTooManyCatalogObjects, nil - case "INSUFFICIENT_INVENTORY": - return ErrorCodeInsufficientInventory, nil - case "PRICE_MISMATCH": - return ErrorCodePriceMismatch, nil - case "VERSION_MISMATCH": - return ErrorCodeVersionMismatch, nil case "IDEMPOTENCY_KEY_REUSED": return ErrorCodeIdempotencyKeyReused, nil case "UNEXPECTED_VALUE": @@ -16767,16 +16259,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeInvalidSquareVersionFormat, nil case "API_VERSION_INCOMPATIBLE": return ErrorCodeAPIVersionIncompatible, nil - case "INVALID_URL": - return ErrorCodeInvalidURL, nil - case "HTTPS_ONLY": - return ErrorCodeHTTPSOnly, nil - case "UNREACHABLE_URL": - return ErrorCodeUnreachableURL, nil - case "SESSION_EXPIRED": - return ErrorCodeSessionExpired, nil - case "INVALID_VERIFICATION_CODE": - return ErrorCodeInvalidVerificationCode, nil case "CARD_PRESENCE_REQUIRED": return ErrorCodeCardPresenceRequired, nil case "UNSUPPORTED_SOURCE_TYPE": @@ -16789,18 +16271,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodePlaidErrorItemLoginRequired, nil case "PLAID_ERROR_RATE_LIMIT": return ErrorCodePlaidErrorRateLimit, nil - case "CALCULATE_FULFILLMENT_RATES_NO_PROFILES_CONFIGURED": - return ErrorCodeCalculateFulfillmentRatesNoProfilesConfigured, nil - case "CALCULATE_FULFILLMENT_RATES_SHIPMENT_DESTINATION_NOT_CONFIGURED": - return ErrorCodeCalculateFulfillmentRatesShipmentDestinationNotConfigured, nil - case "CALCULATE_FULFILLMENT_RATES_INVALID_RECIPIENT_ADDRESS": - return ErrorCodeCalculateFulfillmentRatesInvalidRecipientAddress, nil - case "CALCULATE_FULFILLMENT_RATES_FULFILLMENT_TYPE_NOT_SUPPORTED": - return ErrorCodeCalculateFulfillmentRatesFulfillmentTypeNotSupported, nil - case "FULFILLMENT_RATE_PROFILE_DUPLICATE_ITEM": - return ErrorCodeFulfillmentRateProfileDuplicateItem, nil - case "FULFILLMENT_RATE_PROFILE_INVALID_ITEM": - return ErrorCodeFulfillmentRateProfileInvalidItem, nil case "CARD_DECLINED": return ErrorCodeCardDeclined, nil case "VERIFY_CVV_FAILURE": @@ -16819,24 +16289,8 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeAllowablePinTriesExceeded, nil case "RESERVATION_DECLINED": return ErrorCodeReservationDeclined, nil - case "BLOCKED_BY_BLOCKLIST": - return ErrorCodeBlockedByBlocklist, nil - case "FULFILLMENT_PREFERENCES_RESTRICTED_DATE_NOT_UNIQUE": - return ErrorCodeFulfillmentPreferencesRestrictedDateNotUnique, nil - case "FULFILLMENT_PREFERENCES_INVALID_SCHEDULING_DATETIME": - return ErrorCodeFulfillmentPreferencesInvalidSchedulingDatetime, nil - case "FULFILLMENT_PREFERENCES_INVALID_FULFILLMENT_AVAILABILITY_WINDOW": - return ErrorCodeFulfillmentPreferencesInvalidFulfillmentAvailabilityWindow, nil - case "FULFILLMENT_PREFERENCES_FULFILLMENT_SCHEDULE_NOT_ALLOWED": - return ErrorCodeFulfillmentPreferencesFulfillmentScheduleNotAllowed, nil - case "FULFILLMENT_PREFERENCES_ASSIGNMENT_IS_IMMUTABLE": - return ErrorCodeFulfillmentPreferencesAssignmentIsImmutable, nil - case "INVALID_TIMEZONE": - return ErrorCodeInvalidTimezone, nil case "UNKNOWN_BODY_PARAMETER": return ErrorCodeUnknownBodyParameter, nil - case "FULFILLMENT_PREFERENCES_CONFLICTING_ASSIGNMENT_TYPE": - return ErrorCodeFulfillmentPreferencesConflictingAssignmentType, nil case "NOT_FOUND": return ErrorCodeNotFound, nil case "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND": @@ -16859,8 +16313,6 @@ func NewErrorCodeFromString(s string) (ErrorCode, error) { return ErrorCodeUnprocessableEntity, nil case "RATE_LIMITED": return ErrorCodeRateLimited, nil - case "CLIENT_CLOSED_REQUEST": - return ErrorCodeClientClosedRequest, nil case "NOT_IMPLEMENTED": return ErrorCodeNotImplemented, nil case "BAD_GATEWAY": @@ -16951,15 +16403,12 @@ func (e *EventTypeMetadata) String() string { type ExcludeStrategy string const ( - ExcludeStrategyExcludeStrategyDoNotUse ExcludeStrategy = "EXCLUDE_STRATEGY_DO_NOT_USE" - ExcludeStrategyLeastExpensive ExcludeStrategy = "LEAST_EXPENSIVE" - ExcludeStrategyMostExpensive ExcludeStrategy = "MOST_EXPENSIVE" + ExcludeStrategyLeastExpensive ExcludeStrategy = "LEAST_EXPENSIVE" + ExcludeStrategyMostExpensive ExcludeStrategy = "MOST_EXPENSIVE" ) func NewExcludeStrategyFromString(s string) (ExcludeStrategy, error) { switch s { - case "EXCLUDE_STRATEGY_DO_NOT_USE": - return ExcludeStrategyExcludeStrategyDoNotUse, nil case "LEAST_EXPENSIVE": return ExcludeStrategyLeastExpensive, nil case "MOST_EXPENSIVE": @@ -17502,15 +16951,12 @@ func (f *FulfillmentDeliveryDetails) String() string { type FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType string const ( - FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeFulfillmentDeliveryDetailsScheduleTypeDoNotUse FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "FULFILLMENT_DELIVERY_DETAILS_SCHEDULE_TYPE_DO_NOT_USE" - FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeScheduled FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" - FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeAsap FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "ASAP" + FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeScheduled FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "SCHEDULED" + FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeAsap FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType = "ASAP" ) func NewFulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeFromString(s string) (FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType, error) { switch s { - case "FULFILLMENT_DELIVERY_DETAILS_SCHEDULE_TYPE_DO_NOT_USE": - return FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeFulfillmentDeliveryDetailsScheduleTypeDoNotUse, nil case "SCHEDULED": return FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleTypeScheduled, nil case "ASAP": @@ -17627,15 +17073,12 @@ func (f *FulfillmentFulfillmentEntry) String() string { type FulfillmentFulfillmentLineItemApplication string const ( - FulfillmentFulfillmentLineItemApplicationUnknownApplication FulfillmentFulfillmentLineItemApplication = "UNKNOWN_APPLICATION" - FulfillmentFulfillmentLineItemApplicationAll FulfillmentFulfillmentLineItemApplication = "ALL" - FulfillmentFulfillmentLineItemApplicationEntryList FulfillmentFulfillmentLineItemApplication = "ENTRY_LIST" + FulfillmentFulfillmentLineItemApplicationAll FulfillmentFulfillmentLineItemApplication = "ALL" + FulfillmentFulfillmentLineItemApplicationEntryList FulfillmentFulfillmentLineItemApplication = "ENTRY_LIST" ) func NewFulfillmentFulfillmentLineItemApplicationFromString(s string) (FulfillmentFulfillmentLineItemApplication, error) { switch s { - case "UNKNOWN_APPLICATION": - return FulfillmentFulfillmentLineItemApplicationUnknownApplication, nil case "ALL": return FulfillmentFulfillmentLineItemApplicationAll, nil case "ENTRY_LIST": @@ -17945,15 +17388,12 @@ func (f *FulfillmentPickupDetailsCurbsidePickupDetails) String() string { type FulfillmentPickupDetailsScheduleType string const ( - FulfillmentPickupDetailsScheduleTypeFulfillmentPickupDetailsScheduleTypeDoNotUse FulfillmentPickupDetailsScheduleType = "FULFILLMENT_PICKUP_DETAILS_SCHEDULE_TYPE_DO_NOT_USE" - FulfillmentPickupDetailsScheduleTypeScheduled FulfillmentPickupDetailsScheduleType = "SCHEDULED" - FulfillmentPickupDetailsScheduleTypeAsap FulfillmentPickupDetailsScheduleType = "ASAP" + FulfillmentPickupDetailsScheduleTypeScheduled FulfillmentPickupDetailsScheduleType = "SCHEDULED" + FulfillmentPickupDetailsScheduleTypeAsap FulfillmentPickupDetailsScheduleType = "ASAP" ) func NewFulfillmentPickupDetailsScheduleTypeFromString(s string) (FulfillmentPickupDetailsScheduleType, error) { switch s { - case "FULFILLMENT_PICKUP_DETAILS_SCHEDULE_TYPE_DO_NOT_USE": - return FulfillmentPickupDetailsScheduleTypeFulfillmentPickupDetailsScheduleTypeDoNotUse, nil case "SCHEDULED": return FulfillmentPickupDetailsScheduleTypeScheduled, nil case "ASAP": @@ -18264,19 +17704,16 @@ func (f *FulfillmentShipmentDetails) String() string { type FulfillmentState string const ( - FulfillmentStateFulfillmentStateDoNotUse FulfillmentState = "FULFILLMENT_STATE_DO_NOT_USE" - FulfillmentStateProposed FulfillmentState = "PROPOSED" - FulfillmentStateReserved FulfillmentState = "RESERVED" - FulfillmentStatePrepared FulfillmentState = "PREPARED" - FulfillmentStateCompleted FulfillmentState = "COMPLETED" - FulfillmentStateCanceled FulfillmentState = "CANCELED" - FulfillmentStateFailed FulfillmentState = "FAILED" + FulfillmentStateProposed FulfillmentState = "PROPOSED" + FulfillmentStateReserved FulfillmentState = "RESERVED" + FulfillmentStatePrepared FulfillmentState = "PREPARED" + FulfillmentStateCompleted FulfillmentState = "COMPLETED" + FulfillmentStateCanceled FulfillmentState = "CANCELED" + FulfillmentStateFailed FulfillmentState = "FAILED" ) func NewFulfillmentStateFromString(s string) (FulfillmentState, error) { switch s { - case "FULFILLMENT_STATE_DO_NOT_USE": - return FulfillmentStateFulfillmentStateDoNotUse, nil case "PROPOSED": return FulfillmentStateProposed, nil case "RESERVED": @@ -18302,40 +17739,19 @@ func (f FulfillmentState) Ptr() *FulfillmentState { type FulfillmentType string const ( - FulfillmentTypeFulfillmentTypeDoNotUse FulfillmentType = "FULFILLMENT_TYPE_DO_NOT_USE" - FulfillmentTypeCustom FulfillmentType = "CUSTOM" - FulfillmentTypePickup FulfillmentType = "PICKUP" - FulfillmentTypeManagedDelivery FulfillmentType = "MANAGED_DELIVERY" - FulfillmentTypeShipment FulfillmentType = "SHIPMENT" - FulfillmentTypeDigital FulfillmentType = "DIGITAL" - FulfillmentTypeDelivery FulfillmentType = "DELIVERY" - FulfillmentTypeSimple FulfillmentType = "SIMPLE" - FulfillmentTypeDineIn FulfillmentType = "DINE_IN" - FulfillmentTypeInStore FulfillmentType = "IN_STORE" + FulfillmentTypePickup FulfillmentType = "PICKUP" + FulfillmentTypeShipment FulfillmentType = "SHIPMENT" + FulfillmentTypeDelivery FulfillmentType = "DELIVERY" ) func NewFulfillmentTypeFromString(s string) (FulfillmentType, error) { switch s { - case "FULFILLMENT_TYPE_DO_NOT_USE": - return FulfillmentTypeFulfillmentTypeDoNotUse, nil - case "CUSTOM": - return FulfillmentTypeCustom, nil case "PICKUP": return FulfillmentTypePickup, nil - case "MANAGED_DELIVERY": - return FulfillmentTypeManagedDelivery, nil case "SHIPMENT": return FulfillmentTypeShipment, nil - case "DIGITAL": - return FulfillmentTypeDigital, nil case "DELIVERY": return FulfillmentTypeDelivery, nil - case "SIMPLE": - return FulfillmentTypeSimple, nil - case "DINE_IN": - return FulfillmentTypeDineIn, nil - case "IN_STORE": - return FulfillmentTypeInStore, nil } var t FulfillmentType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -20109,7 +19525,6 @@ func (g *GiftCardActivityAdjustDecrement) String() string { type GiftCardActivityAdjustDecrementReason string const ( - GiftCardActivityAdjustDecrementReasonReasonDoNotUse GiftCardActivityAdjustDecrementReason = "REASON_DO_NOT_USE" GiftCardActivityAdjustDecrementReasonSuspiciousActivity GiftCardActivityAdjustDecrementReason = "SUSPICIOUS_ACTIVITY" GiftCardActivityAdjustDecrementReasonBalanceAccidentallyIncreased GiftCardActivityAdjustDecrementReason = "BALANCE_ACCIDENTALLY_INCREASED" GiftCardActivityAdjustDecrementReasonSupportIssue GiftCardActivityAdjustDecrementReason = "SUPPORT_ISSUE" @@ -20118,8 +19533,6 @@ const ( func NewGiftCardActivityAdjustDecrementReasonFromString(s string) (GiftCardActivityAdjustDecrementReason, error) { switch s { - case "REASON_DO_NOT_USE": - return GiftCardActivityAdjustDecrementReasonReasonDoNotUse, nil case "SUSPICIOUS_ACTIVITY": return GiftCardActivityAdjustDecrementReasonSuspiciousActivity, nil case "BALANCE_ACCIDENTALLY_INCREASED": @@ -20199,7 +19612,6 @@ func (g *GiftCardActivityAdjustIncrement) String() string { type GiftCardActivityAdjustIncrementReason string const ( - GiftCardActivityAdjustIncrementReasonReasonDoNotUse GiftCardActivityAdjustIncrementReason = "REASON_DO_NOT_USE" GiftCardActivityAdjustIncrementReasonComplimentary GiftCardActivityAdjustIncrementReason = "COMPLIMENTARY" GiftCardActivityAdjustIncrementReasonSupportIssue GiftCardActivityAdjustIncrementReason = "SUPPORT_ISSUE" GiftCardActivityAdjustIncrementReasonTransactionVoided GiftCardActivityAdjustIncrementReason = "TRANSACTION_VOIDED" @@ -20207,8 +19619,6 @@ const ( func NewGiftCardActivityAdjustIncrementReasonFromString(s string) (GiftCardActivityAdjustIncrementReason, error) { switch s { - case "REASON_DO_NOT_USE": - return GiftCardActivityAdjustIncrementReasonReasonDoNotUse, nil case "COMPLIMENTARY": return GiftCardActivityAdjustIncrementReasonComplimentary, nil case "SUPPORT_ISSUE": @@ -20228,19 +19638,12 @@ func (g GiftCardActivityAdjustIncrementReason) Ptr() *GiftCardActivityAdjustIncr type GiftCardActivityBlock struct { // The reason the gift card was blocked. // See [Reason](#type-reason) for possible values - Reason GiftCardActivityBlockReason `json:"reason" url:"reason"` + Reason GiftCardActivityBlockReason `json:"reason,omitempty" url:"reason,omitempty"` extraProperties map[string]interface{} rawJSON json.RawMessage } -func (g *GiftCardActivityBlock) GetReason() GiftCardActivityBlockReason { - if g == nil { - return "" - } - return g.Reason -} - func (g *GiftCardActivityBlock) GetExtraProperties() map[string]interface{} { return g.extraProperties } @@ -20274,27 +19677,7 @@ func (g *GiftCardActivityBlock) String() string { } // Indicates the reason for blocking a [gift card](entity:GiftCard). -type GiftCardActivityBlockReason string - -const ( - GiftCardActivityBlockReasonReasonDoNotUse GiftCardActivityBlockReason = "REASON_DO_NOT_USE" - GiftCardActivityBlockReasonChargebackBlock GiftCardActivityBlockReason = "CHARGEBACK_BLOCK" -) - -func NewGiftCardActivityBlockReasonFromString(s string) (GiftCardActivityBlockReason, error) { - switch s { - case "REASON_DO_NOT_USE": - return GiftCardActivityBlockReasonReasonDoNotUse, nil - case "CHARGEBACK_BLOCK": - return GiftCardActivityBlockReasonChargebackBlock, nil - } - var t GiftCardActivityBlockReason - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (g GiftCardActivityBlockReason) Ptr() *GiftCardActivityBlockReason { - return &g -} +type GiftCardActivityBlockReason = string // Represents details about a `CLEAR_BALANCE` [gift card activity type](entity:GiftCardActivityType). type GiftCardActivityClearBalance struct { @@ -20349,7 +19732,6 @@ func (g *GiftCardActivityClearBalance) String() string { type GiftCardActivityClearBalanceReason string const ( - GiftCardActivityClearBalanceReasonReasonDoNotUse GiftCardActivityClearBalanceReason = "REASON_DO_NOT_USE" GiftCardActivityClearBalanceReasonSuspiciousActivity GiftCardActivityClearBalanceReason = "SUSPICIOUS_ACTIVITY" GiftCardActivityClearBalanceReasonReuseGiftcard GiftCardActivityClearBalanceReason = "REUSE_GIFTCARD" GiftCardActivityClearBalanceReasonUnknownReason GiftCardActivityClearBalanceReason = "UNKNOWN_REASON" @@ -20357,8 +19739,6 @@ const ( func NewGiftCardActivityClearBalanceReasonFromString(s string) (GiftCardActivityClearBalanceReason, error) { switch s { - case "REASON_DO_NOT_USE": - return GiftCardActivityClearBalanceReasonReasonDoNotUse, nil case "SUSPICIOUS_ACTIVITY": return GiftCardActivityClearBalanceReasonSuspiciousActivity, nil case "REUSE_GIFTCARD": @@ -20427,7 +19807,6 @@ func (g *GiftCardActivityDeactivate) String() string { type GiftCardActivityDeactivateReason string const ( - GiftCardActivityDeactivateReasonReasonDoNotUse GiftCardActivityDeactivateReason = "REASON_DO_NOT_USE" GiftCardActivityDeactivateReasonSuspiciousActivity GiftCardActivityDeactivateReason = "SUSPICIOUS_ACTIVITY" GiftCardActivityDeactivateReasonUnknownReason GiftCardActivityDeactivateReason = "UNKNOWN_REASON" GiftCardActivityDeactivateReasonChargebackDeactivate GiftCardActivityDeactivateReason = "CHARGEBACK_DEACTIVATE" @@ -20435,8 +19814,6 @@ const ( func NewGiftCardActivityDeactivateReasonFromString(s string) (GiftCardActivityDeactivateReason, error) { switch s { - case "REASON_DO_NOT_USE": - return GiftCardActivityDeactivateReasonReasonDoNotUse, nil case "SUSPICIOUS_ACTIVITY": return GiftCardActivityDeactivateReasonSuspiciousActivity, nil case "UNKNOWN_REASON": @@ -20749,16 +20126,13 @@ func (g *GiftCardActivityRedeem) String() string { type GiftCardActivityRedeemStatus string const ( - GiftCardActivityRedeemStatusTypeDoNotUse GiftCardActivityRedeemStatus = "TYPE_DO_NOT_USE" - GiftCardActivityRedeemStatusPending GiftCardActivityRedeemStatus = "PENDING" - GiftCardActivityRedeemStatusCompleted GiftCardActivityRedeemStatus = "COMPLETED" - GiftCardActivityRedeemStatusCanceled GiftCardActivityRedeemStatus = "CANCELED" + GiftCardActivityRedeemStatusPending GiftCardActivityRedeemStatus = "PENDING" + GiftCardActivityRedeemStatusCompleted GiftCardActivityRedeemStatus = "COMPLETED" + GiftCardActivityRedeemStatusCanceled GiftCardActivityRedeemStatus = "CANCELED" ) func NewGiftCardActivityRedeemStatusFromString(s string) (GiftCardActivityRedeemStatus, error) { switch s { - case "TYPE_DO_NOT_USE": - return GiftCardActivityRedeemStatusTypeDoNotUse, nil case "PENDING": return GiftCardActivityRedeemStatusPending, nil case "COMPLETED": @@ -20976,7 +20350,6 @@ func (g *GiftCardActivityTransferBalanceTo) String() string { type GiftCardActivityType string const ( - GiftCardActivityTypeTypeDoNotUse GiftCardActivityType = "TYPE_DO_NOT_USE" GiftCardActivityTypeActivate GiftCardActivityType = "ACTIVATE" GiftCardActivityTypeLoad GiftCardActivityType = "LOAD" GiftCardActivityTypeRedeem GiftCardActivityType = "REDEEM" @@ -20987,7 +20360,6 @@ const ( GiftCardActivityTypeRefund GiftCardActivityType = "REFUND" GiftCardActivityTypeUnlinkedActivityRefund GiftCardActivityType = "UNLINKED_ACTIVITY_REFUND" GiftCardActivityTypeImport GiftCardActivityType = "IMPORT" - GiftCardActivityTypeOther GiftCardActivityType = "OTHER" GiftCardActivityTypeBlock GiftCardActivityType = "BLOCK" GiftCardActivityTypeUnblock GiftCardActivityType = "UNBLOCK" GiftCardActivityTypeImportReversal GiftCardActivityType = "IMPORT_REVERSAL" @@ -20997,8 +20369,6 @@ const ( func NewGiftCardActivityTypeFromString(s string) (GiftCardActivityType, error) { switch s { - case "TYPE_DO_NOT_USE": - return GiftCardActivityTypeTypeDoNotUse, nil case "ACTIVATE": return GiftCardActivityTypeActivate, nil case "LOAD": @@ -21019,8 +20389,6 @@ func NewGiftCardActivityTypeFromString(s string) (GiftCardActivityType, error) { return GiftCardActivityTypeUnlinkedActivityRefund, nil case "IMPORT": return GiftCardActivityTypeImport, nil - case "OTHER": - return GiftCardActivityTypeOther, nil case "BLOCK": return GiftCardActivityTypeBlock, nil case "UNBLOCK": @@ -21044,19 +20412,12 @@ func (g GiftCardActivityType) Ptr() *GiftCardActivityType { type GiftCardActivityUnblock struct { // The reason the gift card was unblocked. // See [Reason](#type-reason) for possible values - Reason GiftCardActivityUnblockReason `json:"reason" url:"reason"` + Reason GiftCardActivityUnblockReason `json:"reason,omitempty" url:"reason,omitempty"` extraProperties map[string]interface{} rawJSON json.RawMessage } -func (g *GiftCardActivityUnblock) GetReason() GiftCardActivityUnblockReason { - if g == nil { - return "" - } - return g.Reason -} - func (g *GiftCardActivityUnblock) GetExtraProperties() map[string]interface{} { return g.extraProperties } @@ -21090,27 +20451,7 @@ func (g *GiftCardActivityUnblock) String() string { } // Indicates the reason for unblocking a [gift card](entity:GiftCard). -type GiftCardActivityUnblockReason string - -const ( - GiftCardActivityUnblockReasonReasonDoNotUse GiftCardActivityUnblockReason = "REASON_DO_NOT_USE" - GiftCardActivityUnblockReasonChargebackUnblock GiftCardActivityUnblockReason = "CHARGEBACK_UNBLOCK" -) - -func NewGiftCardActivityUnblockReasonFromString(s string) (GiftCardActivityUnblockReason, error) { - switch s { - case "REASON_DO_NOT_USE": - return GiftCardActivityUnblockReasonReasonDoNotUse, nil - case "CHARGEBACK_UNBLOCK": - return GiftCardActivityUnblockReasonChargebackUnblock, nil - } - var t GiftCardActivityUnblockReason - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (g GiftCardActivityUnblockReason) Ptr() *GiftCardActivityUnblockReason { - return &g -} +type GiftCardActivityUnblockReason = string // Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](entity:GiftCardActivityType). type GiftCardActivityUnlinkedActivityRefund struct { @@ -21182,15 +20523,12 @@ func (g *GiftCardActivityUnlinkedActivityRefund) String() string { type InventoryAlertType string const ( - InventoryAlertTypeInventoryAlertTypeDoNotUse InventoryAlertType = "INVENTORY_ALERT_TYPE_DO_NOT_USE" - InventoryAlertTypeNone InventoryAlertType = "NONE" - InventoryAlertTypeLowQuantity InventoryAlertType = "LOW_QUANTITY" + InventoryAlertTypeNone InventoryAlertType = "NONE" + InventoryAlertTypeLowQuantity InventoryAlertType = "LOW_QUANTITY" ) func NewInventoryAlertTypeFromString(s string) (InventoryAlertType, error) { switch s { - case "INVENTORY_ALERT_TYPE_DO_NOT_USE": - return InventoryAlertTypeInventoryAlertTypeDoNotUse, nil case "NONE": return InventoryAlertTypeNone, nil case "LOW_QUANTITY": @@ -21419,16 +20757,13 @@ func (j *JobAssignment) String() string { type JobAssignmentPayType string const ( - JobAssignmentPayTypeStatusDoNotUse JobAssignmentPayType = "STATUS_DO_NOT_USE" - JobAssignmentPayTypeNone JobAssignmentPayType = "NONE" - JobAssignmentPayTypeHourly JobAssignmentPayType = "HOURLY" - JobAssignmentPayTypeSalary JobAssignmentPayType = "SALARY" + JobAssignmentPayTypeNone JobAssignmentPayType = "NONE" + JobAssignmentPayTypeHourly JobAssignmentPayType = "HOURLY" + JobAssignmentPayTypeSalary JobAssignmentPayType = "SALARY" ) func NewJobAssignmentPayTypeFromString(s string) (JobAssignmentPayType, error) { switch s { - case "STATUS_DO_NOT_USE": - return JobAssignmentPayTypeStatusDoNotUse, nil case "NONE": return JobAssignmentPayTypeNone, nil case "HOURLY": @@ -21518,9 +20853,6 @@ func (l *ListBookingCustomAttributesResponse) String() string { } type ListCashDrawerShiftEventsResponse struct { - // All of the events (payments, refunds, etc.) for a cash drawer during - // the shift. - Events []*CashDrawerShiftEvent `json:"events,omitempty" url:"events,omitempty"` // Opaque cursor for fetching the next page. Cursor is not present in // the last page of results. Cursor *string `json:"cursor,omitempty" url:"cursor,omitempty"` @@ -21534,13 +20866,6 @@ type ListCashDrawerShiftEventsResponse struct { rawJSON json.RawMessage } -func (l *ListCashDrawerShiftEventsResponse) GetEvents() []*CashDrawerShiftEvent { - if l == nil { - return nil - } - return l.Events -} - func (l *ListCashDrawerShiftEventsResponse) GetCursor() *string { if l == nil { return nil @@ -21595,9 +20920,6 @@ func (l *ListCashDrawerShiftEventsResponse) String() string { } type ListCashDrawerShiftsResponse struct { - // A collection of CashDrawerShiftSummary objects for shifts that match - // the query. - Items []*CashDrawerShiftSummary `json:"items,omitempty" url:"items,omitempty"` // Opaque cursor for fetching the next page of results. Cursor is not // present in the last page of results. Cursor *string `json:"cursor,omitempty" url:"cursor,omitempty"` @@ -21611,13 +20933,6 @@ type ListCashDrawerShiftsResponse struct { rawJSON json.RawMessage } -func (l *ListCashDrawerShiftsResponse) GetItems() []*CashDrawerShiftSummary { - if l == nil { - return nil - } - return l.Items -} - func (l *ListCashDrawerShiftsResponse) GetCursor() *string { if l == nil { return nil @@ -23053,11 +22368,6 @@ func (l *LocationBookingProfile) String() string { type LoyaltyAccount struct { // The Square-assigned ID of the loyalty account. ID *string `json:"id,omitempty" url:"id,omitempty"` - // The list of mappings that the account is associated with. - // Currently, a buyer can only be mapped to a loyalty account using - // a phone number. Therefore, the list can only have one mapping. - // RETIRED at version 2021-05-13. Replaced by the `mapping` field. - Mappings []*LoyaltyAccountMapping `json:"mappings,omitempty" url:"mappings,omitempty"` // The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs. ProgramID string `json:"program_id" url:"program_id"` // The available point balance in the loyalty account. If points are scheduled to expire, they are listed in the `expiring_point_deadlines` field. @@ -23102,13 +22412,6 @@ func (l *LoyaltyAccount) GetID() *string { return l.ID } -func (l *LoyaltyAccount) GetMappings() []*LoyaltyAccountMapping { - if l == nil { - return nil - } - return l.Mappings -} - func (l *LoyaltyAccount) GetProgramID() string { if l == nil { return "" @@ -23268,14 +22571,6 @@ func (l *LoyaltyAccountExpiringPointDeadline) String() string { type LoyaltyAccountMapping struct { // The Square-assigned ID of the mapping. ID *string `json:"id,omitempty" url:"id,omitempty"` - // The mapping type, which is used with `value` to represent a phone number mapping. - // RETIRED at version 2021-05-13. When specifying a mapping, use the `phone_number` field instead. - // See [LoyaltyAccountMappingType](#type-loyaltyaccountmappingtype) for possible values - Type *LoyaltyAccountMappingType `json:"type,omitempty" url:"type,omitempty"` - // The mapping value, which is used with `type` to represent a phone number mapping. - // The value can be a phone number in E.164 format. For example, "+14155551111". - // RETIRED at version 2021-05-13. When specifying a mapping, use the `phone_number` field instead. - Value *string `json:"value,omitempty" url:"value,omitempty"` // The timestamp when the mapping was created, in RFC 3339 format. CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"` // The phone number of the buyer, in E.164 format. For example, "+14155551111". @@ -23292,20 +22587,6 @@ func (l *LoyaltyAccountMapping) GetID() *string { return l.ID } -func (l *LoyaltyAccountMapping) GetType() *LoyaltyAccountMappingType { - if l == nil { - return nil - } - return l.Type -} - -func (l *LoyaltyAccountMapping) GetValue() *string { - if l == nil { - return nil - } - return l.Value -} - func (l *LoyaltyAccountMapping) GetCreatedAt() *string { if l == nil { return nil @@ -23352,29 +22633,6 @@ func (l *LoyaltyAccountMapping) String() string { return fmt.Sprintf("%#v", l) } -// The type of mapping. -type LoyaltyAccountMappingType string - -const ( - LoyaltyAccountMappingTypeTypeDoNotUse LoyaltyAccountMappingType = "TYPE_DO_NOT_USE" - LoyaltyAccountMappingTypePhone LoyaltyAccountMappingType = "PHONE" -) - -func NewLoyaltyAccountMappingTypeFromString(s string) (LoyaltyAccountMappingType, error) { - switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyAccountMappingTypeTypeDoNotUse, nil - case "PHONE": - return LoyaltyAccountMappingTypePhone, nil - } - var t LoyaltyAccountMappingType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (l LoyaltyAccountMappingType) Ptr() *LoyaltyAccountMappingType { - return &l -} - // Provides information about a loyalty event. // For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). type LoyaltyEvent struct { @@ -24072,15 +23330,12 @@ func (l *LoyaltyEventRedeemReward) String() string { type LoyaltyEventSource string const ( - LoyaltyEventSourceSourceDoNotUse LoyaltyEventSource = "SOURCE_DO_NOT_USE" - LoyaltyEventSourceSquare LoyaltyEventSource = "SQUARE" - LoyaltyEventSourceLoyaltyAPI LoyaltyEventSource = "LOYALTY_API" + LoyaltyEventSourceSquare LoyaltyEventSource = "SQUARE" + LoyaltyEventSourceLoyaltyAPI LoyaltyEventSource = "LOYALTY_API" ) func NewLoyaltyEventSourceFromString(s string) (LoyaltyEventSource, error) { switch s { - case "SOURCE_DO_NOT_USE": - return LoyaltyEventSourceSourceDoNotUse, nil case "SQUARE": return LoyaltyEventSourceSquare, nil case "LOYALTY_API": @@ -24098,8 +23353,6 @@ func (l LoyaltyEventSource) Ptr() *LoyaltyEventSource { type LoyaltyEventType string const ( - LoyaltyEventTypeTypeDoNotUse LoyaltyEventType = "TYPE_DO_NOT_USE" - LoyaltyEventTypeCreateAccount LoyaltyEventType = "CREATE_ACCOUNT" LoyaltyEventTypeAccumulatePoints LoyaltyEventType = "ACCUMULATE_POINTS" LoyaltyEventTypeCreateReward LoyaltyEventType = "CREATE_REWARD" LoyaltyEventTypeRedeemReward LoyaltyEventType = "REDEEM_REWARD" @@ -24108,15 +23361,10 @@ const ( LoyaltyEventTypeExpirePoints LoyaltyEventType = "EXPIRE_POINTS" LoyaltyEventTypeOther LoyaltyEventType = "OTHER" LoyaltyEventTypeAccumulatePromotionPoints LoyaltyEventType = "ACCUMULATE_PROMOTION_POINTS" - LoyaltyEventTypeAccumulateTierPoints LoyaltyEventType = "ACCUMULATE_TIER_POINTS" ) func NewLoyaltyEventTypeFromString(s string) (LoyaltyEventType, error) { switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyEventTypeTypeDoNotUse, nil - case "CREATE_ACCOUNT": - return LoyaltyEventTypeCreateAccount, nil case "ACCUMULATE_POINTS": return LoyaltyEventTypeAccumulatePoints, nil case "CREATE_REWARD": @@ -24133,8 +23381,6 @@ func NewLoyaltyEventTypeFromString(s string) (LoyaltyEventType, error) { return LoyaltyEventTypeOther, nil case "ACCUMULATE_PROMOTION_POINTS": return LoyaltyEventTypeAccumulatePromotionPoints, nil - case "ACCUMULATE_TIER_POINTS": - return LoyaltyEventTypeAccumulateTierPoints, nil } var t LoyaltyEventType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -24278,34 +23524,6 @@ type LoyaltyProgramAccrualRule struct { // The number of points that // buyers earn based on the `accrual_type`. Points *int `json:"points,omitempty" url:"points,omitempty"` - // When the accrual rule is visit-based (`accrual_type` is `VISIT`), - // this field indicates the minimum purchase required during the visit to - // quality for the reward. - VisitMinimumAmountMoney *Money `json:"visit_minimum_amount_money,omitempty" url:"visit_minimum_amount_money,omitempty"` - // When the accrual rule is spend-based (`accrual_type` is `SPEND`), - // this field indicates the amount that a buyer must spend - // to earn the points. For example, - // suppose the accrual rule is "earn 1 point for every $10 you spend". - // Then, buyer earns a point for every $10 they spend. If - // buyer spends $105, the buyer earns 10 points. - SpendAmountMoney *Money `json:"spend_amount_money,omitempty" url:"spend_amount_money,omitempty"` - // When the accrual rule is item-based or category-based, this field specifies the ID - // of the [catalog object](entity:CatalogObject) that buyers can purchase to earn points. - // If `accrual_type` is `ITEM_VARIATION`, the object is an item variation. - // If `accrual_type` is `CATEGORY`, the object is a category. - CatalogObjectID *string `json:"catalog_object_id,omitempty" url:"catalog_object_id,omitempty"` - // When the accrual rule is spend-based (`accrual_type` is `SPEND`), this field - // lists the IDs of any `CATEGORY` catalog objects that are excluded from points accrual. - // - // You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - // endpoint to retrieve information about the excluded categories. - ExcludedCategoryIDs []string `json:"excluded_category_ids,omitempty" url:"excluded_category_ids,omitempty"` - // When the accrual rule is spend-based (`accrual_type` is `SPEND`), this field - // lists the IDs of any `ITEM_VARIATION` catalog objects that are excluded from points accrual. - // - // You can use the [BatchRetrieveCatalogObjects](api-endpoint:Catalog-BatchRetrieveCatalogObjects) - // endpoint to retrieve information about the excluded item variations. - ExcludedItemVariationIDs []string `json:"excluded_item_variation_ids,omitempty" url:"excluded_item_variation_ids,omitempty"` // Additional data for rules with the `VISIT` accrual type. VisitData *LoyaltyProgramAccrualRuleVisitData `json:"visit_data,omitempty" url:"visit_data,omitempty"` // Additional data for rules with the `SPEND` accrual type. @@ -24333,41 +23551,6 @@ func (l *LoyaltyProgramAccrualRule) GetPoints() *int { return l.Points } -func (l *LoyaltyProgramAccrualRule) GetVisitMinimumAmountMoney() *Money { - if l == nil { - return nil - } - return l.VisitMinimumAmountMoney -} - -func (l *LoyaltyProgramAccrualRule) GetSpendAmountMoney() *Money { - if l == nil { - return nil - } - return l.SpendAmountMoney -} - -func (l *LoyaltyProgramAccrualRule) GetCatalogObjectID() *string { - if l == nil { - return nil - } - return l.CatalogObjectID -} - -func (l *LoyaltyProgramAccrualRule) GetExcludedCategoryIDs() []string { - if l == nil { - return nil - } - return l.ExcludedCategoryIDs -} - -func (l *LoyaltyProgramAccrualRule) GetExcludedItemVariationIDs() []string { - if l == nil { - return nil - } - return l.ExcludedItemVariationIDs -} - func (l *LoyaltyProgramAccrualRule) GetVisitData() *LoyaltyProgramAccrualRuleVisitData { if l == nil { return nil @@ -24614,15 +23797,12 @@ func (l *LoyaltyProgramAccrualRuleSpendData) String() string { type LoyaltyProgramAccrualRuleTaxMode string const ( - LoyaltyProgramAccrualRuleTaxModeTaxModeDoNotUse LoyaltyProgramAccrualRuleTaxMode = "TAX_MODE_DO_NOT_USE" - LoyaltyProgramAccrualRuleTaxModeBeforeTax LoyaltyProgramAccrualRuleTaxMode = "BEFORE_TAX" - LoyaltyProgramAccrualRuleTaxModeAfterTax LoyaltyProgramAccrualRuleTaxMode = "AFTER_TAX" + LoyaltyProgramAccrualRuleTaxModeBeforeTax LoyaltyProgramAccrualRuleTaxMode = "BEFORE_TAX" + LoyaltyProgramAccrualRuleTaxModeAfterTax LoyaltyProgramAccrualRuleTaxMode = "AFTER_TAX" ) func NewLoyaltyProgramAccrualRuleTaxModeFromString(s string) (LoyaltyProgramAccrualRuleTaxMode, error) { switch s { - case "TAX_MODE_DO_NOT_USE": - return LoyaltyProgramAccrualRuleTaxModeTaxModeDoNotUse, nil case "BEFORE_TAX": return LoyaltyProgramAccrualRuleTaxModeBeforeTax, nil case "AFTER_TAX": @@ -24640,7 +23820,6 @@ func (l LoyaltyProgramAccrualRuleTaxMode) Ptr() *LoyaltyProgramAccrualRuleTaxMod type LoyaltyProgramAccrualRuleType string const ( - LoyaltyProgramAccrualRuleTypeTypeDoNotUse LoyaltyProgramAccrualRuleType = "TYPE_DO_NOT_USE" LoyaltyProgramAccrualRuleTypeVisit LoyaltyProgramAccrualRuleType = "VISIT" LoyaltyProgramAccrualRuleTypeSpend LoyaltyProgramAccrualRuleType = "SPEND" LoyaltyProgramAccrualRuleTypeItemVariation LoyaltyProgramAccrualRuleType = "ITEM_VARIATION" @@ -24649,8 +23828,6 @@ const ( func NewLoyaltyProgramAccrualRuleTypeFromString(s string) (LoyaltyProgramAccrualRuleType, error) { switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyProgramAccrualRuleTypeTypeDoNotUse, nil case "VISIT": return LoyaltyProgramAccrualRuleTypeVisit, nil case "SPEND": @@ -24891,7 +24068,6 @@ func (l *LoyaltyProgramRewardDefinition) String() string { type LoyaltyProgramRewardDefinitionScope string const ( - LoyaltyProgramRewardDefinitionScopeScopeDoNotUse LoyaltyProgramRewardDefinitionScope = "SCOPE_DO_NOT_USE" LoyaltyProgramRewardDefinitionScopeOrder LoyaltyProgramRewardDefinitionScope = "ORDER" LoyaltyProgramRewardDefinitionScopeItemVariation LoyaltyProgramRewardDefinitionScope = "ITEM_VARIATION" LoyaltyProgramRewardDefinitionScopeCategory LoyaltyProgramRewardDefinitionScope = "CATEGORY" @@ -24899,8 +24075,6 @@ const ( func NewLoyaltyProgramRewardDefinitionScopeFromString(s string) (LoyaltyProgramRewardDefinitionScope, error) { switch s { - case "SCOPE_DO_NOT_USE": - return LoyaltyProgramRewardDefinitionScopeScopeDoNotUse, nil case "ORDER": return LoyaltyProgramRewardDefinitionScopeOrder, nil case "ITEM_VARIATION": @@ -24922,15 +24096,12 @@ func (l LoyaltyProgramRewardDefinitionScope) Ptr() *LoyaltyProgramRewardDefiniti type LoyaltyProgramRewardDefinitionType string const ( - LoyaltyProgramRewardDefinitionTypeTypeDoNotUse LoyaltyProgramRewardDefinitionType = "TYPE_DO_NOT_USE" LoyaltyProgramRewardDefinitionTypeFixedAmount LoyaltyProgramRewardDefinitionType = "FIXED_AMOUNT" LoyaltyProgramRewardDefinitionTypeFixedPercentage LoyaltyProgramRewardDefinitionType = "FIXED_PERCENTAGE" ) func NewLoyaltyProgramRewardDefinitionTypeFromString(s string) (LoyaltyProgramRewardDefinitionType, error) { switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyProgramRewardDefinitionTypeTypeDoNotUse, nil case "FIXED_AMOUNT": return LoyaltyProgramRewardDefinitionTypeFixedAmount, nil case "FIXED_PERCENTAGE": @@ -25046,15 +24217,12 @@ func (l *LoyaltyProgramRewardTier) String() string { type LoyaltyProgramStatus string const ( - LoyaltyProgramStatusStatusDoNotUse LoyaltyProgramStatus = "STATUS_DO_NOT_USE" - LoyaltyProgramStatusInactive LoyaltyProgramStatus = "INACTIVE" - LoyaltyProgramStatusActive LoyaltyProgramStatus = "ACTIVE" + LoyaltyProgramStatusInactive LoyaltyProgramStatus = "INACTIVE" + LoyaltyProgramStatusActive LoyaltyProgramStatus = "ACTIVE" ) func NewLoyaltyProgramStatusFromString(s string) (LoyaltyProgramStatus, error) { switch s { - case "STATUS_DO_NOT_USE": - return LoyaltyProgramStatusStatusDoNotUse, nil case "INACTIVE": return LoyaltyProgramStatusInactive, nil case "ACTIVE": @@ -25583,15 +24751,12 @@ func (l *LoyaltyPromotionIncentivePointsMultiplierData) String() string { type LoyaltyPromotionIncentiveType string const ( - LoyaltyPromotionIncentiveTypeTypeDoNotUse LoyaltyPromotionIncentiveType = "TYPE_DO_NOT_USE" LoyaltyPromotionIncentiveTypePointsMultiplier LoyaltyPromotionIncentiveType = "POINTS_MULTIPLIER" LoyaltyPromotionIncentiveTypePointsAddition LoyaltyPromotionIncentiveType = "POINTS_ADDITION" ) func NewLoyaltyPromotionIncentiveTypeFromString(s string) (LoyaltyPromotionIncentiveType, error) { switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyPromotionIncentiveTypeTypeDoNotUse, nil case "POINTS_MULTIPLIER": return LoyaltyPromotionIncentiveTypePointsMultiplier, nil case "POINTS_ADDITION": @@ -25609,20 +24774,14 @@ func (l LoyaltyPromotionIncentiveType) Ptr() *LoyaltyPromotionIncentiveType { type LoyaltyPromotionStatus string const ( - LoyaltyPromotionStatusTypeDoNotUse LoyaltyPromotionStatus = "TYPE_DO_NOT_USE" - LoyaltyPromotionStatusUpcoming LoyaltyPromotionStatus = "UPCOMING" - LoyaltyPromotionStatusActive LoyaltyPromotionStatus = "ACTIVE" - LoyaltyPromotionStatusEnded LoyaltyPromotionStatus = "ENDED" - LoyaltyPromotionStatusCanceled LoyaltyPromotionStatus = "CANCELED" - LoyaltyPromotionStatusScheduled LoyaltyPromotionStatus = "SCHEDULED" + LoyaltyPromotionStatusActive LoyaltyPromotionStatus = "ACTIVE" + LoyaltyPromotionStatusEnded LoyaltyPromotionStatus = "ENDED" + LoyaltyPromotionStatusCanceled LoyaltyPromotionStatus = "CANCELED" + LoyaltyPromotionStatusScheduled LoyaltyPromotionStatus = "SCHEDULED" ) func NewLoyaltyPromotionStatusFromString(s string) (LoyaltyPromotionStatus, error) { switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyPromotionStatusTypeDoNotUse, nil - case "UPCOMING": - return LoyaltyPromotionStatusUpcoming, nil case "ACTIVE": return LoyaltyPromotionStatusActive, nil case "ENDED": @@ -25707,15 +24866,12 @@ func (l *LoyaltyPromotionTriggerLimit) String() string { type LoyaltyPromotionTriggerLimitInterval string const ( - LoyaltyPromotionTriggerLimitIntervalTypeDoNotUse LoyaltyPromotionTriggerLimitInterval = "TYPE_DO_NOT_USE" - LoyaltyPromotionTriggerLimitIntervalAllTime LoyaltyPromotionTriggerLimitInterval = "ALL_TIME" - LoyaltyPromotionTriggerLimitIntervalDay LoyaltyPromotionTriggerLimitInterval = "DAY" + LoyaltyPromotionTriggerLimitIntervalAllTime LoyaltyPromotionTriggerLimitInterval = "ALL_TIME" + LoyaltyPromotionTriggerLimitIntervalDay LoyaltyPromotionTriggerLimitInterval = "DAY" ) func NewLoyaltyPromotionTriggerLimitIntervalFromString(s string) (LoyaltyPromotionTriggerLimitInterval, error) { switch s { - case "TYPE_DO_NOT_USE": - return LoyaltyPromotionTriggerLimitIntervalTypeDoNotUse, nil case "ALL_TIME": return LoyaltyPromotionTriggerLimitIntervalAllTime, nil case "DAY": @@ -25855,16 +25011,13 @@ func (l *LoyaltyReward) String() string { type LoyaltyRewardStatus string const ( - LoyaltyRewardStatusStatusDoNotUse LoyaltyRewardStatus = "STATUS_DO_NOT_USE" - LoyaltyRewardStatusIssued LoyaltyRewardStatus = "ISSUED" - LoyaltyRewardStatusRedeemed LoyaltyRewardStatus = "REDEEMED" - LoyaltyRewardStatusDeleted LoyaltyRewardStatus = "DELETED" + LoyaltyRewardStatusIssued LoyaltyRewardStatus = "ISSUED" + LoyaltyRewardStatusRedeemed LoyaltyRewardStatus = "REDEEMED" + LoyaltyRewardStatusDeleted LoyaltyRewardStatus = "DELETED" ) func NewLoyaltyRewardStatusFromString(s string) (LoyaltyRewardStatus, error) { switch s { - case "STATUS_DO_NOT_USE": - return LoyaltyRewardStatusStatusDoNotUse, nil case "ISSUED": return LoyaltyRewardStatusIssued, nil case "REDEEMED": @@ -25948,13 +25101,6 @@ func (m *MeasurementUnit) GetWeightUnit() *MeasurementUnitWeight { return m.WeightUnit } -func (m *MeasurementUnit) GetGenericUnit() *MeasurementUnitGeneric { - if m == nil { - return nil - } - return m.GenericUnit -} - func (m *MeasurementUnit) GetTimeUnit() *MeasurementUnitTime { if m == nil { return nil @@ -26005,7 +25151,6 @@ func (m *MeasurementUnit) String() string { type MeasurementUnitArea string const ( - MeasurementUnitAreaInvalidArea MeasurementUnitArea = "INVALID_AREA" MeasurementUnitAreaImperialAcre MeasurementUnitArea = "IMPERIAL_ACRE" MeasurementUnitAreaImperialSquareInch MeasurementUnitArea = "IMPERIAL_SQUARE_INCH" MeasurementUnitAreaImperialSquareFoot MeasurementUnitArea = "IMPERIAL_SQUARE_FOOT" @@ -26018,8 +25163,6 @@ const ( func NewMeasurementUnitAreaFromString(s string) (MeasurementUnitArea, error) { switch s { - case "INVALID_AREA": - return MeasurementUnitAreaInvalidArea, nil case "IMPERIAL_ACRE": return MeasurementUnitAreaImperialAcre, nil case "IMPERIAL_SQUARE_INCH": @@ -26103,33 +25246,12 @@ func (m *MeasurementUnitCustom) String() string { return fmt.Sprintf("%#v", m) } -type MeasurementUnitGeneric string - -const ( - MeasurementUnitGenericInvalidGenericUnit MeasurementUnitGeneric = "INVALID_GENERIC_UNIT" - MeasurementUnitGenericUnit MeasurementUnitGeneric = "UNIT" -) - -func NewMeasurementUnitGenericFromString(s string) (MeasurementUnitGeneric, error) { - switch s { - case "INVALID_GENERIC_UNIT": - return MeasurementUnitGenericInvalidGenericUnit, nil - case "UNIT": - return MeasurementUnitGenericUnit, nil - } - var t MeasurementUnitGeneric - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (m MeasurementUnitGeneric) Ptr() *MeasurementUnitGeneric { - return &m -} +type MeasurementUnitGeneric = string // The unit of length used to measure a quantity. type MeasurementUnitLength string const ( - MeasurementUnitLengthInvalidLength MeasurementUnitLength = "INVALID_LENGTH" MeasurementUnitLengthImperialInch MeasurementUnitLength = "IMPERIAL_INCH" MeasurementUnitLengthImperialFoot MeasurementUnitLength = "IMPERIAL_FOOT" MeasurementUnitLengthImperialYard MeasurementUnitLength = "IMPERIAL_YARD" @@ -26142,8 +25264,6 @@ const ( func NewMeasurementUnitLengthFromString(s string) (MeasurementUnitLength, error) { switch s { - case "INVALID_LENGTH": - return MeasurementUnitLengthInvalidLength, nil case "IMPERIAL_INCH": return MeasurementUnitLengthImperialInch, nil case "IMPERIAL_FOOT": @@ -26173,7 +25293,6 @@ func (m MeasurementUnitLength) Ptr() *MeasurementUnitLength { type MeasurementUnitTime string const ( - MeasurementUnitTimeInvalidTime MeasurementUnitTime = "INVALID_TIME" MeasurementUnitTimeGenericMillisecond MeasurementUnitTime = "GENERIC_MILLISECOND" MeasurementUnitTimeGenericSecond MeasurementUnitTime = "GENERIC_SECOND" MeasurementUnitTimeGenericMinute MeasurementUnitTime = "GENERIC_MINUTE" @@ -26183,8 +25302,6 @@ const ( func NewMeasurementUnitTimeFromString(s string) (MeasurementUnitTime, error) { switch s { - case "INVALID_TIME": - return MeasurementUnitTimeInvalidTime, nil case "GENERIC_MILLISECOND": return MeasurementUnitTimeGenericMillisecond, nil case "GENERIC_SECOND": @@ -26208,20 +25325,16 @@ func (m MeasurementUnitTime) Ptr() *MeasurementUnitTime { type MeasurementUnitUnitType string const ( - MeasurementUnitUnitTypeInvalidType MeasurementUnitUnitType = "INVALID_TYPE" MeasurementUnitUnitTypeTypeCustom MeasurementUnitUnitType = "TYPE_CUSTOM" MeasurementUnitUnitTypeTypeArea MeasurementUnitUnitType = "TYPE_AREA" MeasurementUnitUnitTypeTypeLength MeasurementUnitUnitType = "TYPE_LENGTH" MeasurementUnitUnitTypeTypeVolume MeasurementUnitUnitType = "TYPE_VOLUME" MeasurementUnitUnitTypeTypeWeight MeasurementUnitUnitType = "TYPE_WEIGHT" - MeasurementUnitUnitTypeTypeTime MeasurementUnitUnitType = "TYPE_TIME" MeasurementUnitUnitTypeTypeGeneric MeasurementUnitUnitType = "TYPE_GENERIC" ) func NewMeasurementUnitUnitTypeFromString(s string) (MeasurementUnitUnitType, error) { switch s { - case "INVALID_TYPE": - return MeasurementUnitUnitTypeInvalidType, nil case "TYPE_CUSTOM": return MeasurementUnitUnitTypeTypeCustom, nil case "TYPE_AREA": @@ -26232,8 +25345,6 @@ func NewMeasurementUnitUnitTypeFromString(s string) (MeasurementUnitUnitType, er return MeasurementUnitUnitTypeTypeVolume, nil case "TYPE_WEIGHT": return MeasurementUnitUnitTypeTypeWeight, nil - case "TYPE_TIME": - return MeasurementUnitUnitTypeTypeTime, nil case "TYPE_GENERIC": return MeasurementUnitUnitTypeTypeGeneric, nil } @@ -26249,7 +25360,6 @@ func (m MeasurementUnitUnitType) Ptr() *MeasurementUnitUnitType { type MeasurementUnitVolume string const ( - MeasurementUnitVolumeInvalidVolume MeasurementUnitVolume = "INVALID_VOLUME" MeasurementUnitVolumeGenericFluidOunce MeasurementUnitVolume = "GENERIC_FLUID_OUNCE" MeasurementUnitVolumeGenericShot MeasurementUnitVolume = "GENERIC_SHOT" MeasurementUnitVolumeGenericCup MeasurementUnitVolume = "GENERIC_CUP" @@ -26265,8 +25375,6 @@ const ( func NewMeasurementUnitVolumeFromString(s string) (MeasurementUnitVolume, error) { switch s { - case "INVALID_VOLUME": - return MeasurementUnitVolumeInvalidVolume, nil case "GENERIC_FLUID_OUNCE": return MeasurementUnitVolumeGenericFluidOunce, nil case "GENERIC_SHOT": @@ -26302,7 +25410,6 @@ func (m MeasurementUnitVolume) Ptr() *MeasurementUnitVolume { type MeasurementUnitWeight string const ( - MeasurementUnitWeightInvalidWeight MeasurementUnitWeight = "INVALID_WEIGHT" MeasurementUnitWeightImperialWeightOunce MeasurementUnitWeight = "IMPERIAL_WEIGHT_OUNCE" MeasurementUnitWeightImperialPound MeasurementUnitWeight = "IMPERIAL_POUND" MeasurementUnitWeightImperialStone MeasurementUnitWeight = "IMPERIAL_STONE" @@ -26313,8 +25420,6 @@ const ( func NewMeasurementUnitWeightFromString(s string) (MeasurementUnitWeight, error) { switch s { - case "INVALID_WEIGHT": - return MeasurementUnitWeightInvalidWeight, nil case "IMPERIAL_WEIGHT_OUNCE": return MeasurementUnitWeightImperialWeightOunce, nil case "IMPERIAL_POUND": @@ -27632,25 +26737,19 @@ func (o OrderLineItemDiscountType) Ptr() *OrderLineItemDiscountType { type OrderLineItemItemType string const ( - OrderLineItemItemTypeDoNotUse OrderLineItemItemType = "DO_NOT_USE" - OrderLineItemItemTypeItem OrderLineItemItemType = "ITEM" - OrderLineItemItemTypeCustomAmount OrderLineItemItemType = "CUSTOM_AMOUNT" - OrderLineItemItemTypeGiftCard OrderLineItemItemType = "GIFT_CARD" - OrderLineItemItemTypeCreditPackage OrderLineItemItemType = "CREDIT_PACKAGE" + OrderLineItemItemTypeItem OrderLineItemItemType = "ITEM" + OrderLineItemItemTypeCustomAmount OrderLineItemItemType = "CUSTOM_AMOUNT" + OrderLineItemItemTypeGiftCard OrderLineItemItemType = "GIFT_CARD" ) func NewOrderLineItemItemTypeFromString(s string) (OrderLineItemItemType, error) { switch s { - case "DO_NOT_USE": - return OrderLineItemItemTypeDoNotUse, nil case "ITEM": return OrderLineItemItemTypeItem, nil case "CUSTOM_AMOUNT": return OrderLineItemItemTypeCustomAmount, nil case "GIFT_CARD": return OrderLineItemItemTypeGiftCard, nil - case "CREDIT_PACKAGE": - return OrderLineItemItemTypeCreditPackage, nil } var t OrderLineItemItemType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -29875,18 +28974,14 @@ func (o *OrderServiceCharge) String() string { type OrderServiceChargeCalculationPhase string const ( - OrderServiceChargeCalculationPhaseServiceChargeCalculationPhaseDoNotUse OrderServiceChargeCalculationPhase = "SERVICE_CHARGE_CALCULATION_PHASE_DO_NOT_USE" - OrderServiceChargeCalculationPhaseSubtotalPhase OrderServiceChargeCalculationPhase = "SUBTOTAL_PHASE" - OrderServiceChargeCalculationPhaseTotalPhase OrderServiceChargeCalculationPhase = "TOTAL_PHASE" - OrderServiceChargeCalculationPhaseApportionedPercentagePhase OrderServiceChargeCalculationPhase = "APPORTIONED_PERCENTAGE_PHASE" - OrderServiceChargeCalculationPhaseApportionedAmountPhase OrderServiceChargeCalculationPhase = "APPORTIONED_AMOUNT_PHASE" - OrderServiceChargeCalculationPhaseCardSurchargePhase OrderServiceChargeCalculationPhase = "CARD_SURCHARGE_PHASE" + OrderServiceChargeCalculationPhaseSubtotalPhase OrderServiceChargeCalculationPhase = "SUBTOTAL_PHASE" + OrderServiceChargeCalculationPhaseTotalPhase OrderServiceChargeCalculationPhase = "TOTAL_PHASE" + OrderServiceChargeCalculationPhaseApportionedPercentagePhase OrderServiceChargeCalculationPhase = "APPORTIONED_PERCENTAGE_PHASE" + OrderServiceChargeCalculationPhaseApportionedAmountPhase OrderServiceChargeCalculationPhase = "APPORTIONED_AMOUNT_PHASE" ) func NewOrderServiceChargeCalculationPhaseFromString(s string) (OrderServiceChargeCalculationPhase, error) { switch s { - case "SERVICE_CHARGE_CALCULATION_PHASE_DO_NOT_USE": - return OrderServiceChargeCalculationPhaseServiceChargeCalculationPhaseDoNotUse, nil case "SUBTOTAL_PHASE": return OrderServiceChargeCalculationPhaseSubtotalPhase, nil case "TOTAL_PHASE": @@ -29895,8 +28990,6 @@ func NewOrderServiceChargeCalculationPhaseFromString(s string) (OrderServiceChar return OrderServiceChargeCalculationPhaseApportionedPercentagePhase, nil case "APPORTIONED_AMOUNT_PHASE": return OrderServiceChargeCalculationPhaseApportionedAmountPhase, nil - case "CARD_SURCHARGE_PHASE": - return OrderServiceChargeCalculationPhaseCardSurchargePhase, nil } var t OrderServiceChargeCalculationPhase return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -29938,15 +29031,12 @@ func (o OrderServiceChargeScope) Ptr() *OrderServiceChargeScope { type OrderServiceChargeTreatmentType string const ( - OrderServiceChargeTreatmentTypeServiceChargeTreatmentTypeDoNotUse OrderServiceChargeTreatmentType = "SERVICE_CHARGE_TREATMENT_TYPE_DO_NOT_USE" - OrderServiceChargeTreatmentTypeLineItemTreatment OrderServiceChargeTreatmentType = "LINE_ITEM_TREATMENT" - OrderServiceChargeTreatmentTypeApportionedTreatment OrderServiceChargeTreatmentType = "APPORTIONED_TREATMENT" + OrderServiceChargeTreatmentTypeLineItemTreatment OrderServiceChargeTreatmentType = "LINE_ITEM_TREATMENT" + OrderServiceChargeTreatmentTypeApportionedTreatment OrderServiceChargeTreatmentType = "APPORTIONED_TREATMENT" ) func NewOrderServiceChargeTreatmentTypeFromString(s string) (OrderServiceChargeTreatmentType, error) { switch s { - case "SERVICE_CHARGE_TREATMENT_TYPE_DO_NOT_USE": - return OrderServiceChargeTreatmentTypeServiceChargeTreatmentTypeDoNotUse, nil case "LINE_ITEM_TREATMENT": return OrderServiceChargeTreatmentTypeLineItemTreatment, nil case "APPORTIONED_TREATMENT": @@ -29963,22 +29053,16 @@ func (o OrderServiceChargeTreatmentType) Ptr() *OrderServiceChargeTreatmentType type OrderServiceChargeType string const ( - OrderServiceChargeTypeServiceChargeTypeDoNotUse OrderServiceChargeType = "SERVICE_CHARGE_TYPE_DO_NOT_USE" - OrderServiceChargeTypeAutoGratuity OrderServiceChargeType = "AUTO_GRATUITY" - OrderServiceChargeTypeCustom OrderServiceChargeType = "CUSTOM" - OrderServiceChargeTypeCardSurcharge OrderServiceChargeType = "CARD_SURCHARGE" + OrderServiceChargeTypeAutoGratuity OrderServiceChargeType = "AUTO_GRATUITY" + OrderServiceChargeTypeCustom OrderServiceChargeType = "CUSTOM" ) func NewOrderServiceChargeTypeFromString(s string) (OrderServiceChargeType, error) { switch s { - case "SERVICE_CHARGE_TYPE_DO_NOT_USE": - return OrderServiceChargeTypeServiceChargeTypeDoNotUse, nil case "AUTO_GRATUITY": return OrderServiceChargeTypeAutoGratuity, nil case "CUSTOM": return OrderServiceChargeTypeCustom, nil - case "CARD_SURCHARGE": - return OrderServiceChargeTypeCardSurcharge, nil } var t OrderServiceChargeType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -30041,7 +29125,6 @@ func (o *OrderSource) String() string { type OrderState string const ( - OrderStateDoNotUse OrderState = "DO_NOT_USE" OrderStateOpen OrderState = "OPEN" OrderStateCompleted OrderState = "COMPLETED" OrderStateCanceled OrderState = "CANCELED" @@ -30050,8 +29133,6 @@ const ( func NewOrderStateFromString(s string) (OrderState, error) { switch s { - case "DO_NOT_USE": - return OrderStateDoNotUse, nil case "OPEN": return OrderStateOpen, nil case "COMPLETED": @@ -30374,15 +29455,12 @@ func (p *PaymentOptions) String() string { type PaymentOptionsDelayAction string const ( - PaymentOptionsDelayActionInvalidType PaymentOptionsDelayAction = "INVALID_TYPE" - PaymentOptionsDelayActionCancel PaymentOptionsDelayAction = "CANCEL" - PaymentOptionsDelayActionComplete PaymentOptionsDelayAction = "COMPLETE" + PaymentOptionsDelayActionCancel PaymentOptionsDelayAction = "CANCEL" + PaymentOptionsDelayActionComplete PaymentOptionsDelayAction = "COMPLETE" ) func NewPaymentOptionsDelayActionFromString(s string) (PaymentOptionsDelayAction, error) { switch s { - case "INVALID_TYPE": - return PaymentOptionsDelayActionInvalidType, nil case "CANCEL": return PaymentOptionsDelayActionCancel, nil case "COMPLETE": @@ -30537,27 +29615,20 @@ func (p *ProcessingFee) String() string { type Product string const ( - ProductProductDoNotUse Product = "PRODUCT_DO_NOT_USE" - ProductSquarePos Product = "SQUARE_POS" - ProductExternalAPI Product = "EXTERNAL_API" - ProductBilling Product = "BILLING" - ProductAppointments Product = "APPOINTMENTS" - ProductInvoices Product = "INVOICES" - ProductOnlineStore Product = "ONLINE_STORE" - ProductPayroll Product = "PAYROLL" - ProductDashboard Product = "DASHBOARD" - ProductItemLibraryImport Product = "ITEM_LIBRARY_IMPORT" - ProductRetail Product = "RETAIL" - ProductRestaurant Product = "RESTAURANT" - ProductCustomersDirectory Product = "CUSTOMERS_DIRECTORY" - ProductChannels Product = "CHANNELS" - ProductOther Product = "OTHER" + ProductSquarePos Product = "SQUARE_POS" + ProductExternalAPI Product = "EXTERNAL_API" + ProductBilling Product = "BILLING" + ProductAppointments Product = "APPOINTMENTS" + ProductInvoices Product = "INVOICES" + ProductOnlineStore Product = "ONLINE_STORE" + ProductPayroll Product = "PAYROLL" + ProductDashboard Product = "DASHBOARD" + ProductItemLibraryImport Product = "ITEM_LIBRARY_IMPORT" + ProductOther Product = "OTHER" ) func NewProductFromString(s string) (Product, error) { switch s { - case "PRODUCT_DO_NOT_USE": - return ProductProductDoNotUse, nil case "SQUARE_POS": return ProductSquarePos, nil case "EXTERNAL_API": @@ -30576,14 +29647,6 @@ func NewProductFromString(s string) (Product, error) { return ProductDashboard, nil case "ITEM_LIBRARY_IMPORT": return ProductItemLibraryImport, nil - case "RETAIL": - return ProductRetail, nil - case "RESTAURANT": - return ProductRestaurant, nil - case "CUSTOMERS_DIRECTORY": - return ProductCustomersDirectory, nil - case "CHANNELS": - return ProductChannels, nil case "OTHER": return ProductOther, nil } @@ -30595,51 +29658,7 @@ func (p Product) Ptr() *Product { return &p } -type ProductType string - -const ( - ProductTypeUnknown ProductType = "UNKNOWN" - ProductTypeRegister ProductType = "REGISTER" - ProductTypeRestaurant ProductType = "RESTAURANT" - ProductTypeRetail ProductType = "RETAIL" - ProductTypePaySdk ProductType = "PAY_SDK" - ProductTypeTerminalAPI ProductType = "TERMINAL_API" - ProductTypeKds ProductType = "KDS" - ProductTypeKdsExpo ProductType = "KDS_EXPO" - ProductTypeRestaurantMobile ProductType = "RESTAURANT_MOBILE" - ProductTypeFnbkiosk ProductType = "FNBKIOSK" -) - -func NewProductTypeFromString(s string) (ProductType, error) { - switch s { - case "UNKNOWN": - return ProductTypeUnknown, nil - case "REGISTER": - return ProductTypeRegister, nil - case "RESTAURANT": - return ProductTypeRestaurant, nil - case "RETAIL": - return ProductTypeRetail, nil - case "PAY_SDK": - return ProductTypePaySdk, nil - case "TERMINAL_API": - return ProductTypeTerminalAPI, nil - case "KDS": - return ProductTypeKds, nil - case "KDS_EXPO": - return ProductTypeKdsExpo, nil - case "RESTAURANT_MOBILE": - return ProductTypeRestaurantMobile, nil - case "FNBKIOSK": - return ProductTypeFnbkiosk, nil - } - var t ProductType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (p ProductType) Ptr() *ProductType { - return &p -} +type ProductType = string // Fields to describe the action that displays QR-Codes. type QrCodeOptions struct { @@ -32131,15 +31150,12 @@ func (s *ShiftFilter) String() string { type ShiftFilterStatus string const ( - ShiftFilterStatusDoNotUse ShiftFilterStatus = "DO_NOT_USE" - ShiftFilterStatusOpen ShiftFilterStatus = "OPEN" - ShiftFilterStatusClosed ShiftFilterStatus = "CLOSED" + ShiftFilterStatusOpen ShiftFilterStatus = "OPEN" + ShiftFilterStatusClosed ShiftFilterStatus = "CLOSED" ) func NewShiftFilterStatusFromString(s string) (ShiftFilterStatus, error) { switch s { - case "DO_NOT_USE": - return ShiftFilterStatusDoNotUse, nil case "OPEN": return ShiftFilterStatusOpen, nil case "CLOSED": @@ -32273,7 +31289,6 @@ func (s *ShiftSort) String() string { type ShiftSortField string const ( - ShiftSortFieldDoNotUse ShiftSortField = "DO_NOT_USE" ShiftSortFieldStartAt ShiftSortField = "START_AT" ShiftSortFieldEndAt ShiftSortField = "END_AT" ShiftSortFieldCreatedAt ShiftSortField = "CREATED_AT" @@ -32282,8 +31297,6 @@ const ( func NewShiftSortFieldFromString(s string) (ShiftSortField, error) { switch s { - case "DO_NOT_USE": - return ShiftSortFieldDoNotUse, nil case "START_AT": return ShiftSortFieldStartAt, nil case "END_AT": @@ -32305,15 +31318,12 @@ func (s ShiftSortField) Ptr() *ShiftSortField { type ShiftStatus string const ( - ShiftStatusUnknownStatus ShiftStatus = "UNKNOWN_STATUS" - ShiftStatusOpen ShiftStatus = "OPEN" - ShiftStatusClosed ShiftStatus = "CLOSED" + ShiftStatusOpen ShiftStatus = "OPEN" + ShiftStatusClosed ShiftStatus = "CLOSED" ) func NewShiftStatusFromString(s string) (ShiftStatus, error) { switch s { - case "UNKNOWN_STATUS": - return ShiftStatusUnknownStatus, nil case "OPEN": return ShiftStatusOpen, nil case "CLOSED": @@ -32479,7 +31489,6 @@ func (s *ShiftWorkday) String() string { type ShiftWorkdayMatcher string const ( - ShiftWorkdayMatcherDoNotUse ShiftWorkdayMatcher = "DO_NOT_USE" ShiftWorkdayMatcherStartAt ShiftWorkdayMatcher = "START_AT" ShiftWorkdayMatcherEndAt ShiftWorkdayMatcher = "END_AT" ShiftWorkdayMatcherIntersection ShiftWorkdayMatcher = "INTERSECTION" @@ -32487,8 +31496,6 @@ const ( func NewShiftWorkdayMatcherFromString(s string) (ShiftWorkdayMatcher, error) { switch s { - case "DO_NOT_USE": - return ShiftWorkdayMatcherDoNotUse, nil case "START_AT": return ShiftWorkdayMatcherStartAt, nil case "END_AT": @@ -32778,26 +31785,23 @@ func (s *SourceApplication) String() string { type SubscriptionCadence string const ( - SubscriptionCadenceSubscriptionCadenceDoNotUse SubscriptionCadence = "SUBSCRIPTION_CADENCE_DO_NOT_USE" - SubscriptionCadenceDaily SubscriptionCadence = "DAILY" - SubscriptionCadenceWeekly SubscriptionCadence = "WEEKLY" - SubscriptionCadenceEveryTwoWeeks SubscriptionCadence = "EVERY_TWO_WEEKS" - SubscriptionCadenceThirtyDays SubscriptionCadence = "THIRTY_DAYS" - SubscriptionCadenceSixtyDays SubscriptionCadence = "SIXTY_DAYS" - SubscriptionCadenceNinetyDays SubscriptionCadence = "NINETY_DAYS" - SubscriptionCadenceMonthly SubscriptionCadence = "MONTHLY" - SubscriptionCadenceEveryTwoMonths SubscriptionCadence = "EVERY_TWO_MONTHS" - SubscriptionCadenceQuarterly SubscriptionCadence = "QUARTERLY" - SubscriptionCadenceEveryFourMonths SubscriptionCadence = "EVERY_FOUR_MONTHS" - SubscriptionCadenceEverySixMonths SubscriptionCadence = "EVERY_SIX_MONTHS" - SubscriptionCadenceAnnual SubscriptionCadence = "ANNUAL" - SubscriptionCadenceEveryTwoYears SubscriptionCadence = "EVERY_TWO_YEARS" + SubscriptionCadenceDaily SubscriptionCadence = "DAILY" + SubscriptionCadenceWeekly SubscriptionCadence = "WEEKLY" + SubscriptionCadenceEveryTwoWeeks SubscriptionCadence = "EVERY_TWO_WEEKS" + SubscriptionCadenceThirtyDays SubscriptionCadence = "THIRTY_DAYS" + SubscriptionCadenceSixtyDays SubscriptionCadence = "SIXTY_DAYS" + SubscriptionCadenceNinetyDays SubscriptionCadence = "NINETY_DAYS" + SubscriptionCadenceMonthly SubscriptionCadence = "MONTHLY" + SubscriptionCadenceEveryTwoMonths SubscriptionCadence = "EVERY_TWO_MONTHS" + SubscriptionCadenceQuarterly SubscriptionCadence = "QUARTERLY" + SubscriptionCadenceEveryFourMonths SubscriptionCadence = "EVERY_FOUR_MONTHS" + SubscriptionCadenceEverySixMonths SubscriptionCadence = "EVERY_SIX_MONTHS" + SubscriptionCadenceAnnual SubscriptionCadence = "ANNUAL" + SubscriptionCadenceEveryTwoYears SubscriptionCadence = "EVERY_TWO_YEARS" ) func NewSubscriptionCadenceFromString(s string) (SubscriptionCadence, error) { switch s { - case "SUBSCRIPTION_CADENCE_DO_NOT_USE": - return SubscriptionCadenceSubscriptionCadenceDoNotUse, nil case "DAILY": return SubscriptionCadenceDaily, nil case "WEEKLY": @@ -32998,15 +32002,12 @@ func (s *SubscriptionPricing) String() string { type SubscriptionPricingType string const ( - SubscriptionPricingTypeSubscriptionPricingDoNotUse SubscriptionPricingType = "SUBSCRIPTION_PRICING_DO_NOT_USE" - SubscriptionPricingTypeStatic SubscriptionPricingType = "STATIC" - SubscriptionPricingTypeRelative SubscriptionPricingType = "RELATIVE" + SubscriptionPricingTypeStatic SubscriptionPricingType = "STATIC" + SubscriptionPricingTypeRelative SubscriptionPricingType = "RELATIVE" ) func NewSubscriptionPricingTypeFromString(s string) (SubscriptionPricingType, error) { switch s { - case "SUBSCRIPTION_PRICING_DO_NOT_USE": - return SubscriptionPricingTypeSubscriptionPricingDoNotUse, nil case "STATIC": return SubscriptionPricingTypeStatic, nil case "RELATIVE": @@ -34006,20 +33007,16 @@ func (t TenderSquareAccountDetailsStatus) Ptr() *TenderSquareAccountDetailsStatu type TenderType string const ( - TenderTypeCard TenderType = "CARD" - TenderTypeCash TenderType = "CASH" - TenderTypeThirdPartyCard TenderType = "THIRD_PARTY_CARD" - TenderTypeSquareGiftCard TenderType = "SQUARE_GIFT_CARD" - TenderTypeNoSale TenderType = "NO_SALE" - TenderTypeCheck TenderType = "CHECK" - TenderTypeMerchantGiftCard TenderType = "MERCHANT_GIFT_CARD" - TenderTypeThirdPartyEMoney TenderType = "THIRD_PARTY_E_MONEY" - TenderTypeBankAccount TenderType = "BANK_ACCOUNT" - TenderTypeWallet TenderType = "WALLET" - TenderTypeBuyNowPayLater TenderType = "BUY_NOW_PAY_LATER" - TenderTypeSquareAccount TenderType = "SQUARE_ACCOUNT" - TenderTypeBankTransfer TenderType = "BANK_TRANSFER" - TenderTypeOther TenderType = "OTHER" + TenderTypeCard TenderType = "CARD" + TenderTypeCash TenderType = "CASH" + TenderTypeThirdPartyCard TenderType = "THIRD_PARTY_CARD" + TenderTypeSquareGiftCard TenderType = "SQUARE_GIFT_CARD" + TenderTypeNoSale TenderType = "NO_SALE" + TenderTypeBankAccount TenderType = "BANK_ACCOUNT" + TenderTypeWallet TenderType = "WALLET" + TenderTypeBuyNowPayLater TenderType = "BUY_NOW_PAY_LATER" + TenderTypeSquareAccount TenderType = "SQUARE_ACCOUNT" + TenderTypeOther TenderType = "OTHER" ) func NewTenderTypeFromString(s string) (TenderType, error) { @@ -34034,12 +33031,6 @@ func NewTenderTypeFromString(s string) (TenderType, error) { return TenderTypeSquareGiftCard, nil case "NO_SALE": return TenderTypeNoSale, nil - case "CHECK": - return TenderTypeCheck, nil - case "MERCHANT_GIFT_CARD": - return TenderTypeMerchantGiftCard, nil - case "THIRD_PARTY_E_MONEY": - return TenderTypeThirdPartyEMoney, nil case "BANK_ACCOUNT": return TenderTypeBankAccount, nil case "WALLET": @@ -34048,8 +33039,6 @@ func NewTenderTypeFromString(s string) (TenderType, error) { return TenderTypeBuyNowPayLater, nil case "SQUARE_ACCOUNT": return TenderTypeSquareAccount, nil - case "BANK_TRANSFER": - return TenderTypeBankTransfer, nil case "OTHER": return TenderTypeOther, nil } @@ -34305,33 +33294,18 @@ func (t *TerminalAction) String() string { type TerminalActionActionType string const ( - TerminalActionActionTypeInvalidType TerminalActionActionType = "INVALID_TYPE" - TerminalActionActionTypeUnsupportedActionType TerminalActionActionType = "UNSUPPORTED_ACTION_TYPE" - TerminalActionActionTypeCheckout TerminalActionActionType = "CHECKOUT" - TerminalActionActionTypeRefund TerminalActionActionType = "REFUND" - TerminalActionActionTypeQrCode TerminalActionActionType = "QR_CODE" - TerminalActionActionTypePing TerminalActionActionType = "PING" - TerminalActionActionTypeSaveCard TerminalActionActionType = "SAVE_CARD" - TerminalActionActionTypeSignature TerminalActionActionType = "SIGNATURE" - TerminalActionActionTypeConfirmation TerminalActionActionType = "CONFIRMATION" - TerminalActionActionTypeReceipt TerminalActionActionType = "RECEIPT" - TerminalActionActionTypeDataCollection TerminalActionActionType = "DATA_COLLECTION" - TerminalActionActionTypeSelect TerminalActionActionType = "SELECT" - TerminalActionActionTypeStack TerminalActionActionType = "STACK" - TerminalActionActionTypeConfig TerminalActionActionType = "CONFIG" - TerminalActionActionTypeInternalPing TerminalActionActionType = "INTERNAL_PING" + TerminalActionActionTypeQrCode TerminalActionActionType = "QR_CODE" + TerminalActionActionTypePing TerminalActionActionType = "PING" + TerminalActionActionTypeSaveCard TerminalActionActionType = "SAVE_CARD" + TerminalActionActionTypeSignature TerminalActionActionType = "SIGNATURE" + TerminalActionActionTypeConfirmation TerminalActionActionType = "CONFIRMATION" + TerminalActionActionTypeReceipt TerminalActionActionType = "RECEIPT" + TerminalActionActionTypeDataCollection TerminalActionActionType = "DATA_COLLECTION" + TerminalActionActionTypeSelect TerminalActionActionType = "SELECT" ) func NewTerminalActionActionTypeFromString(s string) (TerminalActionActionType, error) { switch s { - case "INVALID_TYPE": - return TerminalActionActionTypeInvalidType, nil - case "UNSUPPORTED_ACTION_TYPE": - return TerminalActionActionTypeUnsupportedActionType, nil - case "CHECKOUT": - return TerminalActionActionTypeCheckout, nil - case "REFUND": - return TerminalActionActionTypeRefund, nil case "QR_CODE": return TerminalActionActionTypeQrCode, nil case "PING": @@ -34348,12 +33322,6 @@ func NewTerminalActionActionTypeFromString(s string) (TerminalActionActionType, return TerminalActionActionTypeDataCollection, nil case "SELECT": return TerminalActionActionTypeSelect, nil - case "STACK": - return TerminalActionActionTypeStack, nil - case "CONFIG": - return TerminalActionActionTypeConfig, nil - case "INTERNAL_PING": - return TerminalActionActionTypeInternalPing, nil } var t TerminalActionActionType return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -36440,2454 +35408,17 @@ func (u *UpsertCustomerCustomAttributeResponse) String() string { return fmt.Sprintf("%#v", u) } -type V1CreateRefundRequestType string - -const ( - V1CreateRefundRequestTypeFull V1CreateRefundRequestType = "FULL" - V1CreateRefundRequestTypePartial V1CreateRefundRequestType = "PARTIAL" -) - -func NewV1CreateRefundRequestTypeFromString(s string) (V1CreateRefundRequestType, error) { - switch s { - case "FULL": - return V1CreateRefundRequestTypeFull, nil - case "PARTIAL": - return V1CreateRefundRequestTypePartial, nil - } - var t V1CreateRefundRequestType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (v V1CreateRefundRequestType) Ptr() *V1CreateRefundRequestType { - return &v -} - -type V1Device struct { - // The device's Square-issued ID. - ID *string `json:"id,omitempty" url:"id,omitempty"` - // The device's merchant-specified name. - Name *string `json:"name,omitempty" url:"name,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (v *V1Device) GetID() *string { - if v == nil { - return nil - } - return v.ID -} - -func (v *V1Device) GetName() *string { - if v == nil { - return nil - } - return v.Name -} - -func (v *V1Device) GetExtraProperties() map[string]interface{} { - return v.extraProperties -} - -func (v *V1Device) UnmarshalJSON(data []byte) error { - type unmarshaler V1Device - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *v = V1Device(value) - extraProperties, err := internal.ExtractExtraProperties(data, *v) - if err != nil { - return err - } - v.extraProperties = extraProperties - v.rawJSON = json.RawMessage(data) - return nil -} - -func (v *V1Device) String() string { - if len(v.rawJSON) > 0 { - if value, err := internal.StringifyJSON(v.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(v); err == nil { - return value - } - return fmt.Sprintf("%#v", v) -} - -type V1ListSettlementsRequestStatus string - -const ( - V1ListSettlementsRequestStatusSent V1ListSettlementsRequestStatus = "SENT" - V1ListSettlementsRequestStatusFailed V1ListSettlementsRequestStatus = "FAILED" -) - -func NewV1ListSettlementsRequestStatusFromString(s string) (V1ListSettlementsRequestStatus, error) { - switch s { - case "SENT": - return V1ListSettlementsRequestStatusSent, nil - case "FAILED": - return V1ListSettlementsRequestStatusFailed, nil - } - var t V1ListSettlementsRequestStatus - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (v V1ListSettlementsRequestStatus) Ptr() *V1ListSettlementsRequestStatus { - return &v -} - -// Defines the fields that are included in the response body of -// a request to the **RetrieveBusiness** endpoint. -type V1Merchant struct { - // The merchant account's unique identifier. - ID *string `json:"id,omitempty" url:"id,omitempty"` - // The name associated with the merchant account. - Name *string `json:"name,omitempty" url:"name,omitempty"` - // The email address associated with the merchant account. - Email *string `json:"email,omitempty" url:"email,omitempty"` - // Indicates whether the merchant account corresponds to a single-location account (LOCATION) or a business account (BUSINESS). This value is almost always LOCATION. - // See [V1MerchantAccountType](#type-v1merchantaccounttype) for possible values - AccountType *V1MerchantAccountType `json:"account_type,omitempty" url:"account_type,omitempty"` - // Capabilities that are enabled for the merchant's Square account. Capabilities that are not listed in this array are not enabled for the account. - AccountCapabilities []string `json:"account_capabilities,omitempty" url:"account_capabilities,omitempty"` - // The country associated with the merchant account, in ISO 3166-1-alpha-2 format. - CountryCode *string `json:"country_code,omitempty" url:"country_code,omitempty"` - // The language associated with the merchant account, in BCP 47 format. - LanguageCode *string `json:"language_code,omitempty" url:"language_code,omitempty"` - // The currency associated with the merchant account, in ISO 4217 format. For example, the currency code for US dollars is USD. - CurrencyCode *string `json:"currency_code,omitempty" url:"currency_code,omitempty"` - // The name of the merchant's business. - BusinessName *string `json:"business_name,omitempty" url:"business_name,omitempty"` - // The address of the merchant's business. - BusinessAddress *Address `json:"business_address,omitempty" url:"business_address,omitempty"` - // The phone number of the merchant's business. - BusinessPhone *V1PhoneNumber `json:"business_phone,omitempty" url:"business_phone,omitempty"` - // The type of business operated by the merchant. - // See [V1MerchantBusinessType](#type-v1merchantbusinesstype) for possible values - BusinessType *V1MerchantBusinessType `json:"business_type,omitempty" url:"business_type,omitempty"` - // The merchant's shipping address. - ShippingAddress *Address `json:"shipping_address,omitempty" url:"shipping_address,omitempty"` - // Additional information for a single-location account specified by its associated business account, if it has one. - LocationDetails *V1MerchantLocationDetails `json:"location_details,omitempty" url:"location_details,omitempty"` - // The URL of the merchant's online store. - MarketURL *string `json:"market_url,omitempty" url:"market_url,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (v *V1Merchant) GetID() *string { - if v == nil { - return nil - } - return v.ID -} - -func (v *V1Merchant) GetName() *string { - if v == nil { - return nil - } - return v.Name -} - -func (v *V1Merchant) GetEmail() *string { - if v == nil { - return nil - } - return v.Email -} - -func (v *V1Merchant) GetAccountType() *V1MerchantAccountType { - if v == nil { - return nil - } - return v.AccountType -} - -func (v *V1Merchant) GetAccountCapabilities() []string { - if v == nil { - return nil - } - return v.AccountCapabilities -} - -func (v *V1Merchant) GetCountryCode() *string { - if v == nil { - return nil - } - return v.CountryCode -} - -func (v *V1Merchant) GetLanguageCode() *string { - if v == nil { - return nil - } - return v.LanguageCode -} - -func (v *V1Merchant) GetCurrencyCode() *string { - if v == nil { - return nil - } - return v.CurrencyCode -} - -func (v *V1Merchant) GetBusinessName() *string { - if v == nil { - return nil - } - return v.BusinessName -} - -func (v *V1Merchant) GetBusinessAddress() *Address { - if v == nil { - return nil - } - return v.BusinessAddress -} - -func (v *V1Merchant) GetBusinessPhone() *V1PhoneNumber { - if v == nil { - return nil - } - return v.BusinessPhone -} - -func (v *V1Merchant) GetBusinessType() *V1MerchantBusinessType { - if v == nil { - return nil - } - return v.BusinessType -} - -func (v *V1Merchant) GetShippingAddress() *Address { - if v == nil { - return nil - } - return v.ShippingAddress -} - -func (v *V1Merchant) GetLocationDetails() *V1MerchantLocationDetails { - if v == nil { - return nil - } - return v.LocationDetails -} - -func (v *V1Merchant) GetMarketURL() *string { - if v == nil { - return nil - } - return v.MarketURL -} - -func (v *V1Merchant) GetExtraProperties() map[string]interface{} { - return v.extraProperties -} - -func (v *V1Merchant) UnmarshalJSON(data []byte) error { - type unmarshaler V1Merchant - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *v = V1Merchant(value) - extraProperties, err := internal.ExtractExtraProperties(data, *v) - if err != nil { - return err - } - v.extraProperties = extraProperties - v.rawJSON = json.RawMessage(data) - return nil -} - -func (v *V1Merchant) String() string { - if len(v.rawJSON) > 0 { - if value, err := internal.StringifyJSON(v.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(v); err == nil { - return value - } - return fmt.Sprintf("%#v", v) -} - -type V1MerchantAccountType string - -const ( - V1MerchantAccountTypeLocation V1MerchantAccountType = "LOCATION" - V1MerchantAccountTypeBusiness V1MerchantAccountType = "BUSINESS" -) - -func NewV1MerchantAccountTypeFromString(s string) (V1MerchantAccountType, error) { - switch s { - case "LOCATION": - return V1MerchantAccountTypeLocation, nil - case "BUSINESS": - return V1MerchantAccountTypeBusiness, nil - } - var t V1MerchantAccountType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (v V1MerchantAccountType) Ptr() *V1MerchantAccountType { - return &v -} - -type V1MerchantBusinessType string - -const ( - V1MerchantBusinessTypeAccounting V1MerchantBusinessType = "ACCOUNTING" - V1MerchantBusinessTypeApparelAndAccessoryShops V1MerchantBusinessType = "APPAREL_AND_ACCESSORY_SHOPS" - V1MerchantBusinessTypeArtDealersGalleries V1MerchantBusinessType = "ART_DEALERS_GALLERIES" - V1MerchantBusinessTypeArtDesignAndPhotography V1MerchantBusinessType = "ART_DESIGN_AND_PHOTOGRAPHY" - V1MerchantBusinessTypeBarClubLounge V1MerchantBusinessType = "BAR_CLUB_LOUNGE" - V1MerchantBusinessTypeBeautyAndBarberShops V1MerchantBusinessType = "BEAUTY_AND_BARBER_SHOPS" - V1MerchantBusinessTypeBookStores V1MerchantBusinessType = "BOOK_STORES" - V1MerchantBusinessTypeBusinessServices V1MerchantBusinessType = "BUSINESS_SERVICES" - V1MerchantBusinessTypeCatering V1MerchantBusinessType = "CATERING" - V1MerchantBusinessTypeCharitableSocialServiceOrganizations V1MerchantBusinessType = "CHARITABLE_SOCIAL_SERVICE_ORGANIZATIONS" - V1MerchantBusinessTypeCharitibleOrgs V1MerchantBusinessType = "CHARITIBLE_ORGS" - V1MerchantBusinessTypeCleaningServices V1MerchantBusinessType = "CLEANING_SERVICES" - V1MerchantBusinessTypeComputerEquipmentSoftwareMaintenanceRepairServices V1MerchantBusinessType = "COMPUTER_EQUIPMENT_SOFTWARE_MAINTENANCE_REPAIR_SERVICES" - V1MerchantBusinessTypeConsultant V1MerchantBusinessType = "CONSULTANT" - V1MerchantBusinessTypeContractors V1MerchantBusinessType = "CONTRACTORS" - V1MerchantBusinessTypeDeliveryServices V1MerchantBusinessType = "DELIVERY_SERVICES" - V1MerchantBusinessTypeDentistry V1MerchantBusinessType = "DENTISTRY" - V1MerchantBusinessTypeEducation V1MerchantBusinessType = "EDUCATION" - V1MerchantBusinessTypeFoodStoresConvenienceStoresAndSpecialtyMarkets V1MerchantBusinessType = "FOOD_STORES_CONVENIENCE_STORES_AND_SPECIALTY_MARKETS" - V1MerchantBusinessTypeFoodTruckCart V1MerchantBusinessType = "FOOD_TRUCK_CART" - V1MerchantBusinessTypeFurnitureHomeAndOfficeEquipment V1MerchantBusinessType = "FURNITURE_HOME_AND_OFFICE_EQUIPMENT" - V1MerchantBusinessTypeFurnitureHomeGoods V1MerchantBusinessType = "FURNITURE_HOME_GOODS" - V1MerchantBusinessTypeHotelsAndLodging V1MerchantBusinessType = "HOTELS_AND_LODGING" - V1MerchantBusinessTypeIndividualUse V1MerchantBusinessType = "INDIVIDUAL_USE" - V1MerchantBusinessTypeJewelryAndWatches V1MerchantBusinessType = "JEWELRY_AND_WATCHES" - V1MerchantBusinessTypeLandscapingAndHorticulturalServices V1MerchantBusinessType = "LANDSCAPING_AND_HORTICULTURAL_SERVICES" - V1MerchantBusinessTypeLanguageSchools V1MerchantBusinessType = "LANGUAGE_SCHOOLS" - V1MerchantBusinessTypeLegalServices V1MerchantBusinessType = "LEGAL_SERVICES" - V1MerchantBusinessTypeMedicalPractitioners V1MerchantBusinessType = "MEDICAL_PRACTITIONERS" - V1MerchantBusinessTypeMedicalServicesAndHealthPractitioners V1MerchantBusinessType = "MEDICAL_SERVICES_AND_HEALTH_PRACTITIONERS" - V1MerchantBusinessTypeMembershipOrganizations V1MerchantBusinessType = "MEMBERSHIP_ORGANIZATIONS" - V1MerchantBusinessTypeMusicAndEntertainment V1MerchantBusinessType = "MUSIC_AND_ENTERTAINMENT" - V1MerchantBusinessTypeOther V1MerchantBusinessType = "OTHER" - V1MerchantBusinessTypeOutdoorMarkets V1MerchantBusinessType = "OUTDOOR_MARKETS" - V1MerchantBusinessTypePersonalServices V1MerchantBusinessType = "PERSONAL_SERVICES" - V1MerchantBusinessTypePoliticalOrganizations V1MerchantBusinessType = "POLITICAL_ORGANIZATIONS" - V1MerchantBusinessTypeProfessionalServices V1MerchantBusinessType = "PROFESSIONAL_SERVICES" - V1MerchantBusinessTypeRealEstate V1MerchantBusinessType = "REAL_ESTATE" - V1MerchantBusinessTypeRecreationServices V1MerchantBusinessType = "RECREATION_SERVICES" - V1MerchantBusinessTypeRepairShopsAndRelatedServices V1MerchantBusinessType = "REPAIR_SHOPS_AND_RELATED_SERVICES" - V1MerchantBusinessTypeRestaurants V1MerchantBusinessType = "RESTAURANTS" - V1MerchantBusinessTypeRetailShops V1MerchantBusinessType = "RETAIL_SHOPS" - V1MerchantBusinessTypeSchoolsAndEducationalServices V1MerchantBusinessType = "SCHOOLS_AND_EDUCATIONAL_SERVICES" - V1MerchantBusinessTypeSportingGoods V1MerchantBusinessType = "SPORTING_GOODS" - V1MerchantBusinessTypeTaxicabsAndLimousines V1MerchantBusinessType = "TAXICABS_AND_LIMOUSINES" - V1MerchantBusinessTypeTicketSales V1MerchantBusinessType = "TICKET_SALES" - V1MerchantBusinessTypeTourism V1MerchantBusinessType = "TOURISM" - V1MerchantBusinessTypeTravelTourism V1MerchantBusinessType = "TRAVEL_TOURISM" - V1MerchantBusinessTypeVeterinaryServices V1MerchantBusinessType = "VETERINARY_SERVICES" - V1MerchantBusinessTypeWebDevDesign V1MerchantBusinessType = "WEB_DEV_DESIGN" -) - -func NewV1MerchantBusinessTypeFromString(s string) (V1MerchantBusinessType, error) { - switch s { - case "ACCOUNTING": - return V1MerchantBusinessTypeAccounting, nil - case "APPAREL_AND_ACCESSORY_SHOPS": - return V1MerchantBusinessTypeApparelAndAccessoryShops, nil - case "ART_DEALERS_GALLERIES": - return V1MerchantBusinessTypeArtDealersGalleries, nil - case "ART_DESIGN_AND_PHOTOGRAPHY": - return V1MerchantBusinessTypeArtDesignAndPhotography, nil - case "BAR_CLUB_LOUNGE": - return V1MerchantBusinessTypeBarClubLounge, nil - case "BEAUTY_AND_BARBER_SHOPS": - return V1MerchantBusinessTypeBeautyAndBarberShops, nil - case "BOOK_STORES": - return V1MerchantBusinessTypeBookStores, nil - case "BUSINESS_SERVICES": - return V1MerchantBusinessTypeBusinessServices, nil - case "CATERING": - return V1MerchantBusinessTypeCatering, nil - case "CHARITABLE_SOCIAL_SERVICE_ORGANIZATIONS": - return V1MerchantBusinessTypeCharitableSocialServiceOrganizations, nil - case "CHARITIBLE_ORGS": - return V1MerchantBusinessTypeCharitibleOrgs, nil - case "CLEANING_SERVICES": - return V1MerchantBusinessTypeCleaningServices, nil - case "COMPUTER_EQUIPMENT_SOFTWARE_MAINTENANCE_REPAIR_SERVICES": - return V1MerchantBusinessTypeComputerEquipmentSoftwareMaintenanceRepairServices, nil - case "CONSULTANT": - return V1MerchantBusinessTypeConsultant, nil - case "CONTRACTORS": - return V1MerchantBusinessTypeContractors, nil - case "DELIVERY_SERVICES": - return V1MerchantBusinessTypeDeliveryServices, nil - case "DENTISTRY": - return V1MerchantBusinessTypeDentistry, nil - case "EDUCATION": - return V1MerchantBusinessTypeEducation, nil - case "FOOD_STORES_CONVENIENCE_STORES_AND_SPECIALTY_MARKETS": - return V1MerchantBusinessTypeFoodStoresConvenienceStoresAndSpecialtyMarkets, nil - case "FOOD_TRUCK_CART": - return V1MerchantBusinessTypeFoodTruckCart, nil - case "FURNITURE_HOME_AND_OFFICE_EQUIPMENT": - return V1MerchantBusinessTypeFurnitureHomeAndOfficeEquipment, nil - case "FURNITURE_HOME_GOODS": - return V1MerchantBusinessTypeFurnitureHomeGoods, nil - case "HOTELS_AND_LODGING": - return V1MerchantBusinessTypeHotelsAndLodging, nil - case "INDIVIDUAL_USE": - return V1MerchantBusinessTypeIndividualUse, nil - case "JEWELRY_AND_WATCHES": - return V1MerchantBusinessTypeJewelryAndWatches, nil - case "LANDSCAPING_AND_HORTICULTURAL_SERVICES": - return V1MerchantBusinessTypeLandscapingAndHorticulturalServices, nil - case "LANGUAGE_SCHOOLS": - return V1MerchantBusinessTypeLanguageSchools, nil - case "LEGAL_SERVICES": - return V1MerchantBusinessTypeLegalServices, nil - case "MEDICAL_PRACTITIONERS": - return V1MerchantBusinessTypeMedicalPractitioners, nil - case "MEDICAL_SERVICES_AND_HEALTH_PRACTITIONERS": - return V1MerchantBusinessTypeMedicalServicesAndHealthPractitioners, nil - case "MEMBERSHIP_ORGANIZATIONS": - return V1MerchantBusinessTypeMembershipOrganizations, nil - case "MUSIC_AND_ENTERTAINMENT": - return V1MerchantBusinessTypeMusicAndEntertainment, nil - case "OTHER": - return V1MerchantBusinessTypeOther, nil - case "OUTDOOR_MARKETS": - return V1MerchantBusinessTypeOutdoorMarkets, nil - case "PERSONAL_SERVICES": - return V1MerchantBusinessTypePersonalServices, nil - case "POLITICAL_ORGANIZATIONS": - return V1MerchantBusinessTypePoliticalOrganizations, nil - case "PROFESSIONAL_SERVICES": - return V1MerchantBusinessTypeProfessionalServices, nil - case "REAL_ESTATE": - return V1MerchantBusinessTypeRealEstate, nil - case "RECREATION_SERVICES": - return V1MerchantBusinessTypeRecreationServices, nil - case "REPAIR_SHOPS_AND_RELATED_SERVICES": - return V1MerchantBusinessTypeRepairShopsAndRelatedServices, nil - case "RESTAURANTS": - return V1MerchantBusinessTypeRestaurants, nil - case "RETAIL_SHOPS": - return V1MerchantBusinessTypeRetailShops, nil - case "SCHOOLS_AND_EDUCATIONAL_SERVICES": - return V1MerchantBusinessTypeSchoolsAndEducationalServices, nil - case "SPORTING_GOODS": - return V1MerchantBusinessTypeSportingGoods, nil - case "TAXICABS_AND_LIMOUSINES": - return V1MerchantBusinessTypeTaxicabsAndLimousines, nil - case "TICKET_SALES": - return V1MerchantBusinessTypeTicketSales, nil - case "TOURISM": - return V1MerchantBusinessTypeTourism, nil - case "TRAVEL_TOURISM": - return V1MerchantBusinessTypeTravelTourism, nil - case "VETERINARY_SERVICES": - return V1MerchantBusinessTypeVeterinaryServices, nil - case "WEB_DEV_DESIGN": - return V1MerchantBusinessTypeWebDevDesign, nil - } - var t V1MerchantBusinessType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (v V1MerchantBusinessType) Ptr() *V1MerchantBusinessType { - return &v -} - -// Additional information for a single-location account specified by its associated business account, if it has one. -type V1MerchantLocationDetails struct { - // The nickname assigned to the single-location account by the parent business. This value appears in the parent business's multi-location dashboard. - Nickname *string `json:"nickname,omitempty" url:"nickname,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (v *V1MerchantLocationDetails) GetNickname() *string { - if v == nil { - return nil - } - return v.Nickname -} - -func (v *V1MerchantLocationDetails) GetExtraProperties() map[string]interface{} { - return v.extraProperties -} - -func (v *V1MerchantLocationDetails) UnmarshalJSON(data []byte) error { - type unmarshaler V1MerchantLocationDetails - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *v = V1MerchantLocationDetails(value) - extraProperties, err := internal.ExtractExtraProperties(data, *v) - if err != nil { - return err - } - v.extraProperties = extraProperties - v.rawJSON = json.RawMessage(data) - return nil -} - -func (v *V1MerchantLocationDetails) String() string { - if len(v.rawJSON) > 0 { - if value, err := internal.StringifyJSON(v.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(v); err == nil { - return value - } - return fmt.Sprintf("%#v", v) -} - -type V1Money struct { - // Amount in the lowest denominated value of this Currency. E.g. in USD - // these are cents, in JPY they are Yen (which do not have a 'cent' concept). - Amount *int `json:"amount,omitempty" url:"amount,omitempty"` - // See [Currency](#type-currency) for possible values - CurrencyCode *Currency `json:"currency_code,omitempty" url:"currency_code,omitempty"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (v *V1Money) GetAmount() *int { - if v == nil { - return nil - } - return v.Amount -} - -func (v *V1Money) GetCurrencyCode() *Currency { - if v == nil { - return nil - } - return v.CurrencyCode -} - -func (v *V1Money) GetExtraProperties() map[string]interface{} { - return v.extraProperties -} - -func (v *V1Money) UnmarshalJSON(data []byte) error { - type unmarshaler V1Money - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *v = V1Money(value) - extraProperties, err := internal.ExtractExtraProperties(data, *v) - if err != nil { - return err - } - v.extraProperties = extraProperties - v.rawJSON = json.RawMessage(data) - return nil -} - -func (v *V1Money) String() string { - if len(v.rawJSON) > 0 { - if value, err := internal.StringifyJSON(v.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(v); err == nil { - return value - } - return fmt.Sprintf("%#v", v) -} - -// A payment represents a paid transaction between a Square merchant and a -// customer. Payment details are usually available from Connect API endpoints -// within a few minutes after the transaction completes. -// -// Each Payment object includes several fields that end in `_money`. These fields -// describe the various amounts of money that contribute to the payment total: -// -//
tax_money
, tip_money
).
-// discount_money
, refunded_money
).
-//