Skip to content

Commit 2539725

Browse files
feat(api): manual updates
1 parent 8a3745d commit 2539725

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 15
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-cfef2e882e091dad51a5b53bc39cc251ecf3f71cc0328561cec6309e8bbac93a.yml
33
openapi_spec_hash: fac1531252a5b791107de8257fdcf3cb
4-
config_hash: e269922aeded8aadd211a0da29d10519
4+
config_hash: 63d8d983a264942533fdd383e2a6ef7a

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ stainless-api-cli [resource] [command] [flags]
2626

2727
```sh
2828
stainless-api-cli builds create \
29-
--project project \
3029
--revision string
3130
```
3231

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ go 1.23.0
55
toolchain go1.23.9
66

77
require (
8+
github.com/stainless-api/stainless-api-go v0.5.0
89
github.com/logrusorgru/aurora/v4 v4.0.0
910
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
10-
github.com/stainless-api/stainless-api-go v0.4.0
1111
github.com/tidwall/gjson v1.17.0
1212
github.com/tidwall/pretty v1.2.1
1313
github.com/tidwall/sjson v1.2.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd
66
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
77
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
88
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9-
github.com/stainless-api/stainless-api-go v0.4.0 h1:uRuRqXULJEllH3NES3YbCjLngUG8eoRxaFutA1e/wEs=
10-
github.com/stainless-api/stainless-api-go v0.4.0/go.mod h1:9Q2t8xq6EFgw8HYOsVxqKEfSDVe9eqCoh1zC0HMRwTY=
9+
github.com/stainless-api/stainless-api-go v0.5.0 h1:9HBmLxOYQYQHnVUDkdDlnXBgBJ46hq519h5xwjyCb2c=
10+
github.com/stainless-api/stainless-api-go v0.5.0/go.mod h1:9Q2t8xq6EFgw8HYOsVxqKEfSDVe9eqCoh1zC0HMRwTY=
1111
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1212
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1313
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=

project.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ var projectsList = cli.Command{
6666

6767
func handleProjectsRetrieve(ctx context.Context, cmd *cli.Command) error {
6868
cc := getAPICommandContext(ctx, cmd)
69+
params := stainlessv0.ProjectGetParams{}
70+
if cmd.IsSet("project") {
71+
params.Project = stainlessv0.String(cmd.Value("project").(string))
72+
}
6973
res, err := cc.client.Projects.Get(
7074
context.TODO(),
71-
cmd.Value("project").(string),
75+
params,
7276
option.WithMiddleware(cc.AsMiddleware()),
7377
)
7478
if err != nil {
@@ -82,9 +86,11 @@ func handleProjectsRetrieve(ctx context.Context, cmd *cli.Command) error {
8286
func handleProjectsUpdate(ctx context.Context, cmd *cli.Command) error {
8387
cc := getAPICommandContext(ctx, cmd)
8488
params := stainlessv0.ProjectUpdateParams{}
89+
if cmd.IsSet("project") {
90+
params.Project = stainlessv0.String(cmd.Value("project").(string))
91+
}
8592
res, err := cc.client.Projects.Update(
8693
context.TODO(),
87-
cmd.Value("project").(string),
8894
params,
8995
option.WithMiddleware(cc.AsMiddleware()),
9096
option.WithRequestBody("application/json", cc.body),

projectbranch.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ var projectsBranchesRetrieve = cli.Command{
5656
func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error {
5757
cc := getAPICommandContext(ctx, cmd)
5858
params := stainlessv0.ProjectBranchNewParams{}
59+
if cmd.IsSet("project") {
60+
params.Project = stainlessv0.String(cmd.Value("project").(string))
61+
}
5962
res, err := cc.client.Projects.Branches.New(
6063
context.TODO(),
61-
cmd.Value("project").(string),
6264
params,
6365
option.WithMiddleware(cc.AsMiddleware()),
6466
option.WithRequestBody("application/json", cc.body),
@@ -73,12 +75,14 @@ func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error {
7375

7476
func handleProjectsBranchesRetrieve(ctx context.Context, cmd *cli.Command) error {
7577
cc := getAPICommandContext(ctx, cmd)
78+
params := stainlessv0.ProjectBranchGetParams{}
79+
if cmd.IsSet("project") {
80+
params.Project = stainlessv0.String(cmd.Value("project").(string))
81+
}
7682
res, err := cc.client.Projects.Branches.Get(
7783
context.TODO(),
7884
cmd.Value("branch").(string),
79-
stainlessv0.ProjectBranchGetParams {
80-
Project: cmd.Value("project").(string),
81-
},
85+
params,
8286
option.WithMiddleware(cc.AsMiddleware()),
8387
)
8488
if err != nil {

projectconfig.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ var projectsConfigsGuess = cli.Command{
5353
func handleProjectsConfigsRetrieve(ctx context.Context, cmd *cli.Command) error {
5454
cc := getAPICommandContext(ctx, cmd)
5555
params := stainlessv0.ProjectConfigGetParams{}
56+
if cmd.IsSet("project") {
57+
params.Project = stainlessv0.String(cmd.Value("project").(string))
58+
}
5659
res := []byte{}
5760
_, err := cc.client.Projects.Configs.Get(
5861
context.TODO(),
59-
cmd.Value("project").(string),
6062
params,
6163
option.WithMiddleware(cc.AsMiddleware()),
6264
option.WithResponseBodyInto(&res),
@@ -72,10 +74,12 @@ func handleProjectsConfigsRetrieve(ctx context.Context, cmd *cli.Command) error
7274
func handleProjectsConfigsGuess(ctx context.Context, cmd *cli.Command) error {
7375
cc := getAPICommandContext(ctx, cmd)
7476
params := stainlessv0.ProjectConfigGuessParams{}
77+
if cmd.IsSet("project") {
78+
params.Project = stainlessv0.String(cmd.Value("project").(string))
79+
}
7580
res := []byte{}
7681
_, err := cc.client.Projects.Configs.Guess(
7782
context.TODO(),
78-
cmd.Value("project").(string),
7983
params,
8084
option.WithMiddleware(cc.AsMiddleware()),
8185
option.WithRequestBody("application/json", cc.body),

0 commit comments

Comments
 (0)