Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions docs/fileVersionRetentions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ This operation is performed by calling function `getFileVersionRetentions`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-file-version-retentions/).

_Currently we don't have an example for calling `getFileVersionRetentions` in integration tests_
<!-- sample get_file_version_retentions -->

```ts
await client.fileVersionRetentions.getFileVersionRetentions();
```

### Arguments

Expand All @@ -38,7 +42,13 @@ This operation is performed by calling function `getFileVersionRetentionById`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-file-version-retentions-id/).

_Currently we don't have an example for calling `getFileVersionRetentionById` in integration tests_
<!-- sample get_file_version_retentions_id -->

```ts
await client.fileVersionRetentions.getFileVersionRetentionById(
fileVersionRetention.id!
);
```

### Arguments

Expand Down
12 changes: 11 additions & 1 deletion docs/retentionPolicyAssignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ This operation is performed by calling function `createRetentionPolicyAssignment
See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-retention-policy-assignments/).

_Currently we don't have an example for calling `createRetentionPolicyAssignment` in integration tests_
<!-- sample post_retention_policy_assignments -->

```ts
await client.retentionPolicyAssignments.createRetentionPolicyAssignment({
policyId: retentionPolicy.id,
assignTo: {
id: folder.id,
type: 'folder' as CreateRetentionPolicyAssignmentRequestBodyAssignToTypeField,
} satisfies CreateRetentionPolicyAssignmentRequestBodyAssignToField,
} satisfies CreateRetentionPolicyAssignmentRequestBody);
```

### Arguments

Expand Down
2 changes: 1 addition & 1 deletion docs/storagePolicies.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ See the endpoint docs at
<!-- sample get_storage_policies_id -->

```ts
await client.storagePolicies.getStoragePolicyById(storagePolicy.id!);
await client.storagePolicies.getStoragePolicyById(storagePolicy.id);
```

### Arguments
Expand Down
55 changes: 50 additions & 5 deletions docs/storagePolicyAssignments.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ This operation is performed by calling function `getStoragePolicyAssignments`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-storage-policy-assignments/).

_Currently we don't have an example for calling `getStoragePolicyAssignments` in integration tests_
<!-- sample get_storage_policy_assignments -->

```ts
await client.storagePolicyAssignments.getStoragePolicyAssignments({
resolvedForType:
'user' as GetStoragePolicyAssignmentsQueryParamsResolvedForTypeField,
resolvedForId: userId,
} satisfies GetStoragePolicyAssignmentsQueryParams);
```

### Arguments

Expand All @@ -42,7 +50,20 @@ This operation is performed by calling function `createStoragePolicyAssignment`.
See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-storage-policy-assignments/).

_Currently we don't have an example for calling `createStoragePolicyAssignment` in integration tests_
<!-- sample post_storage_policy_assignments -->

```ts
await client.storagePolicyAssignments.createStoragePolicyAssignment({
storagePolicy: {
id: policyId,
type: 'storage_policy' as CreateStoragePolicyAssignmentRequestBodyStoragePolicyTypeField,
} satisfies CreateStoragePolicyAssignmentRequestBodyStoragePolicyField,
assignedTo: {
id: userId,
type: 'user' as CreateStoragePolicyAssignmentRequestBodyAssignedToTypeField,
} satisfies CreateStoragePolicyAssignmentRequestBodyAssignedToField,
} satisfies CreateStoragePolicyAssignmentRequestBody);
```

### Arguments

Expand All @@ -68,7 +89,13 @@ This operation is performed by calling function `getStoragePolicyAssignmentById`
See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-storage-policy-assignments-id/).

_Currently we don't have an example for calling `getStoragePolicyAssignmentById` in integration tests_
<!-- sample get_storage_policy_assignments_id -->

```ts
await client.storagePolicyAssignments.getStoragePolicyAssignmentById(
storagePolicyAssignment.id
);
```

### Arguments

Expand All @@ -94,7 +121,19 @@ This operation is performed by calling function `updateStoragePolicyAssignmentBy
See the endpoint docs at
[API Reference](https://developer.box.com/reference/put-storage-policy-assignments-id/).

_Currently we don't have an example for calling `updateStoragePolicyAssignmentById` in integration tests_
<!-- sample put_storage_policy_assignments_id -->

```ts
await client.storagePolicyAssignments.updateStoragePolicyAssignmentById(
storagePolicyAssignment.id,
{
storagePolicy: {
id: storagePolicy2.id,
type: 'storage_policy' as UpdateStoragePolicyAssignmentByIdRequestBodyStoragePolicyTypeField,
} satisfies UpdateStoragePolicyAssignmentByIdRequestBodyStoragePolicyField,
} satisfies UpdateStoragePolicyAssignmentByIdRequestBody
);
```

### Arguments

Expand Down Expand Up @@ -129,7 +168,13 @@ This operation is performed by calling function `deleteStoragePolicyAssignmentBy
See the endpoint docs at
[API Reference](https://developer.box.com/reference/delete-storage-policy-assignments-id/).

_Currently we don't have an example for calling `deleteStoragePolicyAssignmentById` in integration tests_
<!-- sample delete_storage_policy_assignments_id -->

```ts
await client.storagePolicyAssignments.deleteStoragePolicyAssignmentById(
storagePolicyAssignment.id
);
```

### Arguments

Expand Down
53 changes: 36 additions & 17 deletions src/schemas.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,17 @@ export interface SessionTerminationMessage {
}
export type StoragePolicyMiniTypeField = 'storage_policy';
export interface StoragePolicyMini {
readonly id?: string;
readonly type?: StoragePolicyMiniTypeField;
readonly id: string;
readonly type: StoragePolicyMiniTypeField;
}
export type StoragePolicyAssignmentTypeField = 'storage_policy_assignment';
export interface StoragePolicyAssignmentAssignedToField {
readonly id?: string;
readonly type?: string;
}
export interface StoragePolicyAssignment {
readonly id: string;
readonly type: StoragePolicyAssignmentTypeField;
readonly storagePolicy?: StoragePolicyMini;
readonly assignedTo?: StoragePolicyAssignmentAssignedToField;
}
Expand Down Expand Up @@ -6558,21 +6561,32 @@ export function serializeStoragePolicyMini(
val: StoragePolicyMini
): SerializedData {
return {
['id']: val.id == void 0 ? void 0 : val.id,
['type']:
val.type == void 0
? void 0
: serializeStoragePolicyMiniTypeField(val.type),
['id']: val.id,
['type']: serializeStoragePolicyMiniTypeField(val.type),
};
}
export function deserializeStoragePolicyMini(val: any): StoragePolicyMini {
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
const type: undefined | StoragePolicyMiniTypeField =
val.type == void 0
? void 0
: deserializeStoragePolicyMiniTypeField(val.type);
const id: string = val.id;
const type: StoragePolicyMiniTypeField =
deserializeStoragePolicyMiniTypeField(val.type);
return { id: id, type: type } satisfies StoragePolicyMini;
}
export function serializeStoragePolicyAssignmentTypeField(
val: StoragePolicyAssignmentTypeField
): SerializedData {
return val;
}
export function deserializeStoragePolicyAssignmentTypeField(
val: any
): StoragePolicyAssignmentTypeField {
if (!sdIsString(val)) {
throw 'Expecting a string for "StoragePolicyAssignmentTypeField"';
}
if (val == 'storage_policy_assignment') {
return 'storage_policy_assignment';
}
throw ''.concat('Invalid value: ', val) as string;
}
export function serializeStoragePolicyAssignmentAssignedToField(
val: StoragePolicyAssignmentAssignedToField
): SerializedData {
Expand All @@ -6595,6 +6609,8 @@ export function serializeStoragePolicyAssignment(
val: StoragePolicyAssignment
): SerializedData {
return {
['id']: val.id,
['type']: serializeStoragePolicyAssignmentTypeField(val.type),
['storage_policy']:
val.storagePolicy == void 0
? void 0
Expand All @@ -6608,6 +6624,9 @@ export function serializeStoragePolicyAssignment(
export function deserializeStoragePolicyAssignment(
val: any
): StoragePolicyAssignment {
const id: string = val.id;
const type: StoragePolicyAssignmentTypeField =
deserializeStoragePolicyAssignmentTypeField(val.type);
const storagePolicy: undefined | StoragePolicyMini =
val.storage_policy == void 0
? void 0
Expand All @@ -6617,6 +6636,8 @@ export function deserializeStoragePolicyAssignment(
? void 0
: deserializeStoragePolicyAssignmentAssignedToField(val.assigned_to);
return {
id: id,
type: type,
storagePolicy: storagePolicy,
assignedTo: assignedTo,
} satisfies StoragePolicyAssignment;
Expand Down Expand Up @@ -6668,11 +6689,9 @@ export function serializeStoragePolicy(val: StoragePolicy): SerializedData {
}
export function deserializeStoragePolicy(val: any): StoragePolicy {
const name: undefined | string = val.name == void 0 ? void 0 : val.name;
const id: undefined | string = val.id == void 0 ? void 0 : val.id;
const type: undefined | StoragePolicyMiniTypeField =
val.type == void 0
? void 0
: deserializeStoragePolicyMiniTypeField(val.type);
const id: string = val.id;
const type: StoragePolicyMiniTypeField =
deserializeStoragePolicyMiniTypeField(val.type);
return { name: name, id: id, type: type } satisfies StoragePolicy;
}
export function serializeStoragePolicies(val: StoragePolicies): SerializedData {
Expand Down
Loading