@@ -129,17 +129,19 @@ func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error {
129129 if cmd .IsSet ("project" ) {
130130 params .Project = stainless .String (cmd .Value ("project" ).(string ))
131131 }
132- res , err := cc .client .Projects .Branches .New (
132+ var res []byte
133+ _ , err := cc .client .Projects .Branches .New (
133134 context .TODO (),
134135 params ,
135136 option .WithMiddleware (cc .AsMiddleware ()),
137+ option .WithResponseBodyInto (& res ),
136138 )
137139 if err != nil {
138140 return err
139141 }
140142
141143 format := cmd .Root ().String ("format" )
142- return ShowJSON ("projects:branches create" , res . RawJSON ( ), format )
144+ return ShowJSON ("projects:branches create" , string ( res ), format )
143145}
144146
145147func handleProjectsBranchesRetrieve (ctx context.Context , cmd * cli.Command ) error {
@@ -148,18 +150,20 @@ func handleProjectsBranchesRetrieve(ctx context.Context, cmd *cli.Command) error
148150 if cmd .IsSet ("project" ) {
149151 params .Project = stainless .String (cmd .Value ("project" ).(string ))
150152 }
151- res , err := cc .client .Projects .Branches .Get (
153+ var res []byte
154+ _ , err := cc .client .Projects .Branches .Get (
152155 context .TODO (),
153156 cmd .Value ("branch" ).(string ),
154157 params ,
155158 option .WithMiddleware (cc .AsMiddleware ()),
159+ option .WithResponseBodyInto (& res ),
156160 )
157161 if err != nil {
158162 return err
159163 }
160164
161165 format := cmd .Root ().String ("format" )
162- return ShowJSON ("projects:branches retrieve" , res . RawJSON ( ), format )
166+ return ShowJSON ("projects:branches retrieve" , string ( res ), format )
163167}
164168
165169func handleProjectsBranchesList (ctx context.Context , cmd * cli.Command ) error {
@@ -168,17 +172,19 @@ func handleProjectsBranchesList(ctx context.Context, cmd *cli.Command) error {
168172 if cmd .IsSet ("project" ) {
169173 params .Project = stainless .String (cmd .Value ("project" ).(string ))
170174 }
171- res , err := cc .client .Projects .Branches .List (
175+ var res []byte
176+ _ , err := cc .client .Projects .Branches .List (
172177 context .TODO (),
173178 params ,
174179 option .WithMiddleware (cc .AsMiddleware ()),
180+ option .WithResponseBodyInto (& res ),
175181 )
176182 if err != nil {
177183 return err
178184 }
179185
180186 format := cmd .Root ().String ("format" )
181- return ShowJSON ("projects:branches list" , res . RawJSON ( ), format )
187+ return ShowJSON ("projects:branches list" , string ( res ), format )
182188}
183189
184190func handleProjectsBranchesDelete (ctx context.Context , cmd * cli.Command ) error {
@@ -187,7 +193,7 @@ func handleProjectsBranchesDelete(ctx context.Context, cmd *cli.Command) error {
187193 if cmd .IsSet ("project" ) {
188194 params .Project = stainless .String (cmd .Value ("project" ).(string ))
189195 }
190- res := []byte {}
196+ var res []byte
191197 _ , err := cc .client .Projects .Branches .Delete (
192198 context .TODO (),
193199 cmd .Value ("branch" ).(string ),
@@ -209,16 +215,18 @@ func handleProjectsBranchesRebase(ctx context.Context, cmd *cli.Command) error {
209215 if cmd .IsSet ("project" ) {
210216 params .Project = stainless .String (cmd .Value ("project" ).(string ))
211217 }
212- res , err := cc .client .Projects .Branches .Rebase (
218+ var res []byte
219+ _ , err := cc .client .Projects .Branches .Rebase (
213220 context .TODO (),
214221 cmd .Value ("branch" ).(string ),
215222 params ,
216223 option .WithMiddleware (cc .AsMiddleware ()),
224+ option .WithResponseBodyInto (& res ),
217225 )
218226 if err != nil {
219227 return err
220228 }
221229
222230 format := cmd .Root ().String ("format" )
223- return ShowJSON ("projects:branches rebase" , res . RawJSON ( ), format )
231+ return ShowJSON ("projects:branches rebase" , string ( res ), format )
224232}
0 commit comments