Skip to content

Commit d69268a

Browse files
Merge pull request #147 from autodesk-platform-services/development
Keep Main branch updated with Development
2 parents 062ffb7 + 91788ac commit d69268a

17 files changed

Lines changed: 880 additions & 78 deletions

‎construction/accountadmin/source/api/accountUsersApi.ts‎

Lines changed: 381 additions & 0 deletions
Large diffs are not rendered by default.

‎construction/accountadmin/source/custom-code/adminClient.ts‎

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ApsServiceRequestConfig, BaseClient, IAuthenticationProvider, SdkManager, SdkManagerBuilder } from "@aps_sdk/autodesk-sdkmanager";
22
import { CompaniesApi, ProjectsApi, ProjectUsersApi, AccountUsersApi, BusinessUnitsApi, UserProjectsApi } from "../api";
3-
import { AccessLevels, BusinessUnitsPayload, BusinessUnits, Classification, Company, CompanyImport, CompanyPatchPayload, CompanyPayload, ProjectCompanies, Fields, FilterTextMatch, OrFilters, Platform, Products, Project, ProjectPatch, ProjectPayload, ProjectUser, ProjectUserPayload, ProjectUserDetails, ProjectUsersPage, ProjectUsersImportPayload, ProjectUsersImport, ProjectUsersUpdatePayload, ProjectsPage, Region, SortBy, Status, StatusFilter, User, UserFields, UserImport, UserPatchPayload, UserPayload, UserSortBy, UserProjectFields, FilterUserProjectsAccessLevels, UserProjectSortBy, CompanyOrFilters, FilterCompanySort, FilterCompanyFields, CompaniesPage } from "../model";
3+
import { AccessLevels, BusinessUnitsPayload, BusinessUnits, Classification, Company, CompanyImport, CompanyPatchPayload, CompanyPayload, ProjectCompanies, Fields, FilterTextMatch, OrFilters, Platform, Products, Project, ProjectPatch, ProjectPayload, ProjectUser, ProjectUserPayload, ProjectUserDetails, ProjectUsersPage, ProjectUsersImportPayload, ProjectUsersImport, ProjectUsersUpdatePayload, ProjectsPage, Region, SortBy, Status, StatusFilter, User, UserFields, UserImport, UserPatchPayload, UserPayload, UserSortBy, UserProjectFields, FilterUserProjectsAccessLevels, UserProjectSortBy, CompanyOrFilters, FilterCompanySort, FilterCompanyFields, CompaniesPage, ProductsPage, RolesPage, FilterProductKey, FilterProductField, FilterProductSort, FilterRoleStatus, FilterRoleField, FilterRoleSort } from "../model";
44

55
export class AdminClient extends BaseClient {
66
public companiesApi: CompaniesApi;
@@ -646,7 +646,7 @@ export class AdminClient extends BaseClient {
646646
* @param {string} [companyName] User company to match Max length: 255
647647
* @param {string} [operator] Boolean operator to use: OR (default) or AND
648648
* @param {boolean} [partial] If true (default), perform a fuzzy match
649-
* @param {number} [limit] Response array’s size Default value: 10 Max limit: 100
649+
* @param {number} [limit] Response array's size Default value: 10 Max limit: 100
650650
* @param {number} [offset] Offset of response array Default value: 0
651651
* @param {string} [sort] Comma-separated fields to sort by in ascending order
652652
* @param {string} [field] Comma-separated fields to include in response
@@ -666,6 +666,70 @@ export class AdminClient extends BaseClient {
666666
return response.content;
667667
}
668668

669+
/**
670+
* Returns a list of ACC products the user is associated with in their assigned projects.
671+
* Only account administrators can call this endpoint.
672+
* Note that this endpoint is compatible with both BIM 360 and Autodesk Construction Cloud (ACC) projects.
673+
* @summary Get user products
674+
* @param {string} accountId The account ID of the user.
675+
* @param {string} userId User ID
676+
* @param {Region} [region] Specifies the region where your request should be routed. If not set, the request is routed automatically, which may result in a slight increase in latency. Possible values: US, EMEA. For a complete list of supported regions, see the Regions page.
677+
* @param {string} [adminUserId] The ID of a user on whose behalf your request is acting. Your app has access to all users specified by the administrator in the SaaS integrations UI. Provide this header value to identify the user to be affected by the request. You can use either the user's ACC ID (id), or their Autodesk ID (autodeskId). Note that this header is required for Account Admin POST, PATCH, and DELETE endpoints if you want to use a 2-legged authentication context. This header is optional for Account Admin GET endpoints.
678+
* @param {Array<string>} [filterProjectId] A list of project IDs. Only results where the user is associated with one or more of the specified projects are returned.
679+
* @param {Array<FilterProductKey>} [filterKey] Filters the list of products by product key — a machine-readable identifier for an ACC product (such as docs, build, or cost). You can specify one or more keys to return only those products the user is associated with. Example: filter[key]=docs,build Possible values: accountAdministration, autoSpecs, build, buildingConnected, capitalPlanning, cloudWorksharing, cost, designCollaboration, docs, financials, insight, modelCoordination, projectAdministration, takeoff, and workshopxr.
680+
* @param {Array<FilterProductField>} [fields] List of fields to return in the response. Defaults to all fields. Possible values: projectIds, name and icon.
681+
* @param {Array<FilterProductSort>} [sort] The list of fields to sort by. Each property can be followed by a direction modifier of either asc (ascending) or desc (descending). The default is asc. Possible values: name. Default is the order in database.
682+
* @param {number} [limit] The maximum number of records to return in the response. Default: 20 Minimum: 1 Maximum: 200 (If a larger value is provided, only 200 records are returned)
683+
* @param {number} [offset] The index of the first record to return. Used for pagination in combination with the limit parameter. Example: limit=20 and offset=40 returns records 41–60.
684+
* @param accessToken bearer access token
685+
* @param {*} [options] Override http request option.
686+
* @throws {RequiredError}
687+
* @memberof AccountUsersApi
688+
*/
689+
public async getUserProducts(accountId: string, userId: string, optionalArgs?: { region?: Region, adminUserId?: string, filterProjectId?: Array<string>, filterKey?: Array<FilterProductKey>, fields?: Array<FilterProductField>, sort?: Array<FilterProductSort>, limit?: number, offset?: number, accessToken?: string, options?: ApsServiceRequestConfig }): Promise<ProductsPage> {
690+
if (!optionalArgs?.accessToken && !this.authenticationProvider) {
691+
throw new Error("Please provide a valid access token or an authentication provider");
692+
}
693+
else if (!optionalArgs?.accessToken) {
694+
(optionalArgs ??= {}).accessToken = await this.authenticationProvider.getAccessToken();
695+
}
696+
const response = await this.accountUsersApi.getUserProducts(optionalArgs?.accessToken, accountId, userId, optionalArgs?.region, optionalArgs?.adminUserId, optionalArgs?.filterProjectId, optionalArgs?.filterKey, optionalArgs?.fields, optionalArgs?.sort, optionalArgs?.limit, optionalArgs?.offset, optionalArgs?.options);
697+
return response.content;
698+
}
699+
700+
/**
701+
* Returns the roles assigned to a specific user across the projects they belong to.
702+
* Only users with account admin permissions can call this endpoint. To verify a user's permissions, call GET users.
703+
* Note that this endpoint is compatible with both BIM 360 and Autodesk Construction Cloud (ACC) projects.
704+
* @summary Get user roles
705+
* @param {string} accountId The account ID of the user.
706+
* @param {string} userId User ID
707+
* @param {Region} [region] Specifies the region where your request should be routed. If not set, the request is routed automatically, which may result in a slight increase in latency. Possible values: US, EMEA. For a complete list of supported regions, see the Regions page.
708+
* @param {string} [adminUserId] The ID of a user on whose behalf your request is acting. Your app has access to all users specified by the administrator in the SaaS integrations UI. Provide this header value to identify the user to be affected by the request. You can use either the user's ACC ID (id), or their Autodesk ID (autodeskId). Note that this header is required for Account Admin POST, PATCH, and DELETE endpoints if you want to use a 2-legged authentication context. This header is optional for Account Admin GET endpoints.
709+
* @param {Array<string>} [filterProjectId] A list of project IDs. Only results where the user is associated with one or more of the specified projects are returned.
710+
* @param {Array<FilterRoleStatus>} [filterStatus] Filters roles by their status. Accepts one or more of the following values: active – The role is currently in use. inactive – The role has been removed or is no longer in use.
711+
* @param {string} [filterName] Filters roles by name. By default, this performs a partial match (case-insensitive). You can control how the match behaves by using the filterTextMatch parameter. For example, to match only names that start with (startsWith), end with (endsWith), or exactly equal (equals) the provided value.
712+
* @param {FilterTextMatch} [filterTextMatch] Specifies how text-based filters should match values in supported fields. This parameter can be used in any endpoint that supports text-based filtering (e.g., filter[name], filter[jobNumber], filter[companyName], etc.). Possible values: contains (default) – Matches if the field contains the specified text anywhere startsWith – Matches if the field starts with the specified text endsWith – Matches if the field ends with the specified text equals – Matches only if the field exactly matches the specified text Matching is case-insensitive. Wildcards and regular expressions are not supported.
713+
* @param {Array<FilterRoleField>} [fields] A comma-separated list of response fields to include. Defaults to all fields if not specified. Use this parameter to reduce the response size by retrieving only the fields you need. Possible values: projectIds – Projects where the user holds this role name – Role name status – Role status (active or inactive) key – Internal key used to translate the role name createdAt – Timestamp when the role was created updatedAt – Timestamp when the role was last updated
714+
* @param {Array<FilterRoleSort>} [sort] Sorts the results by one or more fields. Each field can be followed by a direction modifier: asc – Ascending order (default) desc – Descending order Possible values: name, createdAt, updatedAt. Default sort: name asc Example: sort=name,updatedAt desc
715+
* @param {number} [limit] The maximum number of records to return in the response. Default: 20 Minimum: 1 Maximum: 200 (If a larger value is provided, only 200 records are returned)
716+
* @param {number} [offset] The index of the first record to return. Used for pagination in combination with the limit parameter. Example: limit=20 and offset=40 returns records 41–60.
717+
* @param accessToken bearer access token
718+
* @param {*} [options] Override http request option.
719+
* @throws {RequiredError}
720+
* @memberof AccountUsersApi
721+
*/
722+
public async getUserRoles(accountId: string, userId: string, optionalArgs?: { region?: Region, adminUserId?: string, filterProjectId?: Array<string>, filterStatus?: Array<FilterRoleStatus>, filterName?: string, filterTextMatch?: FilterTextMatch, fields?: Array<FilterRoleField>, sort?: Array<FilterRoleSort>, limit?: number, offset?: number, accessToken?: string, options?: ApsServiceRequestConfig }): Promise<RolesPage> {
723+
if (!optionalArgs?.accessToken && !this.authenticationProvider) {
724+
throw new Error("Please provide a valid access token or an authentication provider");
725+
}
726+
else if (!optionalArgs?.accessToken) {
727+
(optionalArgs ??= {}).accessToken = await this.authenticationProvider.getAccessToken();
728+
}
729+
const response = await this.accountUsersApi.getUserRoles(optionalArgs?.accessToken, accountId, userId, optionalArgs?.region, optionalArgs?.adminUserId, optionalArgs?.filterProjectId, optionalArgs?.filterStatus, optionalArgs?.filterName, optionalArgs?.filterTextMatch, optionalArgs?.fields, optionalArgs?.sort, optionalArgs?.limit, optionalArgs?.offset, optionalArgs?.options);
730+
return response.content;
731+
}
732+
669733

670734
// Business-Units API
671735

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
/**
4+
* List of fields to return in the response. Defaults to all fields.
5+
* Possible values: projectIds, name and icon.
6+
* @export
7+
* @enum {string}
8+
*/
9+
10+
export const FilterProductField = {
11+
ProjectIds: 'projectIds',
12+
Name: 'name',
13+
Icon: 'icon'
14+
} as const;
15+
16+
export type FilterProductField = typeof FilterProductField[keyof typeof FilterProductField];
17+
18+
19+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
3+
/**
4+
* Filters the list of products by product key — a machine-readable identifier for an ACC product (such as docs, build, or cost).
5+
* You can specify one or more keys to return only those products the user is associated with.
6+
*
7+
* Example: filter[key]=docs,build
8+
*
9+
* Possible values: accountAdministration, autoSpecs, build, buildingConnected, capitalPlanning, cloudWorksharing, cost, designCollaboration, docs, financials, insight, modelCoordination, projectAdministration, takeoff, and workshopxr.
10+
* @export
11+
* @enum {string}
12+
*/
13+
14+
export const FilterProductKey = {
15+
AccountAdministration: 'accountAdministration',
16+
AutoSpecs: 'autoSpecs',
17+
Build: 'build',
18+
BuildingConnected: 'buildingConnected',
19+
CapitalPlanning: 'capitalPlanning',
20+
CloudWorksharing: 'cloudWorksharing',
21+
Cost: 'cost',
22+
DesignCollaboration: 'designCollaboration',
23+
Docs: 'docs',
24+
Financials: 'financials',
25+
Insight: 'insight',
26+
ModelCoordination: 'modelCoordination',
27+
ProjectAdministration: 'projectAdministration',
28+
Takeoff: 'takeoff',
29+
Workshopxr: 'workshopxr'
30+
} as const;
31+
32+
export type FilterProductKey = typeof FilterProductKey[keyof typeof FilterProductKey];
33+
34+
35+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
3+
/**
4+
* The list of fields to sort by.
5+
* Each property can be followed by a direction modifier of either asc (ascending) or desc (descending). The default is asc.
6+
*
7+
* Possible values: name.
8+
*
9+
* Default is the order in database.
10+
* @export
11+
* @enum {string}
12+
*/
13+
14+
export const FilterProductSort = {
15+
NameAsc: 'name asc',
16+
NameDesc: 'name desc'
17+
} as const;
18+
19+
export type FilterProductSort = typeof FilterProductSort[keyof typeof FilterProductSort];
20+
21+
22+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
3+
/**
4+
* A comma-separated list of response fields to include. Defaults to all fields if not specified.
5+
* Use this parameter to reduce the response size by retrieving only the fields you need.
6+
*
7+
* Possible values:
8+
*
9+
* projectIds – Projects where the user holds this role
10+
*
11+
* name – Role name
12+
*
13+
* status – Role status (active or inactive)
14+
*
15+
* key – Internal key used to translate the role name
16+
*
17+
* createdAt – Timestamp when the role was created
18+
*
19+
* updatedAt – Timestamp when the role was last updated
20+
* @export
21+
* @enum {string}
22+
*/
23+
24+
export const FilterRoleField = {
25+
ProjectIds: 'projectIds',
26+
Name: 'name',
27+
Status: 'status',
28+
Key: 'key',
29+
CreatedAt: 'createdAt',
30+
UpdatedAt: 'updatedAt'
31+
} as const;
32+
33+
export type FilterRoleField = typeof FilterRoleField[keyof typeof FilterRoleField];
34+
35+
36+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
3+
/**
4+
* Sorts the results by one or more fields.
5+
* Each field can be followed by a direction modifier:
6+
*
7+
* asc – Ascending order (default)
8+
*
9+
* desc – Descending order
10+
*
11+
* Possible values: name, createdAt, updatedAt.
12+
*
13+
* Default sort: name asc
14+
*
15+
* Example: sort=name,updatedAt desc
16+
* @export
17+
* @enum {string}
18+
*/
19+
20+
export const FilterRoleSort = {
21+
NameAsc: 'name asc',
22+
CreatedAtAsc: 'createdAt asc',
23+
UpdatedAtAsc: 'updatedAt asc',
24+
NameDesc: 'name desc',
25+
CreatedAtDesc: 'createdAt desc',
26+
UpdatedAtDesc: 'updatedAt desc'
27+
} as const;
28+
29+
export type FilterRoleSort = typeof FilterRoleSort[keyof typeof FilterRoleSort];
30+
31+
32+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
3+
/**
4+
* Filters roles by their status. Accepts one or more of the following values:
5+
* active – The role is currently in use.
6+
*
7+
* inactive – The role has been removed or is no longer in use.
8+
* @export
9+
* @enum {string}
10+
*/
11+
12+
export const FilterRoleStatus = {
13+
Active: 'active',
14+
Inactive: 'inactive'
15+
} as const;
16+
17+
export type FilterRoleStatus = typeof FilterRoleStatus[keyof typeof FilterRoleStatus];
18+
19+
20+

‎construction/accountadmin/source/model/index.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@ export * from './currency';
1616
export * from './fields';
1717
export * from './filterCompanyFields';
1818
export * from './filterCompanySort';
19+
export * from './filterProductField';
20+
export * from './filterProductKey';
21+
export * from './filterProductSort';
22+
export * from './filterRoleField';
23+
export * from './filterRoleSort';
24+
export * from './filterRoleStatus';
1925
export * from './filterTextMatch';
2026
export * from './filterUserProjectsAccessLevels';
2127
export * from './orFilters';
2228
export * from './pagination';
2329
export * from './platform';
30+
export * from './product';
2431
export * from './productAccess';
2532
export * from './productKeys';
2633
export * from './products';
34+
export * from './productsPage';
2735
export * from './project';
2836
export * from './projectCompanies';
2937
export * from './projectPatch';
@@ -49,6 +57,8 @@ export * from './projectUsersUpdatePayload';
4957
export * from './projectUsersUpdatePayloadProducts';
5058
export * from './projectsPage';
5159
export * from './region';
60+
export * from './role';
61+
export * from './rolesPage';
5262
export * from './sortBy';
5363
export * from './status';
5464
export * from './statusFilter';
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
3+
/**
4+
* A list of ACC products the user is associated with.
5+
* @export
6+
* @interface Product
7+
*/
8+
export interface Product {
9+
/**
10+
* A machine-readable identifier for the product (e.g., docs, build).
11+
* Each product has a unique key used throughout the API for identification, filtering, and integration logic (e.g., in query parameters like filter[key]).
12+
*
13+
* Possible values: ACC - autoSpecs, build, cost, designCollaboration, docs, insight, modelCoordination, projectAdministration, and takeoff.
14+
*
15+
* BIM 360 - assets, costManagement, designCollaboration, documentManagement, field, fieldManagement, glue, insight, modelCoordination, plan, projectAdministration, projectHome, projectManagement, and quantification.
16+
*
17+
* Note that this endpoint returns only ACC products. Other endpoints, such as GET projects and GET projects/:projectId, may return both ACC and BIM 360 projects. In those responses, product keys may include BIM 360 values.
18+
* @type {string}
19+
* @memberof Product
20+
*/
21+
'key'?: string;
22+
/**
23+
* The URL of the icon associated with the product.
24+
* @type {string}
25+
* @memberof Product
26+
*/
27+
'icon'?: string;
28+
/**
29+
* The name of the product.
30+
* @type {string}
31+
* @memberof Product
32+
*/
33+
'name'?: string;
34+
/**
35+
* The list of projects IDs where the user is associated with the product.
36+
* @type {Array<string>}
37+
* @memberof Product
38+
*/
39+
'projectIds'?: Array<string>;
40+
}
41+

0 commit comments

Comments
 (0)