8
8
"fmt"
9
9
"net/http"
10
10
"net/url"
11
+ "slices"
11
12
12
13
"github.com/stainless-api/stainless-api-go/internal/apijson"
13
14
"github.com/stainless-api/stainless-api-go/internal/apiquery"
@@ -43,7 +44,7 @@ func NewProjectBranchService(opts ...option.RequestOption) (r ProjectBranchServi
43
44
// `branch_from` parameter. In addition, if the revision is a branch name, the
44
45
// branch will also inherit custom code changes from that branch.
45
46
func (r * ProjectBranchService ) New (ctx context.Context , params ProjectBranchNewParams , opts ... option.RequestOption ) (res * ProjectBranch , err error ) {
46
- opts = append (r .Options [:] , opts ... )
47
+ opts = slices . Concat (r .Options , opts )
47
48
precfg , err := requestconfig .PreRequestOptions (opts ... )
48
49
if err != nil {
49
50
return
@@ -60,7 +61,7 @@ func (r *ProjectBranchService) New(ctx context.Context, params ProjectBranchNewP
60
61
61
62
// Retrieve a project branch by name.
62
63
func (r * ProjectBranchService ) Get (ctx context.Context , branch string , query ProjectBranchGetParams , opts ... option.RequestOption ) (res * ProjectBranch , err error ) {
63
- opts = append (r .Options [:] , opts ... )
64
+ opts = slices . Concat (r .Options , opts )
64
65
precfg , err := requestconfig .PreRequestOptions (opts ... )
65
66
if err != nil {
66
67
return
@@ -82,7 +83,7 @@ func (r *ProjectBranchService) Get(ctx context.Context, branch string, query Pro
82
83
// Retrieve a project branch by name.
83
84
func (r * ProjectBranchService ) List (ctx context.Context , params ProjectBranchListParams , opts ... option.RequestOption ) (res * pagination.Page [ProjectBranchListResponse ], err error ) {
84
85
var raw * http.Response
85
- opts = append (r .Options [:] , opts ... )
86
+ opts = slices . Concat (r .Options , opts )
86
87
opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
87
88
precfg , err := requestconfig .PreRequestOptions (opts ... )
88
89
if err != nil {
@@ -113,7 +114,7 @@ func (r *ProjectBranchService) ListAutoPaging(ctx context.Context, params Projec
113
114
114
115
// Delete a project branch by name.
115
116
func (r * ProjectBranchService ) Delete (ctx context.Context , branch string , body ProjectBranchDeleteParams , opts ... option.RequestOption ) (res * ProjectBranchDeleteResponse , err error ) {
116
- opts = append (r .Options [:] , opts ... )
117
+ opts = slices . Concat (r .Options , opts )
117
118
precfg , err := requestconfig .PreRequestOptions (opts ... )
118
119
if err != nil {
119
120
return
@@ -137,7 +138,7 @@ func (r *ProjectBranchService) Delete(ctx context.Context, branch string, body P
137
138
// The branch is rebased onto the `base` branch or commit SHA, inheriting any
138
139
// config and custom code changes.
139
140
func (r * ProjectBranchService ) Rebase (ctx context.Context , branch string , params ProjectBranchRebaseParams , opts ... option.RequestOption ) (res * ProjectBranch , err error ) {
140
- opts = append (r .Options [:] , opts ... )
141
+ opts = slices . Concat (r .Options , opts )
141
142
precfg , err := requestconfig .PreRequestOptions (opts ... )
142
143
if err != nil {
143
144
return
0 commit comments