6
6
"context"
7
7
"net/http"
8
8
"net/url"
9
+ "slices"
9
10
"time"
10
11
11
12
"github.com/gitpod-io/gitpod-sdk-go/internal/apijson"
@@ -102,7 +103,7 @@ func NewEnvironmentService(opts ...option.RequestOption) (r *EnvironmentService)
102
103
// name: "Web App"
103
104
// ```
104
105
func (r * EnvironmentService ) New (ctx context.Context , body EnvironmentNewParams , opts ... option.RequestOption ) (res * EnvironmentNewResponse , err error ) {
105
- opts = append (r .Options [:] , opts ... )
106
+ opts = slices . Concat (r .Options , opts )
106
107
path := "gitpod.v1.EnvironmentService/CreateEnvironment"
107
108
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
108
109
return
@@ -129,7 +130,7 @@ func (r *EnvironmentService) New(ctx context.Context, body EnvironmentNewParams,
129
130
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
130
131
// ```
131
132
func (r * EnvironmentService ) Get (ctx context.Context , body EnvironmentGetParams , opts ... option.RequestOption ) (res * EnvironmentGetResponse , err error ) {
132
- opts = append (r .Options [:] , opts ... )
133
+ opts = slices . Concat (r .Options , opts )
133
134
path := "gitpod.v1.EnvironmentService/GetEnvironment"
134
135
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
135
136
return
@@ -186,7 +187,7 @@ func (r *EnvironmentService) Get(ctx context.Context, body EnvironmentGetParams,
186
187
// Note: Machine class changes require stopping the environment and creating a new
187
188
// one.
188
189
func (r * EnvironmentService ) Update (ctx context.Context , body EnvironmentUpdateParams , opts ... option.RequestOption ) (res * EnvironmentUpdateResponse , err error ) {
189
- opts = append (r .Options [:] , opts ... )
190
+ opts = slices . Concat (r .Options , opts )
190
191
path := "gitpod.v1.EnvironmentService/UpdateEnvironment"
191
192
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
192
193
return
@@ -231,7 +232,7 @@ func (r *EnvironmentService) Update(ctx context.Context, body EnvironmentUpdateP
231
232
// ```
232
233
func (r * EnvironmentService ) List (ctx context.Context , params EnvironmentListParams , opts ... option.RequestOption ) (res * pagination.EnvironmentsPage [Environment ], err error ) {
233
234
var raw * http.Response
234
- opts = append (r .Options [:] , opts ... )
235
+ opts = slices . Concat (r .Options , opts )
235
236
opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
236
237
path := "gitpod.v1.EnvironmentService/ListEnvironments"
237
238
cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodPost , path , params , & res , opts ... )
@@ -312,7 +313,7 @@ func (r *EnvironmentService) ListAutoPaging(ctx context.Context, params Environm
312
313
// force: true
313
314
// ```
314
315
func (r * EnvironmentService ) Delete (ctx context.Context , body EnvironmentDeleteParams , opts ... option.RequestOption ) (res * EnvironmentDeleteResponse , err error ) {
315
- opts = append (r .Options [:] , opts ... )
316
+ opts = slices . Concat (r .Options , opts )
316
317
path := "gitpod.v1.EnvironmentService/DeleteEnvironment"
317
318
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
318
319
return
@@ -333,7 +334,7 @@ func (r *EnvironmentService) Delete(ctx context.Context, body EnvironmentDeleteP
333
334
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
334
335
// ```
335
336
func (r * EnvironmentService ) NewEnvironmentToken (ctx context.Context , body EnvironmentNewEnvironmentTokenParams , opts ... option.RequestOption ) (res * EnvironmentNewEnvironmentTokenResponse , err error ) {
336
- opts = append (r .Options [:] , opts ... )
337
+ opts = slices . Concat (r .Options , opts )
337
338
path := "gitpod.v1.EnvironmentService/CreateEnvironmentAccessToken"
338
339
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
339
340
return
@@ -370,7 +371,7 @@ func (r *EnvironmentService) NewEnvironmentToken(ctx context.Context, body Envir
370
371
// disconnected: "14400s" # 4 hours in seconds
371
372
// ```
372
373
func (r * EnvironmentService ) NewFromProject (ctx context.Context , body EnvironmentNewFromProjectParams , opts ... option.RequestOption ) (res * EnvironmentNewFromProjectResponse , err error ) {
373
- opts = append (r .Options [:] , opts ... )
374
+ opts = slices . Concat (r .Options , opts )
374
375
path := "gitpod.v1.EnvironmentService/CreateEnvironmentFromProject"
375
376
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
376
377
return
@@ -391,7 +392,7 @@ func (r *EnvironmentService) NewFromProject(ctx context.Context, body Environmen
391
392
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
392
393
// ```
393
394
func (r * EnvironmentService ) NewLogsToken (ctx context.Context , body EnvironmentNewLogsTokenParams , opts ... option.RequestOption ) (res * EnvironmentNewLogsTokenResponse , err error ) {
394
- opts = append (r .Options [:] , opts ... )
395
+ opts = slices . Concat (r .Options , opts )
395
396
path := "gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken"
396
397
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
397
398
return
@@ -415,7 +416,7 @@ func (r *EnvironmentService) NewLogsToken(ctx context.Context, body EnvironmentN
415
416
// timestamp: "2025-02-12T14:30:00Z"
416
417
// ```
417
418
func (r * EnvironmentService ) MarkActive (ctx context.Context , body EnvironmentMarkActiveParams , opts ... option.RequestOption ) (res * EnvironmentMarkActiveResponse , err error ) {
418
- opts = append (r .Options [:] , opts ... )
419
+ opts = slices . Concat (r .Options , opts )
419
420
path := "gitpod.v1.EnvironmentService/MarkEnvironmentActive"
420
421
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
421
422
return
@@ -437,7 +438,7 @@ func (r *EnvironmentService) MarkActive(ctx context.Context, body EnvironmentMar
437
438
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
438
439
// ```
439
440
func (r * EnvironmentService ) Start (ctx context.Context , body EnvironmentStartParams , opts ... option.RequestOption ) (res * EnvironmentStartResponse , err error ) {
440
- opts = append (r .Options [:] , opts ... )
441
+ opts = slices . Concat (r .Options , opts )
441
442
path := "gitpod.v1.EnvironmentService/StartEnvironment"
442
443
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
443
444
return
@@ -458,7 +459,7 @@ func (r *EnvironmentService) Start(ctx context.Context, body EnvironmentStartPar
458
459
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
459
460
// ```
460
461
func (r * EnvironmentService ) Stop (ctx context.Context , body EnvironmentStopParams , opts ... option.RequestOption ) (res * EnvironmentStopResponse , err error ) {
461
- opts = append (r .Options [:] , opts ... )
462
+ opts = slices . Concat (r .Options , opts )
462
463
path := "gitpod.v1.EnvironmentService/StopEnvironment"
463
464
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
464
465
return
@@ -474,7 +475,7 @@ func (r *EnvironmentService) Stop(ctx context.Context, body EnvironmentStopParam
474
475
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
475
476
// ```
476
477
func (r * EnvironmentService ) Unarchive (ctx context.Context , body EnvironmentUnarchiveParams , opts ... option.RequestOption ) (res * EnvironmentUnarchiveResponse , err error ) {
477
- opts = append (r .Options [:] , opts ... )
478
+ opts = slices . Concat (r .Options , opts )
478
479
path := "gitpod.v1.EnvironmentService/UnarchiveEnvironment"
479
480
err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
480
481
return
0 commit comments