| // Code generated by @openmeter/typespec-go. DO NOT EDIT. | |
| package openmeter | |
| import ( | |
| "context" | |
| "fmt" | |
| "net/http" | |
| ) | |
| type EntitlementsService struct { | |
| client *Client | |
| } | |
| func (s *EntitlementsService) ListCustomerAccess(ctx context.Context, customerID string) (*ListCustomerEntitlementAccessResponseData, error) { | |
| if customerID == "" { | |
| return nil, fmt.Errorf("openmeter: %s must not be empty: %w", "customerID", ErrEmptyID) | |
| } | |
| path := "/openmeter/customers/{customerId}/entitlement-access" | |
| path = replacePathParam(path, "customerId", customerID) | |
| req, err := s.client.newRequestWithContentType(ctx, http.MethodGet, path, nil, nil, "", "application/json") | |
| if err != nil { | |
| return nil, err | |
| } | |
| var out ListCustomerEntitlementAccessResponseData | |
| if err := s.client.doJSON(req, &out); err != nil { | |
| return nil, err | |
| } | |
| return &out, nil | |
| } | |