Skip to content

Commit

Permalink
Merge pull request #10 from square/fern-bot/12-06-2024-0658PM
Browse files Browse the repository at this point in the history
🌿 Fern Regeneration -- December 6, 2024
  • Loading branch information
mikekono authored Dec 6, 2024
2 parents aff665f + ae3807d commit 639d6b3
Show file tree
Hide file tree
Showing 47 changed files with 1,718 additions and 5,897 deletions.
3 changes: 0 additions & 3 deletions apple_pay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions bank_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion cards.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"-"`
}
Expand Down
4 changes: 1 addition & 3 deletions cards/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -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(
Expand All @@ -210,7 +209,6 @@ func (c *Client) Disable(
BodyProperties: options.BodyProperties,
QueryParameters: options.QueryParameters,
Client: options.HTTPClient,
Request: request,
Response: &response,
},
); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cashdrawers/shifts/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 2 additions & 8 deletions catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,13 @@ 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"
)

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":
Expand Down Expand Up @@ -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":
Expand Down
18 changes: 6 additions & 12 deletions checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -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":
Expand Down
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -93,7 +94,6 @@ type Client struct {
CashDrawers *cashdrawersclient.Client
Customer *customerclient.Client
Team *teamclient.Client
V1 *v1client.Client
Webhooks *webhooksclient.Client
}

Expand All @@ -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...),
Expand Down Expand Up @@ -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...),
}
}
2 changes: 1 addition & 1 deletion core/request_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
66 changes: 0 additions & 66 deletions customers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 639d6b3

Please sign in to comment.