@scaleway/sdk-environmental-footprint 2.2.0 → 2.4.0

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,7 +16,10 @@ class UserAPI extends API {
16
16
  path: `/environmental-footprint/v1alpha1/reports/availability`,
17
17
  urlParams: urlParams(
18
18
  ["end_date", request.endDate],
19
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
19
+ [
20
+ "organization_id",
21
+ request.organizationId ?? this.client.settings.defaultOrganizationId
22
+ ],
20
23
  ["start_date", request.startDate]
21
24
  )
22
25
  },
@@ -28,23 +31,27 @@ class UserAPI extends API {
28
31
  * @param request - The request {@link UserApiDownloadImpactReportRequest}
29
32
  * @returns A Promise of Blob
30
33
  */
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
- );
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
+ });
48
55
  /**
49
56
  * 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.
50
57
  *
@@ -57,7 +64,10 @@ class UserAPI extends API {
57
64
  path: `/environmental-footprint/v1alpha1/data/query`,
58
65
  urlParams: urlParams(
59
66
  ["end_date", request.endDate],
60
- ["organization_id", request.organizationId ?? this.client.settings.defaultOrganizationId],
67
+ [
68
+ "organization_id",
69
+ request.organizationId ?? this.client.settings.defaultOrganizationId
70
+ ],
61
71
  ["product_categories", request.productCategories],
62
72
  ["project_ids", request.projectIds],
63
73
  ["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,7 +79,14 @@ const unmarshalImpactReportAvailability = (data) => {
79
79
  );
80
80
  }
81
81
  return {
82
- monthSummaryReports: unmarshalArrayOfObject(data.month_summary_reports, unmarshalDate)
82
+ monthSummaryReports: unmarshalArrayOfObject(
83
+ data.month_summary_reports,
84
+ unmarshalDate
85
+ ),
86
+ yearlySummaryReports: unmarshalArrayOfObject(
87
+ data.yearly_summary_reports,
88
+ unmarshalDate
89
+ )
83
90
  };
84
91
  };
85
92
  const marshalUserApiDownloadImpactReportRequest = (request, defaults) => ({
@@ -95,6 +95,10 @@ export interface ImpactReportAvailability {
95
95
  * The list of calendar months for which impact reports are available.
96
96
  */
97
97
  monthSummaryReports: Date[];
98
+ /**
99
+ * The list of calendar years for which impact reports are available.
100
+ */
101
+ yearlySummaryReports: Date[];
98
102
  }
99
103
  export type UserApiDownloadImpactReportRequest = {
100
104
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-environmental-footprint",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Scaleway SDK environmental-footprint",
5
5
  "license": "Apache-2.0",
6
6
  "files": [