Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e37f2d4
test: Improve integration tests in Python (box/box-codegen#730)
box-sdk-build May 16, 2025
ca90538
chore: Update .codegen.json with commit hash of codegen and openapi spec
box-sdk-build May 16, 2025
3f7df71
fix: Fix parsing `Date` into query parameters (box/box-codegen#729)
box-sdk-build May 20, 2025
4af9073
chore: add deprecation warning for old tfms, fix packaging (box/box-c…
box-sdk-build May 20, 2025
feaf768
feat: Support DateTime in Java (box/box-codegen#726)
box-sdk-build May 21, 2025
2673a20
fix: Fix downscope token to use retrieveToken method for token retrie…
box-sdk-build May 23, 2025
9ff4d9f
docs: legal holds param update (box/box-openapi#526)
box-sdk-build May 27, 2025
ef3c4ff
fix: Fix issues in box-openapi (box/box-openapi#527)
box-sdk-build May 28, 2025
ab80bd3
docs: Shield Lists documentation (box/box-openapi#528)
box-sdk-build May 28, 2025
b2f0afb
fix: Fix `mergeMaps` function in Java (box/box-codegen#734)
box-sdk-build May 29, 2025
b568523
Auto resolve conflict by keeping our changes
May 30, 2025
50434d2
Auto resolve conflict by keeping our changes
May 30, 2025
30a4278
fix: fix backslash and forward slash escaping in TS and Python (box/b…
box-sdk-build Jun 2, 2025
ebc4094
chore: Release Java SDK to Maven Central (box/box-codegen#735)
box-sdk-build Jun 3, 2025
23e8bc9
test: Support shield lists itest (box/box-codegen#720)
box-sdk-build Jun 4, 2025
f03090a
Auto resolve conflict by keeping our changes
Jun 6, 2025
aeb900a
Auto resolve conflict by keeping our changes
Jun 6, 2025
f9e651b
Auto resolve conflict by keeping our changes
Jun 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "70390f5", "specHash": "630fc85", "version": "1.15.1" }
{ "engineHash": "c17f683", "specHash": "630fc85", "version": "1.15.1" }
44 changes: 39 additions & 5 deletions docs/shieldLists.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ This operation is performed by calling function `getShieldListsV2025R0`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/get-shield-lists/).

_Currently we don't have an example for calling `getShieldListsV2025R0` in integration tests_
<!-- sample get_shield_lists_v2025.0 -->

```ts
await client.shieldLists.getShieldListsV2025R0();
```

### Arguments

Expand All @@ -39,7 +43,18 @@ This operation is performed by calling function `createShieldListV2025R0`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/post-shield-lists/).

_Currently we don't have an example for calling `createShieldListV2025R0` in integration tests_
<!-- sample post_shield_lists_v2025.0 -->

```ts
await client.shieldLists.createShieldListV2025R0({
name: shieldListCountryName,
description: 'A list of things that are shielded',
content: new ShieldListContentCountryV2025R0({
type: 'country' as ShieldListContentCountryV2025R0TypeField,
countryCodes: ['US' as string, 'PL' as string],
}),
} satisfies ShieldListsCreateV2025R0);
```

### Arguments

Expand All @@ -63,7 +78,11 @@ This operation is performed by calling function `getShieldListByIdV2025R0`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/get-shield-lists-id/).

_Currently we don't have an example for calling `getShieldListByIdV2025R0` in integration tests_
<!-- sample get_shield_lists_id_v2025.0 -->

```ts
await client.shieldLists.getShieldListByIdV2025R0(shieldListCountry.id);
```

### Arguments

Expand All @@ -87,7 +106,11 @@ This operation is performed by calling function `deleteShieldListByIdV2025R0`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/delete-shield-lists-id/).

_Currently we don't have an example for calling `deleteShieldListByIdV2025R0` in integration tests_
<!-- sample delete_shield_lists_id_v2025.0 -->

```ts
await client.shieldLists.deleteShieldListByIdV2025R0(shieldListCountry.id);
```

### Arguments

Expand All @@ -111,7 +134,18 @@ This operation is performed by calling function `updateShieldListByIdV2025R0`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/v2025.0/put-shield-lists-id/).

_Currently we don't have an example for calling `updateShieldListByIdV2025R0` in integration tests_
<!-- sample put_shield_lists_id_v2025.0 -->

```ts
await client.shieldLists.updateShieldListByIdV2025R0(shieldListCountry.id, {
name: shieldListCountryName,
description: 'Updated description',
content: new ShieldListContentCountryV2025R0({
type: 'country' as ShieldListContentCountryV2025R0TypeField,
countryCodes: ['US' as string],
}),
} satisfies ShieldListsUpdateV2025R0);
```

### Arguments

Expand Down
38 changes: 19 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

145 changes: 145 additions & 0 deletions src/test/shieldLists.generated.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import { serializeShieldListV2025R0 } from '../schemas/v2025R0/shieldListV2025R0.generated.js';
import { deserializeShieldListV2025R0 } from '../schemas/v2025R0/shieldListV2025R0.generated.js';
import { serializeShieldListsCreateV2025R0 } from '../schemas/v2025R0/shieldListsCreateV2025R0.generated.js';
import { deserializeShieldListsCreateV2025R0 } from '../schemas/v2025R0/shieldListsCreateV2025R0.generated.js';
import { serializeShieldListContentCountryV2025R0TypeField } from '../schemas/v2025R0/shieldListContentCountryV2025R0.generated.js';
import { deserializeShieldListContentCountryV2025R0TypeField } from '../schemas/v2025R0/shieldListContentCountryV2025R0.generated.js';
import { serializeShieldListContentDomainV2025R0TypeField } from '../schemas/v2025R0/shieldListContentDomainV2025R0.generated.js';
import { deserializeShieldListContentDomainV2025R0TypeField } from '../schemas/v2025R0/shieldListContentDomainV2025R0.generated.js';
import { serializeShieldListContentEmailV2025R0TypeField } from '../schemas/v2025R0/shieldListContentEmailV2025R0.generated.js';
import { deserializeShieldListContentEmailV2025R0TypeField } from '../schemas/v2025R0/shieldListContentEmailV2025R0.generated.js';
import { serializeShieldListContentIpV2025R0TypeField } from '../schemas/v2025R0/shieldListContentIpV2025R0.generated.js';
import { deserializeShieldListContentIpV2025R0TypeField } from '../schemas/v2025R0/shieldListContentIpV2025R0.generated.js';
import { serializeShieldListsV2025R0 } from '../schemas/v2025R0/shieldListsV2025R0.generated.js';
import { deserializeShieldListsV2025R0 } from '../schemas/v2025R0/shieldListsV2025R0.generated.js';
import { serializeShieldListsUpdateV2025R0 } from '../schemas/v2025R0/shieldListsUpdateV2025R0.generated.js';
import { deserializeShieldListsUpdateV2025R0 } from '../schemas/v2025R0/shieldListsUpdateV2025R0.generated.js';
import { serializeShieldListContentCountryV2025R0 } from '../schemas/v2025R0/shieldListContentCountryV2025R0.generated.js';
import { deserializeShieldListContentCountryV2025R0 } from '../schemas/v2025R0/shieldListContentCountryV2025R0.generated.js';
import { serializeShieldListContentDomainV2025R0 } from '../schemas/v2025R0/shieldListContentDomainV2025R0.generated.js';
import { deserializeShieldListContentDomainV2025R0 } from '../schemas/v2025R0/shieldListContentDomainV2025R0.generated.js';
import { serializeShieldListContentEmailV2025R0 } from '../schemas/v2025R0/shieldListContentEmailV2025R0.generated.js';
import { deserializeShieldListContentEmailV2025R0 } from '../schemas/v2025R0/shieldListContentEmailV2025R0.generated.js';
import { serializeShieldListContentIpV2025R0 } from '../schemas/v2025R0/shieldListContentIpV2025R0.generated.js';
import { deserializeShieldListContentIpV2025R0 } from '../schemas/v2025R0/shieldListContentIpV2025R0.generated.js';
import { BoxClient } from '../client.generated.js';
import { ShieldListV2025R0 } from '../schemas/v2025R0/shieldListV2025R0.generated.js';
import { ShieldListsCreateV2025R0 } from '../schemas/v2025R0/shieldListsCreateV2025R0.generated.js';
import { ShieldListContentCountryV2025R0TypeField } from '../schemas/v2025R0/shieldListContentCountryV2025R0.generated.js';
import { ShieldListContentDomainV2025R0TypeField } from '../schemas/v2025R0/shieldListContentDomainV2025R0.generated.js';
import { ShieldListContentEmailV2025R0TypeField } from '../schemas/v2025R0/shieldListContentEmailV2025R0.generated.js';
import { ShieldListContentIpV2025R0TypeField } from '../schemas/v2025R0/shieldListContentIpV2025R0.generated.js';
import { ShieldListsV2025R0 } from '../schemas/v2025R0/shieldListsV2025R0.generated.js';
import { ShieldListsUpdateV2025R0 } from '../schemas/v2025R0/shieldListsUpdateV2025R0.generated.js';
import { getUuid } from '../internal/utils.js';
import { getEnvVar } from '../internal/utils.js';
import { uploadNewFile } from './commons.generated.js';
import { createNewFolder } from './commons.generated.js';
import { getDefaultClientWithUserSubject } from './commons.generated.js';
import { ShieldListContentCountryV2025R0 } from '../schemas/v2025R0/shieldListContentCountryV2025R0.generated.js';
import { ShieldListContentDomainV2025R0 } from '../schemas/v2025R0/shieldListContentDomainV2025R0.generated.js';
import { ShieldListContentEmailV2025R0 } from '../schemas/v2025R0/shieldListContentEmailV2025R0.generated.js';
import { ShieldListContentIpV2025R0 } from '../schemas/v2025R0/shieldListContentIpV2025R0.generated.js';
import { SerializedData } from '../serialization/json.js';
import { sdIsEmpty } from '../serialization/json.js';
import { sdIsBoolean } from '../serialization/json.js';
import { sdIsNumber } from '../serialization/json.js';
import { sdIsString } from '../serialization/json.js';
import { sdIsList } from '../serialization/json.js';
import { sdIsMap } from '../serialization/json.js';
export const userId: string = getEnvVar('USER_ID');
export const client: BoxClient = getDefaultClientWithUserSubject(userId);
test('testCreateGetUpdateDeleteShieldList', async function testCreateGetUpdateDeleteShieldList(): Promise<any> {
const shieldListCountryName: string = ''.concat(
getUuid(),
'shieldListCountry',
) as string;
const shieldListCountry: ShieldListV2025R0 =
await client.shieldLists.createShieldListV2025R0({
name: shieldListCountryName,
description: 'A list of things that are shielded',
content: new ShieldListContentCountryV2025R0({
type: 'country' as ShieldListContentCountryV2025R0TypeField,
countryCodes: ['US' as string, 'PL' as string],
}),
} satisfies ShieldListsCreateV2025R0);
const shieldListContentDomainName: string = ''.concat(
getUuid(),
'shieldListContentDomain',
) as string;
const shieldListContentDomain: ShieldListV2025R0 =
await client.shieldLists.createShieldListV2025R0({
name: shieldListContentDomainName,
description: 'A list of things that are shielded',
content: new ShieldListContentDomainV2025R0({
type: 'domain' as ShieldListContentDomainV2025R0TypeField,
domains: ['box.com' as string, 'example.com' as string],
}),
} satisfies ShieldListsCreateV2025R0);
const shieldListContentEmailName: string = ''.concat(
getUuid(),
'shieldListContentEmail',
) as string;
const shieldListContentEmail: ShieldListV2025R0 =
await client.shieldLists.createShieldListV2025R0({
name: shieldListContentEmailName,
description: 'A list of things that are shielded',
content: new ShieldListContentEmailV2025R0({
type: 'email' as ShieldListContentEmailV2025R0TypeField,
emailAddresses: [
'[email protected]' as string,
'[email protected]' as string,
],
}),
} satisfies ShieldListsCreateV2025R0);
const shieldListContentIpName: string = ''.concat(
getUuid(),
'shieldListContentIp',
) as string;
const shieldListContentIp: ShieldListV2025R0 =
await client.shieldLists.createShieldListV2025R0({
name: shieldListContentIpName,
description: 'A list of things that are shielded',
content: new ShieldListContentIpV2025R0({
type: 'ip' as ShieldListContentIpV2025R0TypeField,
ipAddresses: ['127.0.0.1' as string, '80.12.12.12/24' as string],
}),
} satisfies ShieldListsCreateV2025R0);
const shieldLists: ShieldListsV2025R0 =
await client.shieldLists.getShieldListsV2025R0();
if (!(shieldLists.entries!.length > 0)) {
throw new Error('Assertion failed');
}
const getShieldListCountry: ShieldListV2025R0 =
await client.shieldLists.getShieldListByIdV2025R0(shieldListCountry.id);
if (!(getShieldListCountry.name == shieldListCountryName)) {
throw new Error('Assertion failed');
}
if (
!(getShieldListCountry.description == 'A list of things that are shielded')
) {
throw new Error('Assertion failed');
}
await client.shieldLists.updateShieldListByIdV2025R0(shieldListCountry.id, {
name: shieldListCountryName,
description: 'Updated description',
content: new ShieldListContentCountryV2025R0({
type: 'country' as ShieldListContentCountryV2025R0TypeField,
countryCodes: ['US' as string],
}),
} satisfies ShieldListsUpdateV2025R0);
const getShieldListCountryUpdated: ShieldListV2025R0 =
await client.shieldLists.getShieldListByIdV2025R0(shieldListCountry.id);
if (!(getShieldListCountryUpdated.description == 'Updated description')) {
throw new Error('Assertion failed');
}
await client.shieldLists.deleteShieldListByIdV2025R0(shieldListCountry.id);
await client.shieldLists.deleteShieldListByIdV2025R0(
shieldListContentDomain.id,
);
await client.shieldLists.deleteShieldListByIdV2025R0(
shieldListContentEmail.id,
);
await client.shieldLists.deleteShieldListByIdV2025R0(shieldListContentIp.id);
});
export {};
Loading