@@ -242,3 +242,59 @@ func TestOrganizations_ListClusterSKUsWithRates(t *testing.T) {
242
242
243
243
c .Assert (orgs , qt .DeepEquals , want )
244
244
}
245
+
246
+ func TestOrganizations_ListClusterSKUsWithPostgreSQL (t * testing.T ) {
247
+ c := qt .New (t )
248
+
249
+ ts := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
250
+ w .WriteHeader (200 )
251
+
252
+ c .Assert (r .URL .String (), qt .Equals , "/v1/organizations/my-cool-org/cluster-size-skus?postgresql=true" )
253
+ out := `[
254
+ {
255
+ "name": "PS_10_AWS_ARM",
256
+ "type": "ClusterSizeSku",
257
+ "display_name": "PS-10-AWS-ARM",
258
+ "cpu": "1/8",
259
+ "provider_instance_type": null,
260
+ "storage": null,
261
+ "ram": 1,
262
+ "sort_order": 1,
263
+ "enabled": true,
264
+ "provider": "aws",
265
+ "rate": 34,
266
+ "replica_rate": null,
267
+ "default_vtgate": null,
268
+ "default_vtgate_rate": null
269
+ }
270
+ ]`
271
+
272
+ _ , err := w .Write ([]byte (out ))
273
+ c .Assert (err , qt .IsNil )
274
+ }))
275
+
276
+ client , err := NewClient (WithBaseURL (ts .URL ))
277
+ c .Assert (err , qt .IsNil )
278
+
279
+ ctx := context .Background ()
280
+
281
+ orgs , err := client .Organizations .ListClusterSKUs (ctx , & ListOrganizationClusterSKUsRequest {
282
+ Organization : "my-cool-org" ,
283
+ }, WithPostgreSQL ())
284
+
285
+ c .Assert (err , qt .IsNil )
286
+ want := []* ClusterSKU {
287
+ {
288
+ Name : "PS_10_AWS_ARM" ,
289
+ DisplayName : "PS-10-AWS-ARM" ,
290
+ CPU : "1/8" ,
291
+ Memory : 1 ,
292
+ Enabled : true ,
293
+ Provider : Pointer ("aws" ),
294
+ Rate : Pointer [int64 ](34 ),
295
+ SortOrder : 1 ,
296
+ },
297
+ }
298
+
299
+ c .Assert (orgs , qt .DeepEquals , want )
300
+ }
0 commit comments