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

release: 0.1.0-beta.2 #14

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/create-releases.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/handle-release-pr-title-edit.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-beta.1"
".": "0.1.0-beta.2"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 88
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-085bb8699d222fd7950750078c4ea00fb8728477809a8ebc74521a7ad5f32038.yml
configured_endpoints: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-c23134402bb47d1637feabf3d4058720571d9d5d90253a11e2ea818b3add064a.yml
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.1.0-beta.2 (2024-09-05)

Full Changelog: [v0.1.0-beta.1...v0.1.0-beta.2](https://github.com/Metronome-Industries/metronome-go/compare/v0.1.0-beta.1...v0.1.0-beta.2)

### Features

* **api:** OpenAPI spec update via Stainless API ([#13](https://github.com/Metronome-Industries/metronome-go/issues/13)) ([ac9dca1](https://github.com/Metronome-Industries/metronome-go/commit/ac9dca1e425ee5f44c172ac4a01fb31848b35091))
* **api:** OpenAPI spec update via Stainless API ([#15](https://github.com/Metronome-Industries/metronome-go/issues/15)) ([7a51725](https://github.com/Metronome-Industries/metronome-go/commit/7a5172522c02383b92fc306ced2b59dde8e3f2ad))
* **api:** OpenAPI spec update via Stainless API ([#16](https://github.com/Metronome-Industries/metronome-go/issues/16)) ([d6ffbc1](https://github.com/Metronome-Industries/metronome-go/commit/d6ffbc10f2f38a95af617b357e0d1bef8270d18c))

## 0.1.0-beta.1 (2024-08-23)

Full Changelog: [v0.1.0-beta.0...v0.1.0-beta.1](https://github.com/Metronome-Industries/metronome-go/compare/v0.1.0-beta.0...v0.1.0-beta.1)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/Metronome-Industries/metronome-go@v0.1.0-beta.1'
go get -u 'github.com/Metronome-Industries/metronome-go@v0.1.0-beta.2'
```

<!-- x-release-please-end -->
Expand Down
4 changes: 3 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ Methods:

- <code title="post /billable-metrics/create">client.BillableMetrics.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricNewParams">BillableMetricNewParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricNewResponse">BillableMetricNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /billable-metrics/{billable_metric_id}">client.BillableMetrics.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, billableMetricID <a href="https://pkg.go.dev/builtin#string">string</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricGetResponse">BillableMetricGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /customers/{customer_id}/billable-metrics">client.BillableMetrics.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, customerID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricListParams">BillableMetricListParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go/internal/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go/internal/pagination#CursorPage">CursorPage</a>[<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricListResponse">BillableMetricListResponse</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /billable-metrics">client.BillableMetrics.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricListParams">BillableMetricListParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go/internal/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go/internal/pagination#CursorPage">CursorPage</a>[<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricListResponse">BillableMetricListResponse</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /billable-metrics/archive">client.BillableMetrics.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricService.Archive">Archive</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricArchiveParams">BillableMetricArchiveParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#BillableMetricArchiveResponse">BillableMetricArchiveResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

# Services
Expand Down Expand Up @@ -294,6 +294,7 @@ Response Types:
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractListResponse">ContractListResponse</a>
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractAmendResponse">ContractAmendResponse</a>
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractArchiveResponse">ContractArchiveResponse</a>
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractNewHistoricalInvoicesResponse">ContractNewHistoricalInvoicesResponse</a>
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractListBalancesResponse">ContractListBalancesResponse</a>
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractGetRateScheduleResponse">ContractGetRateScheduleResponse</a>
- <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractScheduleProServicesInvoiceResponse">ContractScheduleProServicesInvoiceResponse</a>
Expand All @@ -307,6 +308,7 @@ Methods:
- <code title="post /contracts/addManualBalanceLedgerEntry">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.AddManualBalanceEntry">AddManualBalanceEntry</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractAddManualBalanceEntryParams">ContractAddManualBalanceEntryParams</a>) <a href="https://pkg.go.dev/builtin#error">error</a></code>
- <code title="post /contracts/amend">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.Amend">Amend</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractAmendParams">ContractAmendParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractAmendResponse">ContractAmendResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /contracts/archive">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.Archive">Archive</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractArchiveParams">ContractArchiveParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractArchiveResponse">ContractArchiveResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /contracts/createHistoricalInvoices">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.NewHistoricalInvoices">NewHistoricalInvoices</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractNewHistoricalInvoicesParams">ContractNewHistoricalInvoicesParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractNewHistoricalInvoicesResponse">ContractNewHistoricalInvoicesResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /contracts/customerBalances/list">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.ListBalances">ListBalances</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractListBalancesParams">ContractListBalancesParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractListBalancesResponse">ContractListBalancesResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /contracts/getContractRateSchedule">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.GetRateSchedule">GetRateSchedule</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, params <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractGetRateScheduleParams">ContractGetRateScheduleParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractGetRateScheduleResponse">ContractGetRateScheduleResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="post /contracts/scheduleProServicesInvoice">client.Contracts.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractService.ScheduleProServicesInvoice">ScheduleProServicesInvoice</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractScheduleProServicesInvoiceParams">ContractScheduleProServicesInvoiceParams</a>) (<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go">metronome</a>.<a href="https://pkg.go.dev/github.com/Metronome-Industries/metronome-go#ContractScheduleProServicesInvoiceResponse">ContractScheduleProServicesInvoiceResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
Expand Down
35 changes: 9 additions & 26 deletions billablemetric.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,12 @@ func (r *BillableMetricService) Get(ctx context.Context, billableMetricID string
return
}

// Get all billable metrics for a given customer.
func (r *BillableMetricService) List(ctx context.Context, customerID string, query BillableMetricListParams, opts ...option.RequestOption) (res *pagination.CursorPage[BillableMetricListResponse], err error) {
// List all billable metrics.
func (r *BillableMetricService) List(ctx context.Context, query BillableMetricListParams, opts ...option.RequestOption) (res *pagination.CursorPage[BillableMetricListResponse], err error) {
var raw *http.Response
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
if customerID == "" {
err = errors.New("missing required customer_id parameter")
return
}
path := fmt.Sprintf("customers/%s/billable-metrics", customerID)
path := "billable-metrics"
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
Expand All @@ -79,9 +75,9 @@ func (r *BillableMetricService) List(ctx context.Context, customerID string, que
return res, nil
}

// Get all billable metrics for a given customer.
func (r *BillableMetricService) ListAutoPaging(ctx context.Context, customerID string, query BillableMetricListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[BillableMetricListResponse] {
return pagination.NewCursorPageAutoPager(r.List(ctx, customerID, query, opts...))
// List all billable metrics.
func (r *BillableMetricService) ListAutoPaging(ctx context.Context, query BillableMetricListParams, opts ...option.RequestOption) *pagination.CursorPageAutoPager[BillableMetricListResponse] {
return pagination.NewCursorPageAutoPager(r.List(ctx, query, opts...))
}

// Archive an existing billable metric.
Expand Down Expand Up @@ -204,12 +200,10 @@ func (r BillableMetricGetResponseDataAggregationType) IsKnown() bool {
}

type BillableMetricListResponse struct {
ID string `json:"id,required" format:"uuid"`
// ID of the billable metric
ID string `json:"id,required" format:"uuid"`
// The display name of the billable metric.
Name string `json:"name,required"`
// (DEPRECATED) use aggregation_type instead
Aggregate string `json:"aggregate"`
// (DEPRECATED) use aggregation_key instead
AggregateKeys []string `json:"aggregate_keys"`
// A key that specifies which property of the event is used to aggregate data. This
// key must be one of the property filter names and is not applicable when the
// aggregation type is 'count'.
Expand All @@ -219,10 +213,6 @@ type BillableMetricListResponse struct {
CustomFields map[string]string `json:"custom_fields"`
// An optional filtering rule to match the 'event_type' property of an event.
EventTypeFilter shared.EventTypeFilter `json:"event_type_filter"`
// (DEPRECATED) use property_filters & event_type_filter instead
Filter map[string]interface{} `json:"filter"`
// (DEPRECATED) use group_keys instead
GroupBy []string `json:"group_by"`
// Property names that are used to group usage costs on an invoice. Each entry
// represents a set of properties used to slice events into distinct buckets.
GroupKeys [][]string `json:"group_keys"`
Expand All @@ -240,14 +230,10 @@ type BillableMetricListResponse struct {
type billableMetricListResponseJSON struct {
ID apijson.Field
Name apijson.Field
Aggregate apijson.Field
AggregateKeys apijson.Field
AggregationKey apijson.Field
AggregationType apijson.Field
CustomFields apijson.Field
EventTypeFilter apijson.Field
Filter apijson.Field
GroupBy apijson.Field
GroupKeys apijson.Field
PropertyFilters apijson.Field
Sql apijson.Field
Expand Down Expand Up @@ -353,9 +339,6 @@ type BillableMetricListParams struct {
Limit param.Field[int64] `query:"limit"`
// Cursor that indicates where the next page of results should start.
NextPage param.Field[string] `query:"next_page"`
// If true, the list of metrics will be filtered to just ones that are on the
// customer's current plan
OnCurrentPlan param.Field[bool] `query:"on_current_plan"`
}

// URLQuery serializes [BillableMetricListParams]'s query parameters as
Expand Down
13 changes: 4 additions & 9 deletions billablemetric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,10 @@ func TestBillableMetricListWithOptionalParams(t *testing.T) {
option.WithBaseURL(baseURL),
option.WithBearerToken("My Bearer Token"),
)
_, err := client.BillableMetrics.List(
context.TODO(),
"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
metronome.BillableMetricListParams{
Limit: metronome.F(int64(1)),
NextPage: metronome.F("next_page"),
OnCurrentPlan: metronome.F(true),
},
)
_, err := client.BillableMetrics.List(context.TODO(), metronome.BillableMetricListParams{
Limit: metronome.F(int64(1)),
NextPage: metronome.F("next_page"),
})
if err != nil {
var apierr *metronome.Error
if errors.As(err, &apierr) {
Expand Down
Loading