Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private type on public interface makes it hard to mock out the response #34

Closed
aliotta opened this issue Oct 8, 2024 · 4 comments
Closed

Comments

@aliotta
Copy link

aliotta commented Oct 8, 2024

The following List endpoint returns a type that is not made public making it difficult to make an interface for this method.

func (r *CustomerInvoiceService) List(ctx context.Context, customerID string, query CustomerInvoiceListParams, opts ...option.RequestOption) (res *pagination.CursorPage[Invoice], err error) {

@dgellow
Copy link

dgellow commented Oct 9, 2024

Hi @aliotta,

Could you clarify what type is causing issues for you? Both pagination.CursorPage and Invoice seem to be public as far as I can tell.

@aliotta
Copy link
Author

aliotta commented Oct 10, 2024

Its the pagination param.

e.g. the following does not work as I do not have a reference to the pagination package.

import (
	"context"
	"os"
	"metronomeSDK "github.com/Metronome-Industries/metronome-go"
	"github.com/Metronome-Industries/metronome-go/option"
)

func (gl *metronomeV2Client) ListInvoice(ctx context.Context, customerId string, invoiceId string, body metronomeSDK.CustomerInvoiceListParams) (res *metronomeSDK.Pagination.CursorPage[metronomeSDK.Invoice], err error) {
	return gl.client.Customers.Invoices.List(ctx, customerId, body)
}

@dgellow
Copy link

dgellow commented Oct 10, 2024

Ah, you're perfectly right, pagination is under internal. That's definitely problematic. Thank you for the report, we are looking into it.

@dgellow
Copy link

dgellow commented Oct 16, 2024

Hi @aliotta, thanks for your patience, the issue has been fixed with this commit.

That will be part of the next release.

@stainless-app stainless-app bot closed this as completed Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants