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
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "8a22201", "specHash": "f8e0d99", "version": "10.6.0" }
{ "engineHash": "37c0986", "specHash": "f8e0d99", "version": "10.6.0" }
30 changes: 15 additions & 15 deletions package-lock.json

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

94 changes: 74 additions & 20 deletions src/managers/retentionPolicies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ export type CreateRetentionPolicyRequestBodyDispositionActionField =
| 'permanently_delete'
| 'remove_retention'
| string;
export type CreateRetentionPolicyRequestBodyRetentionLengthField =
| string
| number;
export type CreateRetentionPolicyRequestBodyRetentionTypeField =
| 'modifiable'
| 'non_modifiable'
Expand Down Expand Up @@ -249,7 +252,7 @@ export interface CreateRetentionPolicyRequestBody {
* content. If the policy has a `policy_type` of
* `indefinite`, the `retention_length` will also be
* `indefinite`. */
readonly retentionLength?: string;
readonly retentionLength?: CreateRetentionPolicyRequestBodyRetentionLengthField;
/**
* Specifies the retention type:
*
Expand Down Expand Up @@ -338,6 +341,9 @@ export interface GetRetentionPolicyByIdHeadersInput {
readonly [key: string]: undefined | string;
};
}
export type UpdateRetentionPolicyByIdRequestBodyRetentionLengthField =
| string
| number;
export interface UpdateRetentionPolicyByIdRequestBody {
/**
* The name for the retention policy. */
Expand Down Expand Up @@ -383,7 +389,7 @@ export interface UpdateRetentionPolicyByIdRequestBody {
* content. If the policy has a `policy_type` of
* `indefinite`, the `retention_length` will also be
* `indefinite`. */
readonly retentionLength?: string;
readonly retentionLength?: UpdateRetentionPolicyByIdRequestBodyRetentionLengthField;
/**
* Used to retire a retention policy.
*
Expand Down Expand Up @@ -774,6 +780,25 @@ export function deserializeCreateRetentionPolicyRequestBodyDispositionActionFiel
"Can't deserialize CreateRetentionPolicyRequestBodyDispositionActionField",
});
}
export function serializeCreateRetentionPolicyRequestBodyRetentionLengthField(
val: any,
): SerializedData {
return val;
}
export function deserializeCreateRetentionPolicyRequestBodyRetentionLengthField(
val: SerializedData,
): CreateRetentionPolicyRequestBodyRetentionLengthField {
if (sdIsString(val)) {
return val;
}
if (sdIsNumber(val)) {
return val;
}
throw new BoxSdkError({
message:
"Can't deserialize CreateRetentionPolicyRequestBodyRetentionLengthField",
});
}
export function serializeCreateRetentionPolicyRequestBodyRetentionTypeField(
val: CreateRetentionPolicyRequestBodyRetentionTypeField,
): SerializedData {
Expand Down Expand Up @@ -809,7 +834,12 @@ export function serializeCreateRetentionPolicyRequestBody(
serializeCreateRetentionPolicyRequestBodyDispositionActionField(
val.dispositionAction,
),
['retention_length']: val.retentionLength,
['retention_length']:
val.retentionLength == void 0
? val.retentionLength
: serializeCreateRetentionPolicyRequestBodyRetentionLengthField(
val.retentionLength,
),
['retention_type']:
val.retentionType == void 0
? val.retentionType
Expand Down Expand Up @@ -875,14 +905,14 @@ export function deserializeCreateRetentionPolicyRequestBody(
deserializeCreateRetentionPolicyRequestBodyDispositionActionField(
val.disposition_action,
);
if (!(val.retention_length == void 0) && !sdIsString(val.retention_length)) {
throw new BoxSdkError({
message:
'Expecting string for "retention_length" of type "CreateRetentionPolicyRequestBody"',
});
}
const retentionLength: undefined | string =
val.retention_length == void 0 ? void 0 : val.retention_length;
const retentionLength:
| undefined
| CreateRetentionPolicyRequestBodyRetentionLengthField =
val.retention_length == void 0
? void 0
: deserializeCreateRetentionPolicyRequestBodyRetentionLengthField(
val.retention_length,
);
const retentionType:
| undefined
| CreateRetentionPolicyRequestBodyRetentionTypeField =
Expand Down Expand Up @@ -946,6 +976,25 @@ export function deserializeCreateRetentionPolicyRequestBody(
customNotificationRecipients: customNotificationRecipients,
} satisfies CreateRetentionPolicyRequestBody;
}
export function serializeUpdateRetentionPolicyByIdRequestBodyRetentionLengthField(
val: any,
): SerializedData {
return val;
}
export function deserializeUpdateRetentionPolicyByIdRequestBodyRetentionLengthField(
val: SerializedData,
): UpdateRetentionPolicyByIdRequestBodyRetentionLengthField {
if (sdIsString(val)) {
return val;
}
if (sdIsNumber(val)) {
return val;
}
throw new BoxSdkError({
message:
"Can't deserialize UpdateRetentionPolicyByIdRequestBodyRetentionLengthField",
});
}
export function serializeUpdateRetentionPolicyByIdRequestBody(
val: UpdateRetentionPolicyByIdRequestBody,
): SerializedData {
Expand All @@ -954,7 +1003,12 @@ export function serializeUpdateRetentionPolicyByIdRequestBody(
['description']: val.description,
['disposition_action']: val.dispositionAction,
['retention_type']: val.retentionType,
['retention_length']: val.retentionLength,
['retention_length']:
val.retentionLength == void 0
? val.retentionLength
: serializeUpdateRetentionPolicyByIdRequestBodyRetentionLengthField(
val.retentionLength,
),
['status']: val.status,
['can_owner_extend_retention']: val.canOwnerExtendRetention,
['are_owners_notified']: val.areOwnersNotified,
Expand Down Expand Up @@ -1011,14 +1065,14 @@ export function deserializeUpdateRetentionPolicyByIdRequestBody(
}
const retentionType: undefined | string =
val.retention_type == void 0 ? void 0 : val.retention_type;
if (!(val.retention_length == void 0) && !sdIsString(val.retention_length)) {
throw new BoxSdkError({
message:
'Expecting string for "retention_length" of type "UpdateRetentionPolicyByIdRequestBody"',
});
}
const retentionLength: undefined | string =
val.retention_length == void 0 ? void 0 : val.retention_length;
const retentionLength:
| undefined
| UpdateRetentionPolicyByIdRequestBodyRetentionLengthField =
val.retention_length == void 0
? void 0
: deserializeUpdateRetentionPolicyByIdRequestBodyRetentionLengthField(
val.retention_length,
);
if (!(val.status == void 0) && !sdIsString(val.status)) {
throw new BoxSdkError({
message:
Expand Down
Loading