Skip to content

Commit d173433

Browse files
scaleway-botyfodil
andauthored
feat(billing): enable v2beta1 cli generation (#3660)
Co-authored-by: Yacine Fodil <105779815+yfodil@users.noreply.github.com> Co-authored-by: Yacine FODIL <yfodil@scaleway.com>
1 parent 601930a commit d173433

15 files changed

+665
-33
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Consumption Tax allows you to retrieve your past or current tax charges, by project or category.
4+
5+
USAGE:
6+
scw billing consumption list-taxes [arg=value ...]
7+
8+
ARGS:
9+
[order-by] Order consumed taxes list in the response by their update date (updated_at_desc | updated_at_asc | category_name_desc | category_name_asc)
10+
[billing-period] Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default
11+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
12+
13+
FLAGS:
14+
-h, --help help for list-taxes
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Consumption allows you to retrieve your past or current consumption cost, by project or category.
4+
5+
USAGE:
6+
scw billing consumption list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] Order consumptions list in the response by their update date (updated_at_desc | updated_at_asc | category_name_desc | category_name_asc)
10+
[project-id] Project ID to use. If none is passed the default project ID will be used
11+
[category-name] Filter by name of a Category as they are shown in the invoice (Compute, Network, Observability)
12+
[billing-period] Filter by the billing period in the YYYY-MM format. If it is empty the current billing period will be used as default
13+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
14+
15+
FLAGS:
16+
-h, --help help for list
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Consumption management commands.
4+
5+
USAGE:
6+
scw billing consumption <command>
7+
8+
AVAILABLE COMMANDS:
9+
list Get monthly consumption
10+
list-taxes Get monthly consumption taxes
11+
12+
FLAGS:
13+
-h, --help help for consumption
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
20+
21+
Use "scw billing consumption [command] --help" for more information about a command.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
List all discounts for an organization and usable categories/products/offers/references/regions/zones where the discount can be applied.
3+
List all discounts for your organization and usable categories, products, offers, references, regions and zones where the discount can be applied.
44

55
USAGE:
66
scw billing discount list [arg=value ...]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Discounts management commands.
3+
Discount management commands.
44

55
USAGE:
66
scw billing discount <command>
77

88
AVAILABLE COMMANDS:
9-
list List all user's discounts
9+
list List discounts
1010

1111
FLAGS:
1212
-h, --help help for discount

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
Download a specific invoice, specified by its ID.
44

55
USAGE:
6-
scw billing invoice download [arg=value ...]
6+
scw billing invoice download <invoice-id ...> [arg=value ...]
77

88
ARGS:
9-
invoice-id Invoice ID
10-
[file-path=./] Wanted file path
11-
[file-type=pdf] Wanted file extension
12-
[force-replace=false] Force file replacement
9+
invoice-id Invoice ID
10+
[file-type] File type. PDF by default (pdf)
1311

1412
FLAGS:
1513
-h, --help help for download
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Export invoices in a CSV file.
4+
5+
USAGE:
6+
scw billing invoice export [arg=value ...]
7+
8+
ARGS:
9+
[billing-period-start-after] Return only invoice with start date greater than billing_period_start
10+
[billing-period-start-before] Return only invoice with start date less than billing_period_start
11+
[invoice-type] Invoice type. It can either be `periodic` or `purchase` (unknown_type | periodic | purchase)
12+
[page] Page number
13+
[page-size=20] Positive integer lower or equal to 100 to select the number of items to return
14+
[order-by] How invoices are ordered in the response (invoice_number_desc | invoice_number_asc | start_date_desc | start_date_asc | issued_date_desc | issued_date_asc | due_date_desc | due_date_asc | total_untaxed_desc | total_untaxed_asc | total_taxed_desc | total_taxed_asc | invoice_type_desc | invoice_type_asc)
15+
[file-type=CSV] File format for exporting the invoice list (csv)
16+
[organization-id] Organization ID. If specified, only invoices from this Organization will be returned
17+
18+
FLAGS:
19+
-h, --help help for export
20+
21+
GLOBAL FLAGS:
22+
-c, --config string The path to the config file
23+
-D, --debug Enable debug mode
24+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
25+
-p, --profile string The config profile to use
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Get a specific invoice, specified by its ID.
4+
5+
USAGE:
6+
scw billing invoice get <invoice-id ...> [arg=value ...]
7+
8+
ARGS:
9+
invoice-id Invoice ID
10+
11+
FLAGS:
12+
-h, --help help for get
13+
14+
GLOBAL FLAGS:
15+
-c, --config string The path to the config file
16+
-D, --debug Enable debug mode
17+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
18+
-p, --profile string The config profile to use

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ USAGE:
66
scw billing invoice list [arg=value ...]
77

88
ARGS:
9-
[started-after] Invoice's `start_date` is greater or equal to `started_after`
10-
[started-before] Invoice's `start_date` precedes `started_before`
11-
[invoice-type] Invoice type. It can either be `periodic` or `purchase` (unknown_type | periodic | purchase)
12-
[order-by] How invoices are ordered in the response (invoice_number_desc | invoice_number_asc | start_date_desc | start_date_asc | issued_date_desc | issued_date_asc | due_date_desc | due_date_asc | total_untaxed_desc | total_untaxed_asc | total_taxed_desc | total_taxed_asc | invoice_type_desc | invoice_type_asc)
13-
[organization-id] Organization ID to filter for, only invoices from this Organization will be returned
9+
[billing-period-start-after] Return only invoice with start date greater than billing_period_start
10+
[billing-period-start-before] Return only invoice with start date less than billing_period_start
11+
[invoice-type] Invoice type. It can either be `periodic` or `purchase` (unknown_type | periodic | purchase)
12+
[order-by] How invoices are ordered in the response (invoice_number_desc | invoice_number_asc | start_date_desc | start_date_asc | issued_date_desc | issued_date_asc | due_date_desc | due_date_asc | total_untaxed_desc | total_untaxed_asc | total_taxed_desc | total_taxed_asc | invoice_type_desc | invoice_type_asc)
13+
[organization-id] Organization ID. If specified, only invoices from this Organization will be returned
1414

1515
FLAGS:
1616
-h, --help help for list

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Invoices management commands.
3+
Invoice management commands.
44

55
USAGE:
66
scw billing invoice <command>
77

88
AVAILABLE COMMANDS:
99
download Download an invoice
10+
export Export invoices
11+
get Get an invoice
1012
list List invoices
1113

1214
FLAGS:

0 commit comments

Comments
 (0)