Skip to content

Commit b0d22c7

Browse files
authored
feat(billing): discount application scope endpoint (#3451)
1 parent ba99c1f commit b0d22c7

6 files changed

Lines changed: 44 additions & 3 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Discounts management commands.
4+
5+
USAGE:
6+
scw billing discount
7+
8+
FLAGS:
9+
-h, --help help for discount
10+
11+
GLOBAL FLAGS:
12+
-c, --config string The path to the config file
13+
-D, --debug Enable debug mode
14+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
15+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-billing-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USAGE:
66
scw billing <command>
77

88
AVAILABLE COMMANDS:
9+
discount Discounts management commands
910
invoice Invoices management commands
1011

1112
FLAGS:

docs/commands/billing.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,26 @@
22
# Documentation for `scw billing`
33
This API allows you to query your consumption.
44

5+
- [Discounts management commands](#discounts-management-commands)
56
- [Invoices management commands](#invoices-management-commands)
67
- [Download an invoice](#download-an-invoice)
78
- [List invoices](#list-invoices)
89

910

11+
## Discounts management commands
12+
13+
Discounts management commands.
14+
15+
Discounts management commands.
16+
17+
**Usage:**
18+
19+
```
20+
scw billing discount
21+
```
22+
23+
24+
1025
## Invoices management commands
1126

1227
Invoices management commands.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231023150151-5666f41137c0
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231024135134-9017dc9053be
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.7.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
487487
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
488488
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
489489
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
490-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231023150151-5666f41137c0 h1:Q7njKDD9KwXQ+IzWL5+0nwZYf/zs4N6cjp6mhIMVJ28=
491-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231023150151-5666f41137c0/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
490+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231024135134-9017dc9053be h1:VmT6+vJNYE6dqBU9RHferKsXg2dGVCC0FFUvJbuO5Zk=
491+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20231024135134-9017dc9053be/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
492492
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
493493
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
494494
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/billing/v2alpha1/billing_cli.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func GetGeneratedCommands() *core.Commands {
2121
return core.NewCommands(
2222
billingRoot(),
2323
billingInvoice(),
24+
billingDiscount(),
2425
billingInvoiceList(),
2526
billingInvoiceDownload(),
2627
)
@@ -42,6 +43,15 @@ func billingInvoice() *core.Command {
4243
}
4344
}
4445

46+
func billingDiscount() *core.Command {
47+
return &core.Command{
48+
Short: `Discounts management commands`,
49+
Long: `Discounts management commands.`,
50+
Namespace: "billing",
51+
Resource: "discount",
52+
}
53+
}
54+
4555
func billingInvoiceList() *core.Command {
4656
return &core.Command{
4757
Short: `List invoices`,

0 commit comments

Comments
 (0)