@@ -330,42 +330,42 @@ func (c *Client) GetWorkspace(ctx context.Context, workspaceUUID string) (Worksp
330
330
}
331
331
332
332
// GetEnvironmentVariables returns the environment variables for a given environment
333
- func (c * Client ) GetEnvironmentVariables (ctx context.Context , environment_uuid string ) (VariableData , error ) {
333
+ func (c * Client ) GetEnvironmentVariables (ctx context.Context , environmentUid string ) (VariableData , error ) {
334
334
obj := struct {
335
335
VariableData VariableData `json:"environment"`
336
336
}{}
337
337
338
- url := fmt .Sprintf (ENVIRONMENTS_URL , environment_uuid )
338
+ url := fmt .Sprintf (ENVIRONMENTS_URL , environmentUid )
339
339
if err := c .GeneralRateLimiter .Wait (ctx ); err != nil {
340
340
return VariableData {}, fmt .Errorf ("could not wait for rate limiter during environment variable getting: %w" , err )
341
341
}
342
342
body , err := c .getPostmanResponseBodyBytes (ctx , url , nil )
343
343
if err != nil {
344
- return VariableData {}, fmt .Errorf ("could not get postman environment (%s) response bytes: %w" , environment_uuid , err )
344
+ return VariableData {}, fmt .Errorf ("could not get postman environment (%s) response bytes: %w" , environmentUid , err )
345
345
}
346
346
if err := json .Unmarshal ([]byte (body ), & obj ); err != nil {
347
- return VariableData {}, fmt .Errorf ("could not unmarshal env variables JSON for environment (%s): %w" , environment_uuid , err )
347
+ return VariableData {}, fmt .Errorf ("could not unmarshal env variables JSON for environment (%s): %w" , environmentUid , err )
348
348
}
349
349
350
350
return obj .VariableData , nil
351
351
}
352
352
353
353
// GetCollection returns the collection for a given collection
354
- func (c * Client ) GetCollection (ctx context.Context , collection_uuid string ) (Collection , error ) {
354
+ func (c * Client ) GetCollection (ctx context.Context , collectionId string ) (Collection , error ) {
355
355
obj := struct {
356
356
Collection Collection `json:"collection"`
357
357
}{}
358
358
359
- url := fmt .Sprintf (COLLECTIONS_URL , collection_uuid )
359
+ url := fmt .Sprintf (COLLECTIONS_URL , collectionId )
360
360
if err := c .WorkspaceAndCollectionRateLimiter .Wait (ctx ); err != nil {
361
361
return Collection {}, fmt .Errorf ("could not wait for rate limiter during collection getting: %w" , err )
362
362
}
363
363
body , err := c .getPostmanResponseBodyBytes (ctx , url , nil )
364
364
if err != nil {
365
- return Collection {}, fmt .Errorf ("could not get postman collection (%s) response bytes: %w" , collection_uuid , err )
365
+ return Collection {}, fmt .Errorf ("could not get postman collection (%s) response bytes: %w" , collectionId , err )
366
366
}
367
367
if err := json .Unmarshal ([]byte (body ), & obj ); err != nil {
368
- return Collection {}, fmt .Errorf ("could not unmarshal JSON for collection (%s): %w" , collection_uuid , err )
368
+ return Collection {}, fmt .Errorf ("could not unmarshal JSON for collection (%s): %w" , collectionId , err )
369
369
}
370
370
371
371
// Loop used to deal with seeing whether a request/response header is a string or a key value pair
@@ -374,21 +374,21 @@ func (c *Client) GetCollection(ctx context.Context, collection_uuid string) (Col
374
374
if err := json .Unmarshal (obj .Collection .Items [i ].Request .HeaderRaw , & obj .Collection .Items [i ].Request .HeaderKeyValue ); err == nil {
375
375
} else if err := json .Unmarshal (obj .Collection .Items [i ].Request .HeaderRaw , & obj .Collection .Items [i ].Request .HeaderString ); err == nil {
376
376
} else {
377
- return Collection {}, fmt .Errorf ("could not unmarshal request header JSON for collection (%s): %w" , collection_uuid , err )
377
+ return Collection {}, fmt .Errorf ("could not unmarshal request header JSON for collection (%s): %w" , collectionId , err )
378
378
}
379
379
}
380
380
381
381
for j := range obj .Collection .Items [i ].Response {
382
382
if err := json .Unmarshal (obj .Collection .Items [i ].Response [j ].OriginalRequest .HeaderRaw , & obj .Collection .Items [i ].Response [j ].OriginalRequest .HeaderKeyValue ); err == nil {
383
383
} else if err := json .Unmarshal (obj .Collection .Items [i ].Response [j ].OriginalRequest .HeaderRaw , & obj .Collection .Items [i ].Response [j ].OriginalRequest .HeaderString ); err == nil {
384
384
} else {
385
- return Collection {}, fmt .Errorf ("could not unmarshal original request header in response JSON for collection (%s): %w" , collection_uuid , err )
385
+ return Collection {}, fmt .Errorf ("could not unmarshal original request header in response JSON for collection (%s): %w" , collectionId , err )
386
386
}
387
387
388
388
if err := json .Unmarshal (obj .Collection .Items [i ].Response [j ].HeaderRaw , & obj .Collection .Items [i ].Response [j ].HeaderKeyValue ); err == nil {
389
389
} else if err := json .Unmarshal (obj .Collection .Items [i ].Response [j ].HeaderRaw , & obj .Collection .Items [i ].Response [j ].HeaderString ); err == nil {
390
390
} else {
391
- return Collection {}, fmt .Errorf ("could not unmarshal response header JSON for collection (%s): %w" , collection_uuid , err )
391
+ return Collection {}, fmt .Errorf ("could not unmarshal response header JSON for collection (%s): %w" , collectionId , err )
392
392
}
393
393
}
394
394
}
0 commit comments