66 "context"
77 "net/http"
88 "net/url"
9+ "slices"
910 "time"
1011
1112 "github.com/gitpod-io/gitpod-sdk-go/internal/apijson"
@@ -102,7 +103,7 @@ func NewEnvironmentService(opts ...option.RequestOption) (r *EnvironmentService)
102103// name: "Web App"
103104// ```
104105func (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 )
106107 path := "gitpod.v1.EnvironmentService/CreateEnvironment"
107108 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
108109 return
@@ -129,7 +130,7 @@ func (r *EnvironmentService) New(ctx context.Context, body EnvironmentNewParams,
129130// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
130131// ```
131132func (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 )
133134 path := "gitpod.v1.EnvironmentService/GetEnvironment"
134135 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
135136 return
@@ -186,7 +187,7 @@ func (r *EnvironmentService) Get(ctx context.Context, body EnvironmentGetParams,
186187// Note: Machine class changes require stopping the environment and creating a new
187188// one.
188189func (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 )
190191 path := "gitpod.v1.EnvironmentService/UpdateEnvironment"
191192 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
192193 return
@@ -231,7 +232,7 @@ func (r *EnvironmentService) Update(ctx context.Context, body EnvironmentUpdateP
231232// ```
232233func (r * EnvironmentService ) List (ctx context.Context , params EnvironmentListParams , opts ... option.RequestOption ) (res * pagination.EnvironmentsPage [Environment ], err error ) {
233234 var raw * http.Response
234- opts = append (r .Options [:] , opts ... )
235+ opts = slices . Concat (r .Options , opts )
235236 opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
236237 path := "gitpod.v1.EnvironmentService/ListEnvironments"
237238 cfg , err := requestconfig .NewRequestConfig (ctx , http .MethodPost , path , params , & res , opts ... )
@@ -312,7 +313,7 @@ func (r *EnvironmentService) ListAutoPaging(ctx context.Context, params Environm
312313// force: true
313314// ```
314315func (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 )
316317 path := "gitpod.v1.EnvironmentService/DeleteEnvironment"
317318 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
318319 return
@@ -333,7 +334,7 @@ func (r *EnvironmentService) Delete(ctx context.Context, body EnvironmentDeleteP
333334// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
334335// ```
335336func (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 )
337338 path := "gitpod.v1.EnvironmentService/CreateEnvironmentAccessToken"
338339 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
339340 return
@@ -370,7 +371,7 @@ func (r *EnvironmentService) NewEnvironmentToken(ctx context.Context, body Envir
370371// disconnected: "14400s" # 4 hours in seconds
371372// ```
372373func (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 )
374375 path := "gitpod.v1.EnvironmentService/CreateEnvironmentFromProject"
375376 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
376377 return
@@ -391,7 +392,7 @@ func (r *EnvironmentService) NewFromProject(ctx context.Context, body Environmen
391392// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
392393// ```
393394func (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 )
395396 path := "gitpod.v1.EnvironmentService/CreateEnvironmentLogsToken"
396397 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
397398 return
@@ -415,7 +416,7 @@ func (r *EnvironmentService) NewLogsToken(ctx context.Context, body EnvironmentN
415416// timestamp: "2025-02-12T14:30:00Z"
416417// ```
417418func (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 )
419420 path := "gitpod.v1.EnvironmentService/MarkEnvironmentActive"
420421 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
421422 return
@@ -437,7 +438,7 @@ func (r *EnvironmentService) MarkActive(ctx context.Context, body EnvironmentMar
437438// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
438439// ```
439440func (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 )
441442 path := "gitpod.v1.EnvironmentService/StartEnvironment"
442443 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
443444 return
@@ -458,7 +459,7 @@ func (r *EnvironmentService) Start(ctx context.Context, body EnvironmentStartPar
458459// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
459460// ```
460461func (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 )
462463 path := "gitpod.v1.EnvironmentService/StopEnvironment"
463464 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
464465 return
@@ -474,7 +475,7 @@ func (r *EnvironmentService) Stop(ctx context.Context, body EnvironmentStopParam
474475// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
475476// ```
476477func (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 )
478479 path := "gitpod.v1.EnvironmentService/UnarchiveEnvironment"
479480 err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , body , & res , opts ... )
480481 return
0 commit comments