@scaleway/sdk-environmental-footprint 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,10 +16,7 @@ class UserAPI extends API {
16
16
  path: `/environmental-footprint/v1alpha1/reports/availability`,
17
17
  urlParams: urlParams(
18
18
  ["end_date", request.endDate],
19
- [
20
- "organization_id",
21
- request.organizationId ?? this.client.settings.defaultOrganizationId
22
- ],
19
+ ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
23
20
  ["start_date", request.startDate]
24
21
  )
25
22
  },
@@ -31,27 +28,23 @@ class UserAPI extends API {
31
28
  * @param request - The request {@link UserApiDownloadImpactReportRequest}
32
29
  * @returns A Promise of Blob
33
30
  */
34
- downloadImpactReport = (request = {}) => this.client.fetch({
35
- body: JSON.stringify(
36
- marshalUserApiDownloadImpactReportRequest(
37
- request,
38
- this.client.settings
39
- )
40
- ),
41
- headers: jsonContentHeaders,
42
- method: "POST",
43
- path: `/environmental-footprint/v1alpha1/reports/download`,
44
- urlParams: urlParams(
45
- ["dl", 1],
46
- ["date", request.date],
47
- [
48
- "organization_id",
49
- request.organizationId ?? this.client.settings.defaultOrganizationId
50
- ],
51
- ["type", request.type]
52
- ),
53
- responseType: "blob"
54
- });
31
+ downloadImpactReport = (request = {}) => this.client.fetch(
32
+ {
33
+ body: JSON.stringify(
34
+ marshalUserApiDownloadImpactReportRequest(request, this.client.settings)
35
+ ),
36
+ headers: jsonContentHeaders,
37
+ method: "POST",
38
+ path: `/environmental-footprint/v1alpha1/reports/download`,
39
+ urlParams: urlParams(
40
+ ["dl", 1],
41
+ ["date", request.date],
42
+ ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
43
+ ["type", request.type]
44
+ ),
45
+ responseType: "blob"
46
+ }
47
+ );
55
48
  /**
56
49
  * Retrieve detailed impact data. Retrieve detailed impact data for your Scaleway projects within a specified date range. Filter by project ID, region, zone, service category, and/or product category.
57
50
  *
@@ -64,10 +57,7 @@ class UserAPI extends API {
64
57
  path: `/environmental-footprint/v1alpha1/data/query`,
65
58
  urlParams: urlParams(
66
59
  ["end_date", request.endDate],
67
- [
68
- "organization_id",
69
- request.organizationId ?? this.client.settings.defaultOrganizationId
70
- ],
60
+ ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
71
61
  ["product_categories", request.productCategories],
72
62
  ["project_ids", request.projectIds],
73
63
  ["regions", request.regions],
@@ -1,3 +1,3 @@
1
- export { UserAPI } from './api.gen.js';
1
+ export { UserAPI, } from './api.gen.js';
2
2
  export * from './marshalling.gen.js';
3
3
  export type { Impact, ImpactDataResponse, ImpactReportAvailability, ProductCategory, ProjectImpact, RegionImpact, ReportType, ServiceCategory, SkuImpact, UserApiDownloadImpactReportRequest, UserApiGetImpactDataRequest, UserApiGetImpactReportAvailabilityRequest, ZoneImpact, } from './types.gen.js';
@@ -79,14 +79,8 @@ const unmarshalImpactReportAvailability = (data) => {
79
79
  );
80
80
  }
81
81
  return {
82
- monthSummaryReports: unmarshalArrayOfObject(
83
- data.month_summary_reports,
84
- unmarshalDate
85
- ),
86
- yearlySummaryReports: unmarshalArrayOfObject(
87
- data.yearly_summary_reports,
88
- unmarshalDate
89
- )
82
+ monthSummaryReports: unmarshalArrayOfObject(data.month_summary_reports, unmarshalDate),
83
+ yearlySummaryReports: unmarshalArrayOfObject(data.yearly_summary_reports, unmarshalDate)
90
84
  };
91
85
  };
92
86
  const marshalUserApiDownloadImpactReportRequest = (request, defaults) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-environmental-footprint",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Scaleway SDK environmental-footprint",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@scaleway/random-name": "5.1.2",
30
- "@scaleway/sdk-std": "2.1.0"
30
+ "@scaleway/sdk-std": "2.1.1"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@scaleway/sdk-client": "^2.1.0"