Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 23, 2025
1 parent cf292e7 commit 0e420e8
Show file tree
Hide file tree
Showing 147 changed files with 2,087 additions and 1,964 deletions.
2 changes: 1 addition & 1 deletion apple_pay.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package square
import (
json "encoding/json"
fmt "fmt"
internal "github.com/square/square-go-sdk/internal"
internal "github.com/square/square-go-sdk/v2/internal"
)

type RegisterDomainRequest struct {
Expand Down
14 changes: 7 additions & 7 deletions applepay/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ package applepay

import (
context "context"
squaregosdk "github.com/square/square-go-sdk"
core "github.com/square/square-go-sdk/core"
internal "github.com/square/square-go-sdk/internal"
option "github.com/square/square-go-sdk/option"
v2 "github.com/square/square-go-sdk/v2"
core "github.com/square/square-go-sdk/v2/core"
internal "github.com/square/square-go-sdk/v2/internal"
option "github.com/square/square-go-sdk/v2/option"
http "net/http"
os "os"
)
Expand Down Expand Up @@ -54,9 +54,9 @@ func NewClient(opts ...option.RequestOption) *Client {
// To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
func (c *Client) RegisterDomain(
ctx context.Context,
request *squaregosdk.RegisterDomainRequest,
request *v2.RegisterDomainRequest,
opts ...option.RequestOption,
) (*squaregosdk.RegisterDomainResponse, error) {
) (*v2.RegisterDomainResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -70,7 +70,7 @@ func (c *Client) RegisterDomain(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.RegisterDomainResponse
var response *v2.RegisterDomainResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand Down
2 changes: 1 addition & 1 deletion bank_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package square
import (
json "encoding/json"
fmt "fmt"
internal "github.com/square/square-go-sdk/internal"
internal "github.com/square/square-go-sdk/v2/internal"
)

type BankAccountsGetByV1IDRequest struct {
Expand Down
28 changes: 14 additions & 14 deletions bankaccounts/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package bankaccounts
import (
context "context"
fmt "fmt"
squaregosdk "github.com/square/square-go-sdk"
core "github.com/square/square-go-sdk/core"
internal "github.com/square/square-go-sdk/internal"
option "github.com/square/square-go-sdk/option"
v2 "github.com/square/square-go-sdk/v2"
core "github.com/square/square-go-sdk/v2/core"
internal "github.com/square/square-go-sdk/v2/internal"
option "github.com/square/square-go-sdk/v2/option"
http "net/http"
os "os"
)
Expand Down Expand Up @@ -42,9 +42,9 @@ func NewClient(opts ...option.RequestOption) *Client {
// Returns a list of [BankAccount](entity:BankAccount) objects linked to a Square account.
func (c *Client) List(
ctx context.Context,
request *squaregosdk.BankAccountsListRequest,
request *v2.BankAccountsListRequest,
opts ...option.RequestOption,
) (*core.Page[*squaregosdk.BankAccount], error) {
) (*core.Page[*v2.BankAccount], error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand Down Expand Up @@ -80,10 +80,10 @@ func (c *Client) List(
Response: pageRequest.Response,
}
}
readPageResponse := func(response *squaregosdk.ListBankAccountsResponse) *internal.PageResponse[*string, *squaregosdk.BankAccount] {
readPageResponse := func(response *v2.ListBankAccountsResponse) *internal.PageResponse[*string, *v2.BankAccount] {
next := response.Cursor
results := response.BankAccounts
return &internal.PageResponse[*string, *squaregosdk.BankAccount]{
return &internal.PageResponse[*string, *v2.BankAccount]{
Next: next,
Results: results,
}
Expand All @@ -99,9 +99,9 @@ func (c *Client) List(
// Returns details of a [BankAccount](entity:BankAccount) identified by V1 bank account ID.
func (c *Client) GetByV1ID(
ctx context.Context,
request *squaregosdk.BankAccountsGetByV1IDRequest,
request *v2.BankAccountsGetByV1IDRequest,
opts ...option.RequestOption,
) (*squaregosdk.GetBankAccountByV1IDResponse, error) {
) (*v2.GetBankAccountByV1IDResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -117,7 +117,7 @@ func (c *Client) GetByV1ID(
options.ToHeader(),
)

var response *squaregosdk.GetBankAccountByV1IDResponse
var response *v2.GetBankAccountByV1IDResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -140,9 +140,9 @@ func (c *Client) GetByV1ID(
// linked to a Square account.
func (c *Client) Get(
ctx context.Context,
request *squaregosdk.BankAccountsGetRequest,
request *v2.BankAccountsGetRequest,
opts ...option.RequestOption,
) (*squaregosdk.GetBankAccountResponse, error) {
) (*v2.GetBankAccountResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -158,7 +158,7 @@ func (c *Client) Get(
options.ToHeader(),
)

var response *squaregosdk.GetBankAccountResponse
var response *v2.GetBankAccountResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand Down
2 changes: 1 addition & 1 deletion bookings.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package square
import (
json "encoding/json"
fmt "fmt"
internal "github.com/square/square-go-sdk/internal"
internal "github.com/square/square-go-sdk/v2/internal"
)

type BulkRetrieveBookingsRequest struct {
Expand Down
76 changes: 38 additions & 38 deletions bookings/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ package client
import (
context "context"
fmt "fmt"
squaregosdk "github.com/square/square-go-sdk"
customattributedefinitions "github.com/square/square-go-sdk/bookings/customattributedefinitions"
customattributes "github.com/square/square-go-sdk/bookings/customattributes"
locationprofiles "github.com/square/square-go-sdk/bookings/locationprofiles"
teammemberprofiles "github.com/square/square-go-sdk/bookings/teammemberprofiles"
core "github.com/square/square-go-sdk/core"
internal "github.com/square/square-go-sdk/internal"
option "github.com/square/square-go-sdk/option"
v2 "github.com/square/square-go-sdk/v2"
customattributedefinitions "github.com/square/square-go-sdk/v2/bookings/customattributedefinitions"
customattributes "github.com/square/square-go-sdk/v2/bookings/customattributes"
locationprofiles "github.com/square/square-go-sdk/v2/bookings/locationprofiles"
teammemberprofiles "github.com/square/square-go-sdk/v2/bookings/teammemberprofiles"
core "github.com/square/square-go-sdk/v2/core"
internal "github.com/square/square-go-sdk/v2/internal"
option "github.com/square/square-go-sdk/v2/option"
http "net/http"
os "os"
)
Expand Down Expand Up @@ -58,9 +58,9 @@ func NewClient(opts ...option.RequestOption) *Client {
// To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
func (c *Client) List(
ctx context.Context,
request *squaregosdk.BookingsListRequest,
request *v2.BookingsListRequest,
opts ...option.RequestOption,
) (*core.Page[*squaregosdk.Booking], error) {
) (*core.Page[*v2.Booking], error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand Down Expand Up @@ -96,10 +96,10 @@ func (c *Client) List(
Response: pageRequest.Response,
}
}
readPageResponse := func(response *squaregosdk.ListBookingsResponse) *internal.PageResponse[*string, *squaregosdk.Booking] {
readPageResponse := func(response *v2.ListBookingsResponse) *internal.PageResponse[*string, *v2.Booking] {
next := response.Cursor
results := response.Bookings
return &internal.PageResponse[*string, *squaregosdk.Booking]{
return &internal.PageResponse[*string, *v2.Booking]{
Next: next,
Results: results,
}
Expand Down Expand Up @@ -128,9 +128,9 @@ func (c *Client) List(
// or *Appointments Premium*.
func (c *Client) Create(
ctx context.Context,
request *squaregosdk.CreateBookingRequest,
request *v2.CreateBookingRequest,
opts ...option.RequestOption,
) (*squaregosdk.CreateBookingResponse, error) {
) (*v2.CreateBookingResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -144,7 +144,7 @@ func (c *Client) Create(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.CreateBookingResponse
var response *v2.CreateBookingResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -170,9 +170,9 @@ func (c *Client) Create(
// To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
func (c *Client) SearchAvailability(
ctx context.Context,
request *squaregosdk.SearchAvailabilityRequest,
request *v2.SearchAvailabilityRequest,
opts ...option.RequestOption,
) (*squaregosdk.SearchAvailabilityResponse, error) {
) (*v2.SearchAvailabilityResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -186,7 +186,7 @@ func (c *Client) SearchAvailability(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.SearchAvailabilityResponse
var response *v2.SearchAvailabilityResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -212,9 +212,9 @@ func (c *Client) SearchAvailability(
// To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
func (c *Client) BulkRetrieveBookings(
ctx context.Context,
request *squaregosdk.BulkRetrieveBookingsRequest,
request *v2.BulkRetrieveBookingsRequest,
opts ...option.RequestOption,
) (*squaregosdk.BulkRetrieveBookingsResponse, error) {
) (*v2.BulkRetrieveBookingsResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -228,7 +228,7 @@ func (c *Client) BulkRetrieveBookings(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.BulkRetrieveBookingsResponse
var response *v2.BulkRetrieveBookingsResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -252,7 +252,7 @@ func (c *Client) BulkRetrieveBookings(
func (c *Client) GetBusinessProfile(
ctx context.Context,
opts ...option.RequestOption,
) (*squaregosdk.GetBusinessBookingProfileResponse, error) {
) (*v2.GetBusinessBookingProfileResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -265,7 +265,7 @@ func (c *Client) GetBusinessProfile(
options.ToHeader(),
)

var response *squaregosdk.GetBusinessBookingProfileResponse
var response *v2.GetBusinessBookingProfileResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -287,9 +287,9 @@ func (c *Client) GetBusinessProfile(
// Retrieves a seller's location booking profile.
func (c *Client) RetrieveLocationBookingProfile(
ctx context.Context,
request *squaregosdk.RetrieveLocationBookingProfileRequest,
request *v2.RetrieveLocationBookingProfileRequest,
opts ...option.RequestOption,
) (*squaregosdk.RetrieveLocationBookingProfileResponse, error) {
) (*v2.RetrieveLocationBookingProfileResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -305,7 +305,7 @@ func (c *Client) RetrieveLocationBookingProfile(
options.ToHeader(),
)

var response *squaregosdk.RetrieveLocationBookingProfileResponse
var response *v2.RetrieveLocationBookingProfileResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -327,9 +327,9 @@ func (c *Client) RetrieveLocationBookingProfile(
// Retrieves one or more team members' booking profiles.
func (c *Client) BulkRetrieveTeamMemberBookingProfiles(
ctx context.Context,
request *squaregosdk.BulkRetrieveTeamMemberBookingProfilesRequest,
request *v2.BulkRetrieveTeamMemberBookingProfilesRequest,
opts ...option.RequestOption,
) (*squaregosdk.BulkRetrieveTeamMemberBookingProfilesResponse, error) {
) (*v2.BulkRetrieveTeamMemberBookingProfilesResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -343,7 +343,7 @@ func (c *Client) BulkRetrieveTeamMemberBookingProfiles(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.BulkRetrieveTeamMemberBookingProfilesResponse
var response *v2.BulkRetrieveTeamMemberBookingProfilesResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand All @@ -369,9 +369,9 @@ func (c *Client) BulkRetrieveTeamMemberBookingProfiles(
// To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
func (c *Client) Get(
ctx context.Context,
request *squaregosdk.BookingsGetRequest,
request *v2.BookingsGetRequest,
opts ...option.RequestOption,
) (*squaregosdk.GetBookingResponse, error) {
) (*v2.GetBookingResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -387,7 +387,7 @@ func (c *Client) Get(
options.ToHeader(),
)

var response *squaregosdk.GetBookingResponse
var response *v2.GetBookingResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand Down Expand Up @@ -415,9 +415,9 @@ func (c *Client) Get(
// or *Appointments Premium*.
func (c *Client) Update(
ctx context.Context,
request *squaregosdk.UpdateBookingRequest,
request *v2.UpdateBookingRequest,
opts ...option.RequestOption,
) (*squaregosdk.UpdateBookingResponse, error) {
) (*v2.UpdateBookingResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -434,7 +434,7 @@ func (c *Client) Update(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.UpdateBookingResponse
var response *v2.UpdateBookingResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand Down Expand Up @@ -463,9 +463,9 @@ func (c *Client) Update(
// or *Appointments Premium*.
func (c *Client) Cancel(
ctx context.Context,
request *squaregosdk.CancelBookingRequest,
request *v2.CancelBookingRequest,
opts ...option.RequestOption,
) (*squaregosdk.CancelBookingResponse, error) {
) (*v2.CancelBookingResponse, error) {
options := core.NewRequestOptions(opts...)
baseURL := internal.ResolveBaseURL(
options.BaseURL,
Expand All @@ -482,7 +482,7 @@ func (c *Client) Cancel(
)
headers.Set("Content-Type", "application/json")

var response *squaregosdk.CancelBookingResponse
var response *v2.CancelBookingResponse
if err := c.caller.Call(
ctx,
&internal.CallParams{
Expand Down
Loading

0 comments on commit 0e420e8

Please sign in to comment.