@@ -43,16 +43,21 @@ func (p *PipelineService) List(ctx context.Context, scope dto.Scope, opts *dto.P
43
43
params := make (map [string ]string )
44
44
addScope (scope , params )
45
45
46
- // Set default pagination and add pagination parameters if opts is provided
47
- if opts != nil {
48
- setDefaultPagination (& opts .PaginationOptions )
49
- params ["page" ] = fmt .Sprintf ("%d" , opts .Page )
50
- params ["size" ] = fmt .Sprintf ("%d" , opts .Size )
46
+ // Handle nil options by creating default options
47
+ if opts == nil {
48
+ opts = & dto.PipelineListOptions {}
49
+ }
51
50
52
- // Add optional parameters if provided
53
- if opts .SearchTerm != "" {
54
- params ["searchTerm" ] = opts .SearchTerm
55
- }
51
+ // Set default pagination
52
+ setDefaultPagination (& opts .PaginationOptions )
53
+
54
+ // Add pagination parameters
55
+ params ["page" ] = fmt .Sprintf ("%d" , opts .Page )
56
+ params ["size" ] = fmt .Sprintf ("%d" , opts .Size )
57
+
58
+ // Add optional parameters if provided
59
+ if opts .SearchTerm != "" {
60
+ params ["searchTerm" ] = opts .SearchTerm
56
61
}
57
62
58
63
// Create request body - this is required
@@ -73,13 +78,18 @@ func (p *PipelineService) List(ctx context.Context, scope dto.Scope, opts *dto.P
73
78
}
74
79
75
80
func (p * PipelineService ) ListExecutions (ctx context.Context , scope dto.Scope , opts * dto.PipelineExecutionOptions ) (* dto.ListOutput [dto.PipelineExecution ], error ) {
76
- // Set default pagination
77
- setDefaultPagination (& opts .PaginationOptions )
78
-
79
81
// Prepare query parameters
80
82
params := make (map [string ]string )
81
83
addScope (scope , params )
82
84
85
+ // Handle nil options by creating default options
86
+ if opts == nil {
87
+ opts = & dto.PipelineExecutionOptions {}
88
+ }
89
+
90
+ // Set default pagination
91
+ setDefaultPagination (& opts .PaginationOptions )
92
+
83
93
// Add pagination parameters
84
94
params ["page" ] = fmt .Sprintf ("%d" , opts .Page )
85
95
params ["size" ] = fmt .Sprintf ("%d" , opts .Size )
0 commit comments