@@ -102,46 +102,46 @@ type BrowserPoolsCreateInput struct {
102102}
103103
104104func (c BrowserPoolsCmd ) Create (ctx context.Context , in BrowserPoolsCreateInput ) error {
105- params := kernel.BrowserPoolNewParams {
105+ req := kernel.BrowserPoolRequestParam {
106106 Size : in .Size ,
107107 }
108108
109109 if in .Name != "" {
110- params .Name = kernel .String (in .Name )
110+ req .Name = kernel .String (in .Name )
111111 }
112112 if in .FillRate > 0 {
113- params .FillRatePerMinute = kernel .Int (in .FillRate )
113+ req .FillRatePerMinute = kernel .Int (in .FillRate )
114114 }
115115 if in .TimeoutSeconds > 0 {
116- params .TimeoutSeconds = kernel .Int (in .TimeoutSeconds )
116+ req .TimeoutSeconds = kernel .Int (in .TimeoutSeconds )
117117 }
118118 if in .Stealth .Set {
119- params .Stealth = kernel .Bool (in .Stealth .Value )
119+ req .Stealth = kernel .Bool (in .Stealth .Value )
120120 }
121121 if in .Headless .Set {
122- params .Headless = kernel .Bool (in .Headless .Value )
122+ req .Headless = kernel .Bool (in .Headless .Value )
123123 }
124124 if in .Kiosk .Set {
125- params .KioskMode = kernel .Bool (in .Kiosk .Value )
125+ req .KioskMode = kernel .Bool (in .Kiosk .Value )
126126 }
127127
128128 // Profile
129129 if in .ProfileID != "" && in .ProfileName != "" {
130130 pterm .Error .Println ("must specify at most one of --profile-id or --profile-name" )
131131 return nil
132132 } else if in .ProfileID != "" || in .ProfileName != "" {
133- params .Profile = kernel.BrowserPoolNewParamsProfile {
133+ req .Profile = kernel.BrowserProfileParam {
134134 SaveChanges : kernel .Bool (in .ProfileSaveChanges .Value ),
135135 }
136136 if in .ProfileID != "" {
137- params .Profile .ID = kernel .String (in .ProfileID )
137+ req .Profile .ID = kernel .String (in .ProfileID )
138138 } else if in .ProfileName != "" {
139- params .Profile .Name = kernel .String (in .ProfileName )
139+ req .Profile .Name = kernel .String (in .ProfileName )
140140 }
141141 }
142142
143143 if in .ProxyID != "" {
144- params .ProxyID = kernel .String (in .ProxyID )
144+ req .ProxyID = kernel .String (in .ProxyID )
145145 }
146146
147147 // Extensions
@@ -151,13 +151,13 @@ func (c BrowserPoolsCmd) Create(ctx context.Context, in BrowserPoolsCreateInput)
151151 if val == "" {
152152 continue
153153 }
154- item := kernel.BrowserPoolNewParamsExtension {}
154+ item := kernel.BrowserExtensionParam {}
155155 if cuidRegex .MatchString (val ) {
156156 item .ID = kernel .String (val )
157157 } else {
158158 item .Name = kernel .String (val )
159159 }
160- params .Extensions = append (params .Extensions , item )
160+ req .Extensions = append (req .Extensions , item )
161161 }
162162 }
163163
@@ -168,15 +168,19 @@ func (c BrowserPoolsCmd) Create(ctx context.Context, in BrowserPoolsCreateInput)
168168 pterm .Error .Printf ("Invalid viewport format: %v\n " , err )
169169 return nil
170170 }
171- params .Viewport = kernel.BrowserPoolNewParamsViewport {
171+ req .Viewport = kernel.BrowserViewportParam {
172172 Width : width ,
173173 Height : height ,
174174 }
175175 if refreshRate > 0 {
176- params .Viewport .RefreshRate = kernel .Int (refreshRate )
176+ req .Viewport .RefreshRate = kernel .Int (refreshRate )
177177 }
178178 }
179179
180+ params := kernel.BrowserPoolNewParams {
181+ BrowserPoolRequest : req ,
182+ }
183+
180184 pool , err := c .client .New (ctx , params )
181185 if err != nil {
182186 return util.CleanedUpSdkError {Err : err }
@@ -252,50 +256,50 @@ type BrowserPoolsUpdateInput struct {
252256}
253257
254258func (c BrowserPoolsCmd ) Update (ctx context.Context , in BrowserPoolsUpdateInput ) error {
255- params := kernel.BrowserPoolUpdateParams {}
259+ req := kernel.BrowserPoolUpdateRequestParam {}
256260
257261 if in .Name != "" {
258- params .Name = kernel .String (in .Name )
262+ req .Name = kernel .String (in .Name )
259263 }
260264 if in .Size > 0 {
261- params .Size = in .Size
265+ req .Size = in .Size
262266 }
263267 if in .FillRate > 0 {
264- params .FillRatePerMinute = kernel .Int (in .FillRate )
268+ req .FillRatePerMinute = kernel .Int (in .FillRate )
265269 }
266270 if in .TimeoutSeconds > 0 {
267- params .TimeoutSeconds = kernel .Int (in .TimeoutSeconds )
271+ req .TimeoutSeconds = kernel .Int (in .TimeoutSeconds )
268272 }
269273 if in .Stealth .Set {
270- params .Stealth = kernel .Bool (in .Stealth .Value )
274+ req .Stealth = kernel .Bool (in .Stealth .Value )
271275 }
272276 if in .Headless .Set {
273- params .Headless = kernel .Bool (in .Headless .Value )
277+ req .Headless = kernel .Bool (in .Headless .Value )
274278 }
275279 if in .Kiosk .Set {
276- params .KioskMode = kernel .Bool (in .Kiosk .Value )
280+ req .KioskMode = kernel .Bool (in .Kiosk .Value )
277281 }
278282 if in .DiscardAllIdle .Set {
279- params .DiscardAllIdle = kernel .Bool (in .DiscardAllIdle .Value )
283+ req .DiscardAllIdle = kernel .Bool (in .DiscardAllIdle .Value )
280284 }
281285
282286 // Profile
283287 if in .ProfileID != "" && in .ProfileName != "" {
284288 pterm .Error .Println ("must specify at most one of --profile-id or --profile-name" )
285289 return nil
286290 } else if in .ProfileID != "" || in .ProfileName != "" {
287- params .Profile = kernel.BrowserPoolUpdateParamsProfile {
291+ req .Profile = kernel.BrowserProfileParam {
288292 SaveChanges : kernel .Bool (in .ProfileSaveChanges .Value ),
289293 }
290294 if in .ProfileID != "" {
291- params .Profile .ID = kernel .String (in .ProfileID )
295+ req .Profile .ID = kernel .String (in .ProfileID )
292296 } else if in .ProfileName != "" {
293- params .Profile .Name = kernel .String (in .ProfileName )
297+ req .Profile .Name = kernel .String (in .ProfileName )
294298 }
295299 }
296300
297301 if in .ProxyID != "" {
298- params .ProxyID = kernel .String (in .ProxyID )
302+ req .ProxyID = kernel .String (in .ProxyID )
299303 }
300304
301305 // Extensions
@@ -305,13 +309,13 @@ func (c BrowserPoolsCmd) Update(ctx context.Context, in BrowserPoolsUpdateInput)
305309 if val == "" {
306310 continue
307311 }
308- item := kernel.BrowserPoolUpdateParamsExtension {}
312+ item := kernel.BrowserExtensionParam {}
309313 if cuidRegex .MatchString (val ) {
310314 item .ID = kernel .String (val )
311315 } else {
312316 item .Name = kernel .String (val )
313317 }
314- params .Extensions = append (params .Extensions , item )
318+ req .Extensions = append (req .Extensions , item )
315319 }
316320 }
317321
@@ -322,15 +326,19 @@ func (c BrowserPoolsCmd) Update(ctx context.Context, in BrowserPoolsUpdateInput)
322326 pterm .Error .Printf ("Invalid viewport format: %v\n " , err )
323327 return nil
324328 }
325- params .Viewport = kernel.BrowserPoolUpdateParamsViewport {
329+ req .Viewport = kernel.BrowserViewportParam {
326330 Width : width ,
327331 Height : height ,
328332 }
329333 if refreshRate > 0 {
330- params .Viewport .RefreshRate = kernel .Int (refreshRate )
334+ req .Viewport .RefreshRate = kernel .Int (refreshRate )
331335 }
332336 }
333337
338+ params := kernel.BrowserPoolUpdateParams {
339+ BrowserPoolUpdateRequest : req ,
340+ }
341+
334342 pool , err := c .client .Update (ctx , in .IDOrName , params )
335343 if err != nil {
336344 return util.CleanedUpSdkError {Err : err }
@@ -367,9 +375,12 @@ type BrowserPoolsAcquireInput struct {
367375}
368376
369377func (c BrowserPoolsCmd ) Acquire (ctx context.Context , in BrowserPoolsAcquireInput ) error {
370- params := kernel.BrowserPoolAcquireParams {}
378+ req := kernel.BrowserPoolAcquireRequestParam {}
371379 if in .TimeoutSeconds > 0 {
372- params .AcquireTimeoutSeconds = kernel .Int (in .TimeoutSeconds )
380+ req .AcquireTimeoutSeconds = kernel .Int (in .TimeoutSeconds )
381+ }
382+ params := kernel.BrowserPoolAcquireParams {
383+ BrowserPoolAcquireRequest : req ,
373384 }
374385 resp , err := c .client .Acquire (ctx , in .IDOrName , params )
375386 if err != nil {
@@ -397,11 +408,14 @@ type BrowserPoolsReleaseInput struct {
397408}
398409
399410func (c BrowserPoolsCmd ) Release (ctx context.Context , in BrowserPoolsReleaseInput ) error {
400- params := kernel.BrowserPoolReleaseParams {
401- SessionID : kernel . String ( in .SessionID ) ,
411+ req := kernel.BrowserPoolReleaseRequestParam {
412+ SessionID : in .SessionID ,
402413 }
403414 if in .Reuse .Set {
404- params .Reuse = kernel .Bool (in .Reuse .Value )
415+ req .Reuse = kernel .Bool (in .Reuse .Value )
416+ }
417+ params := kernel.BrowserPoolReleaseParams {
418+ BrowserPoolReleaseRequest : req ,
405419 }
406420 err := c .client .Release (ctx , in .IDOrName , params )
407421 if err != nil {
0 commit comments