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.4 #28

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
541211f
feat(api): OpenAPI spec update via Stainless API (#26)
stainless-app[bot] Sep 30, 2024
e520581
chore(internal): codegen related update (#27)
stainless-app[bot] Sep 30, 2024
53bc7a3
codegen metadata
stainless-bot Oct 1, 2024
f0c2c67
feat(api): OpenAPI spec update via Stainless API (#30)
stainless-app[bot] Oct 4, 2024
48db3fc
chore(internal): codegen related update (#31)
stainless-app[bot] Oct 4, 2024
799e8c3
chore(internal): codegen related update (#32)
stainless-app[bot] Oct 4, 2024
eb465ba
feat(api): OpenAPI spec update via Stainless API (#33)
stainless-app[bot] Oct 7, 2024
10d6376
feat(api): api update (#35)
stainless-app[bot] Oct 16, 2024
3acd4c0
feat(api): api update (#36)
stainless-app[bot] Oct 16, 2024
0b966c4
feat(api): api update (#37)
stainless-app[bot] Oct 24, 2024
0e7bec3
feat(api): api update (#39)
stainless-app[bot] Oct 29, 2024
5ee5774
chore: rebuild project due to codegen change (#40)
stainless-app[bot] Oct 30, 2024
306626e
feat(api): api update (#41)
stainless-app[bot] Oct 31, 2024
bf8db73
chore: rebuild project due to codegen change (#42)
stainless-app[bot] Nov 1, 2024
6e0b1a6
feat(api): api update (#43)
stainless-app[bot] Nov 1, 2024
0b179d8
chore: rebuild project due to codegen change (#44)
stainless-app[bot] Nov 1, 2024
a049cc7
codegen metadata
stainless-bot Nov 4, 2024
4f67b04
feat(api): api update (#45)
stainless-app[bot] Nov 5, 2024
e3396a6
feat(api): api update (#46)
stainless-app[bot] Nov 5, 2024
b188565
feat(api): api update (#47)
stainless-app[bot] Nov 6, 2024
3c80c86
release: 0.1.0-beta.4
stainless-app[bot] Nov 6, 2024
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
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.3"
".": "0.1.0-beta.4"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-c4ec65355a30c07306ddff2c4a97411c2eb631a878583ce8bdd876a4fe2a5c96.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/metronome%2Fmetronome-6dcbe131976438514039571dfab3379d6429b608799f27dca65331d0bbc73fdb.yml
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
brew "go"
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## 0.1.0-beta.4 (2024-11-06)

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

### Features

* **api:** api update ([#35](https://github.com/Metronome-Industries/metronome-go/issues/35)) ([10d6376](https://github.com/Metronome-Industries/metronome-go/commit/10d637675b897ac77f592646ac7a4d2dada9da70))
* **api:** api update ([#36](https://github.com/Metronome-Industries/metronome-go/issues/36)) ([3acd4c0](https://github.com/Metronome-Industries/metronome-go/commit/3acd4c0a30ae31634e50ef237d7a4b80237f6183))
* **api:** api update ([#37](https://github.com/Metronome-Industries/metronome-go/issues/37)) ([0b966c4](https://github.com/Metronome-Industries/metronome-go/commit/0b966c4dff82ce422020aab5718cbcdfadae2c49))
* **api:** api update ([#39](https://github.com/Metronome-Industries/metronome-go/issues/39)) ([0e7bec3](https://github.com/Metronome-Industries/metronome-go/commit/0e7bec38766346ec8f7e98d4312f4d778d8ca342))
* **api:** api update ([#41](https://github.com/Metronome-Industries/metronome-go/issues/41)) ([306626e](https://github.com/Metronome-Industries/metronome-go/commit/306626e7a4181b09ccec699cd75941823d43eff9))
* **api:** api update ([#43](https://github.com/Metronome-Industries/metronome-go/issues/43)) ([6e0b1a6](https://github.com/Metronome-Industries/metronome-go/commit/6e0b1a6528182d034cc31da1e4d32fec8d9ca48b))
* **api:** api update ([#45](https://github.com/Metronome-Industries/metronome-go/issues/45)) ([4f67b04](https://github.com/Metronome-Industries/metronome-go/commit/4f67b0413755d9f6d8b639652ed81586b01d2b81))
* **api:** api update ([#46](https://github.com/Metronome-Industries/metronome-go/issues/46)) ([e3396a6](https://github.com/Metronome-Industries/metronome-go/commit/e3396a6ec8ad361d6dce18270349fe2c8e7b67d8))
* **api:** api update ([#47](https://github.com/Metronome-Industries/metronome-go/issues/47)) ([b188565](https://github.com/Metronome-Industries/metronome-go/commit/b188565eb98210cfbefc1ea534f007a3e71196a2))
* **api:** OpenAPI spec update via Stainless API ([#26](https://github.com/Metronome-Industries/metronome-go/issues/26)) ([541211f](https://github.com/Metronome-Industries/metronome-go/commit/541211f4f43fab71ae4dc87ce001e90a7ca2284e))
* **api:** OpenAPI spec update via Stainless API ([#30](https://github.com/Metronome-Industries/metronome-go/issues/30)) ([f0c2c67](https://github.com/Metronome-Industries/metronome-go/commit/f0c2c6789d1efd54a1b0c1f29c0d89d4c1bbaf28))
* **api:** OpenAPI spec update via Stainless API ([#33](https://github.com/Metronome-Industries/metronome-go/issues/33)) ([eb465ba](https://github.com/Metronome-Industries/metronome-go/commit/eb465ba57ea0a060927d29d3b3c73143e649b66b))


### Chores

* **internal:** codegen related update ([#27](https://github.com/Metronome-Industries/metronome-go/issues/27)) ([e520581](https://github.com/Metronome-Industries/metronome-go/commit/e520581c40181d2b0c0c5d1936b85553bdff8673))
* **internal:** codegen related update ([#31](https://github.com/Metronome-Industries/metronome-go/issues/31)) ([48db3fc](https://github.com/Metronome-Industries/metronome-go/commit/48db3fc98901fc9fa967fffaa2d891175e5ef6cf))
* **internal:** codegen related update ([#32](https://github.com/Metronome-Industries/metronome-go/issues/32)) ([799e8c3](https://github.com/Metronome-Industries/metronome-go/commit/799e8c379cfee51a748fd2b1ff6276088ca56413))
* rebuild project due to codegen change ([#40](https://github.com/Metronome-Industries/metronome-go/issues/40)) ([5ee5774](https://github.com/Metronome-Industries/metronome-go/commit/5ee5774bad7eeaabbbd3f0242f39ac903d47cda0))
* rebuild project due to codegen change ([#42](https://github.com/Metronome-Industries/metronome-go/issues/42)) ([bf8db73](https://github.com/Metronome-Industries/metronome-go/commit/bf8db7314f7c7eecac4b41d8f46bed17c3f98b76))
* rebuild project due to codegen change ([#44](https://github.com/Metronome-Industries/metronome-go/issues/44)) ([0b179d8](https://github.com/Metronome-Industries/metronome-go/commit/0b179d84d0b401fef4c5389e45a6ab83b936a631))

## 0.1.0-beta.3 (2024-09-20)

Full Changelog: [v0.1.0-beta.2...v0.1.0-beta.3](https://github.com/Metronome-Industries/metronome-go/compare/v0.1.0-beta.2...v0.1.0-beta.3)
Expand Down
33 changes: 20 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## Setting up the environment

### Install Go 1.18+
To set up the repository, run:

Install go by following relevant directions [here](https://go.dev/doc/install).
```sh
$ ./scripts/bootstrap
$ ./scripts/build
```

This will install all the required dependencies and build the SDK.

You can also [install go 1.18+ manually](https://go.dev/doc/install).

## Modifying/Adding code

Expand All @@ -14,7 +21,7 @@ modify the contents of the `lib/` and `examples/` directories.

All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.

```bash
```go
# add an example to examples/<your-example>/main.go

package main
Expand All @@ -24,36 +31,36 @@ func main() {
}
```

```bash
go run ./examples/<your-example>
```sh
$ go run ./examples/<your-example>
```

## Using the repository from source

To use a local version of this library from source in another project, edit the `go.mod` with a replace
directive. This can be done through the CLI with the following:

```bash
go mod edit -replace github.com/Metronome-Industries/metronome-go=/path/to/metronome-go
```sh
$ go mod edit -replace github.com/Metronome-Industries/metronome-go=/path/to/metronome-go
```

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```bash
```sh
# you will need npm installed
npx prism mock path/to/your/openapi.yml
$ npx prism mock path/to/your/openapi.yml
```

```bash
go test ./...
```sh
$ ./scripts/test
```

## Formatting

This library uses the standard gofmt code formatter:

```bash
gofmt -s -w .
```sh
$ ./scripts/format
```
6 changes: 5 additions & 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/[email protected].3'
go get -u 'github.com/Metronome-Industries/[email protected].4'
```

<!-- x-release-please-end -->
Expand Down Expand Up @@ -379,3 +379,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/Metronome-Industries/metronome-go/issues) with questions, bugs, or suggestions.

## Contributing

See [the contributing documentation](./CONTRIBUTING.md).
10 changes: 7 additions & 3 deletions alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ type AlertNewParams struct {
AlertType param.Field[AlertNewParamsAlertType] `json:"alert_type,required"`
// Name of the alert
Name param.Field[string] `json:"name,required"`
// Threshold value of the alert policy
// Threshold value of the alert policy. Depending upon the alert type, this number
// may represent a financial amount, the days remaining, or a percentage reached.
Threshold param.Field[float64] `json:"threshold,required"`
// For alerts of type `usage_threshold_reached`, specifies which billable metric to
// track the usage for.
Expand Down Expand Up @@ -201,9 +202,12 @@ func (r AlertNewParamsGroupKeyFilter) MarshalJSON() (data []byte, err error) {
}

type AlertArchiveParams struct {
ID shared.IDParam `json:"id,required"`
// The Metronome ID of the alert
ID param.Field[string] `json:"id,required" format:"uuid"`
// If true, resets the uniqueness key on this alert so it can be re-used
ReleaseUniquenessKey param.Field[bool] `json:"release_uniqueness_key"`
}

func (r AlertArchiveParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.ID)
return apijson.MarshalRoot(r)
}
8 changes: 3 additions & 5 deletions alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/Metronome-Industries/metronome-go"
"github.com/Metronome-Industries/metronome-go/internal/testutil"
"github.com/Metronome-Industries/metronome-go/option"
"github.com/Metronome-Industries/metronome-go/shared"
)

func TestAlertNewWithOptionalParams(t *testing.T) {
Expand Down Expand Up @@ -65,7 +64,7 @@ func TestAlertNewWithOptionalParams(t *testing.T) {
}
}

func TestAlertArchive(t *testing.T) {
func TestAlertArchiveWithOptionalParams(t *testing.T) {
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
Expand All @@ -78,9 +77,8 @@ func TestAlertArchive(t *testing.T) {
option.WithBearerToken("My Bearer Token"),
)
_, err := client.Alerts.Archive(context.TODO(), metronome.AlertArchiveParams{
ID: shared.IDParam{
ID: metronome.F("8deed800-1b7a-495d-a207-6c52bac54dc9"),
},
ID: metronome.F("8deed800-1b7a-495d-a207-6c52bac54dc9"),
ReleaseUniquenessKey: metronome.F(true),
})
if err != nil {
var apierr *metronome.Error
Expand Down
6 changes: 6 additions & 0 deletions aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ const ContractWithoutAmendmentsUsageStatementScheduleFrequencyMonthly = shared.C
// This is an alias to an internal value.
const ContractWithoutAmendmentsUsageStatementScheduleFrequencyQuarterly = shared.ContractWithoutAmendmentsUsageStatementScheduleFrequencyQuarterly

// This is an alias to an internal value.
const ContractWithoutAmendmentsUsageStatementScheduleFrequencyAnnual = shared.ContractWithoutAmendmentsUsageStatementScheduleFrequencyAnnual

// This is an alias to an internal type.
type ContractWithoutAmendmentsResellerRoyalty = shared.ContractWithoutAmendmentsResellerRoyalty

Expand Down Expand Up @@ -347,6 +350,9 @@ const CreditLedgerTypeCreditCredited = shared.CreditLedgerTypeCreditCredited
// This is an alias to an internal value.
const CreditLedgerTypeCreditManual = shared.CreditLedgerTypeCreditManual

// This is an alias to an internal type.
type CreditTypeData = shared.CreditTypeData

// This is an alias to an internal type.
type Discount = shared.Discount

Expand Down
Loading
Loading