Skip to content

Commit

Permalink
SDK regeneration (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] authored Jan 23, 2025
1 parent cf292e7 commit e50043d
Show file tree
Hide file tree
Showing 22 changed files with 769 additions and 646 deletions.
8 changes: 2 additions & 6 deletions catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ type SearchCatalogObjectsRequest struct {
// ITEM_OPTION_VAL, ITEM_VARIATION, or MODIFIER), you must explicitly include all the types of interest
// in this field.
ObjectTypes []CatalogObjectType `json:"object_types,omitempty" url:"-"`
// If `true`, deleted objects will be included in the results. Deleted objects will have their
// `is_deleted` field set to `true`.
// If `true`, deleted objects will be included in the results. Defaults to `false`. Deleted objects will have their `is_deleted` field set to `true`. If `include_deleted_objects` is `true`, then the `include_category_path_to_root` request parameter must be `false`. Both properties cannot be `true` at the same time.
IncludeDeletedObjects *bool `json:"include_deleted_objects,omitempty" url:"-"`
// If `true`, the response will include additional objects that are related to the
// requested objects. Related objects are objects that are referenced by object ID by the objects
Expand All @@ -208,10 +207,7 @@ type SearchCatalogObjectsRequest struct {
// the implementation may return more or fewer results. If the supplied limit is negative, zero, or
// is higher than the maximum limit of 1,000, it will be ignored.
Limit *int `json:"limit,omitempty" url:"-"`
// Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists
// of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category
// and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned
// in the response payload.
// Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned in the response payload. If `include_category_path_to_root` is `true`, then the `include_deleted_objects` request parameter must be `false`. Both properties cannot be `true` at the same time.
IncludeCategoryPathToRoot *bool `json:"include_category_path_to_root,omitempty" url:"-"`
}

Expand Down
4 changes: 2 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ type Client struct {
GiftCards *giftcardsclient.Client
Inventory *inventory.Client
Invoices *invoices.Client
Labor *laborclient.Client
Locations *locationsclient.Client
Loyalty *loyaltyclient.Client
Merchants *merchantsclient.Client
Expand All @@ -82,6 +81,7 @@ type Client struct {
Terminal *terminalclient.Client
Vendors *vendors.Client
CashDrawers *cashdrawersclient.Client
Labor *laborclient.Client
Webhooks *webhooksclient.Client
}

Expand Down Expand Up @@ -118,7 +118,6 @@ func NewClient(opts ...option.RequestOption) *Client {
GiftCards: giftcardsclient.NewClient(opts...),
Inventory: inventory.NewClient(opts...),
Invoices: invoices.NewClient(opts...),
Labor: laborclient.NewClient(opts...),
Locations: locationsclient.NewClient(opts...),
Loyalty: loyaltyclient.NewClient(opts...),
Merchants: merchantsclient.NewClient(opts...),
Expand All @@ -135,6 +134,7 @@ func NewClient(opts ...option.RequestOption) *Client {
Terminal: terminalclient.NewClient(opts...),
Vendors: vendors.NewClient(opts...),
CashDrawers: cashdrawersclient.NewClient(opts...),
Labor: laborclient.NewClient(opts...),
Webhooks: webhooksclient.NewClient(opts...),
}
}
6 changes: 3 additions & 3 deletions core/request_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *RequestOptions) ToHeader() http.Header {
if r.Token != "" {
header.Set("Authorization", "Bearer "+r.Token)
}
version := fmt.Sprintf("%v", "2024-11-20")
version := fmt.Sprintf("%v", "2025-01-23")
if envValue := os.Getenv("VERSION"); envValue != "" {
version = envValue
}
Expand All @@ -64,8 +64,8 @@ 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", "v1.0.1")
headers.Set("User-Agent", "github.com/square/square-go-sdk/1.0.1")
headers.Set("X-Fern-SDK-Version", "v1.1.0")
headers.Set("User-Agent", "github.com/square/square-go-sdk/1.1.0")
return headers
}

Expand Down
35 changes: 11 additions & 24 deletions customers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@ import (
internal "github.com/square/square-go-sdk/internal"
)

type BulkCreateCustomersRequest struct {
// A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`
// key-value pairs.
//
// Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)
// that uniquely identifies the create request. Each value contains the customer data used to create the
// customer profile.
Customers map[string]*BulkCreateCustomerData `json:"customers,omitempty" url:"-"`
}

type BulkDeleteCustomersRequest struct {
// The IDs of the [customer profiles](entity:Customer) to delete.
CustomerIDs []string `json:"customer_ids,omitempty" url:"-"`
Expand All @@ -40,6 +30,16 @@ type BulkUpdateCustomersRequest struct {
Customers map[string]*BulkUpdateCustomerData `json:"customers,omitempty" url:"-"`
}

type BulkCreateCustomersRequest struct {
// A map of 1 to 100 individual create requests, represented by `idempotency key: { customer data }`
// key-value pairs.
//
// Each key is an [idempotency key](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency)
// that uniquely identifies the create request. Each value contains the customer data used to create the
// customer profile.
Customers map[string]*BulkCreateCustomerData `json:"customers,omitempty" url:"-"`
}

type CreateCustomerRequest struct {
// The idempotency key for the request. For more information, see
// [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
Expand Down Expand Up @@ -788,12 +788,6 @@ type Customer struct {
CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
// The timestamp when the customer profile was last updated, in RFC 3339 format.
UpdatedAt *string `json:"updated_at,omitempty" url:"updated_at,omitempty"`
// Payment details of the credit, debit, and gift cards stored on file for the customer profile.
//
// DEPRECATED at version 2021-06-16 and will be RETIRED at version 2024-12-18. Replaced by calling [ListCards](api-endpoint:Cards-ListCards) (for credit and debit cards on file)
// or [ListGiftCards](api-endpoint:GiftCards-ListGiftCards) (for gift cards on file) and including the `customer_id` query parameter.
// For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what-it-does#migrate-customer-cards).
Cards []*Card `json:"cards,omitempty" url:"cards,omitempty"`
// The given name (that is, the first name) associated with the customer profile.
GivenName *string `json:"given_name,omitempty" url:"given_name,omitempty"`
// The family name (that is, the last name) associated with the customer profile.
Expand Down Expand Up @@ -825,7 +819,7 @@ type Customer struct {
GroupIDs []string `json:"group_ids,omitempty" url:"group_ids,omitempty"`
// The IDs of [customer segments](entity:CustomerSegment) the customer belongs to.
SegmentIDs []string `json:"segment_ids,omitempty" url:"segment_ids,omitempty"`
// The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership and cards on file.
// The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership.
Version *int64 `json:"version,omitempty" url:"version,omitempty"`
// The tax ID associated with the customer profile. This field is present only for customers of sellers in EU countries or the United Kingdom.
// For more information, see [Customer tax IDs](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids).
Expand Down Expand Up @@ -856,13 +850,6 @@ func (c *Customer) GetUpdatedAt() *string {
return c.UpdatedAt
}

func (c *Customer) GetCards() []*Card {
if c == nil {
return nil
}
return c.Cards
}

func (c *Customer) GetGivenName() *string {
if c == nil {
return nil
Expand Down
8 changes: 2 additions & 6 deletions customers/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *Client) Create(
// - `company_name`
// - `email_address`
// - `phone_number`
func (c *Client) BulkCreateCustomers(
func (c *Client) BatchCreate(
ctx context.Context,
request *squaregosdk.BulkCreateCustomersRequest,
opts ...option.RequestOption,
Expand Down Expand Up @@ -298,8 +298,6 @@ func (c *Client) BulkRetrieveCustomers(
// Updates multiple customer profiles.
//
// This endpoint takes a map of individual update requests and returns a map of responses.
//
// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](api:Cards) or [Gift Cards API](api:GiftCards).
func (c *Client) BulkUpdateCustomers(
ctx context.Context,
request *squaregosdk.BulkUpdateCustomersRequest,
Expand Down Expand Up @@ -429,8 +427,6 @@ func (c *Client) Get(
// To add or update a field, specify the new value. To remove a field, specify `null`.
//
// To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
//
// You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](api:Cards) or [Gift Cards API](api:GiftCards).
func (c *Client) Update(
ctx context.Context,
request *squaregosdk.UpdateCustomerRequest,
Expand Down Expand Up @@ -472,7 +468,7 @@ func (c *Client) Update(
return response, nil
}

// Deletes a customer profile from a business. This operation also unlinks any associated cards on file.
// Deletes a customer profile from a business.
//
// To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
func (c *Client) Delete(
Expand Down
2 changes: 1 addition & 1 deletion invoices/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ func (c *Client) Cancel(
//
// In addition to the required `ORDERS_WRITE` and `INVOICES_WRITE` permissions, `CUSTOMERS_READ`
// and `PAYMENTS_WRITE` are required when publishing invoices configured for card-on-file payments.
func (c *Client) Publisb(
func (c *Client) Publish(
ctx context.Context,
request *squaregosdk.PublishInvoiceRequest,
opts ...option.RequestOption,
Expand Down
155 changes: 0 additions & 155 deletions labor.go

This file was deleted.

18 changes: 18 additions & 0 deletions labor/break_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import (
squaregosdk "github.com/square/square-go-sdk"
)

type CreateBreakTypeRequest struct {
// A unique string value to ensure the idempotency of the operation.
IdempotencyKey *string `json:"idempotency_key,omitempty" url:"-"`
// The `BreakType` to be created.
BreakType *squaregosdk.BreakType `json:"break_type,omitempty" url:"-"`
}

type BreakTypesDeleteRequest struct {
// The UUID for the `BreakType` being deleted.
ID string `json:"-" url:"-"`
Expand All @@ -16,6 +23,17 @@ type BreakTypesGetRequest struct {
ID string `json:"-" url:"-"`
}

type BreakTypesListRequest struct {
// Filter the returned `BreakType` results to only those that are associated with the
// specified location.
LocationID *string `json:"-" url:"location_id,omitempty"`
// The maximum number of `BreakType` results to return per page. The number can range between 1
// and 200. The default is 200.
Limit *int `json:"-" url:"limit,omitempty"`
// A pointer to the next page of `BreakType` results to fetch.
Cursor *string `json:"-" url:"cursor,omitempty"`
}

type UpdateBreakTypeRequest struct {
// The UUID for the `BreakType` being updated.
ID string `json:"-" url:"-"`
Expand Down
Loading

0 comments on commit e50043d

Please sign in to comment.