@@ -2,22 +2,22 @@ import { serializeIntegrationMappingBaseTypeField } from './integrationMappingBa
2
2
import { deserializeIntegrationMappingBaseTypeField } from './integrationMappingBase.generated.js' ;
3
3
import { serializeIntegrationMappingBase } from './integrationMappingBase.generated.js' ;
4
4
import { deserializeIntegrationMappingBase } from './integrationMappingBase.generated.js' ;
5
+ import { serializeFolderMini } from './folderMini.generated.js' ;
6
+ import { deserializeFolderMini } from './folderMini.generated.js' ;
5
7
import { serializeIntegrationMappingSlackOptions } from './integrationMappingSlackOptions.generated.js' ;
6
8
import { deserializeIntegrationMappingSlackOptions } from './integrationMappingSlackOptions.generated.js' ;
7
9
import { serializeUserIntegrationMappings } from './userIntegrationMappings.generated.js' ;
8
10
import { deserializeUserIntegrationMappings } from './userIntegrationMappings.generated.js' ;
9
11
import { serializeIntegrationMappingPartnerItemSlackUnion } from './integrationMappingPartnerItemSlackUnion.generated.js' ;
10
12
import { deserializeIntegrationMappingPartnerItemSlackUnion } from './integrationMappingPartnerItemSlackUnion.generated.js' ;
11
- import { serializeFolderMini } from './folderMini.generated.js' ;
12
- import { deserializeFolderMini } from './folderMini.generated.js' ;
13
13
import { serializeDateTime } from '../internal/utils.js' ;
14
14
import { deserializeDateTime } from '../internal/utils.js' ;
15
15
import { IntegrationMappingBaseTypeField } from './integrationMappingBase.generated.js' ;
16
16
import { IntegrationMappingBase } from './integrationMappingBase.generated.js' ;
17
+ import { FolderMini } from './folderMini.generated.js' ;
17
18
import { IntegrationMappingSlackOptions } from './integrationMappingSlackOptions.generated.js' ;
18
19
import { UserIntegrationMappings } from './userIntegrationMappings.generated.js' ;
19
20
import { IntegrationMappingPartnerItemSlackUnion } from './integrationMappingPartnerItemSlackUnion.generated.js' ;
20
- import { FolderMini } from './folderMini.generated.js' ;
21
21
import { BoxSdkError } from '../box/errors.js' ;
22
22
import { DateTime } from '../internal/utils.js' ;
23
23
import { SerializedData } from '../serialization/json.js' ;
@@ -29,15 +29,15 @@ import { sdIsList } from '../serialization/json.js';
29
29
import { sdIsMap } from '../serialization/json.js' ;
30
30
export type IntegrationMappingIntegrationTypeField = 'slack' ;
31
31
export class IntegrationMapping extends IntegrationMappingBase {
32
+ readonly boxItem ! : FolderMini ;
33
+ readonly createdAt ?: DateTime ;
34
+ readonly modifiedAt ?: DateTime ;
32
35
readonly integrationType ?: IntegrationMappingIntegrationTypeField ;
33
36
readonly isManuallyCreated ?: boolean ;
34
37
readonly options ?: IntegrationMappingSlackOptions ;
35
38
readonly createdBy ?: UserIntegrationMappings ;
36
39
readonly modifiedBy ?: UserIntegrationMappings ;
37
40
readonly partnerItem ! : IntegrationMappingPartnerItemSlackUnion ;
38
- readonly boxItem ! : FolderMini ;
39
- readonly createdAt ?: DateTime ;
40
- readonly modifiedAt ?: DateTime ;
41
41
constructor ( fields : IntegrationMapping ) {
42
42
super ( fields ) ;
43
43
}
@@ -69,6 +69,15 @@ export function serializeIntegrationMapping(
69
69
return {
70
70
...base ,
71
71
...{
72
+ [ 'box_item' ] : serializeFolderMini ( val . boxItem ) ,
73
+ [ 'created_at' ] :
74
+ val . createdAt == void 0
75
+ ? val . createdAt
76
+ : serializeDateTime ( val . createdAt ) ,
77
+ [ 'modified_at' ] :
78
+ val . modifiedAt == void 0
79
+ ? val . modifiedAt
80
+ : serializeDateTime ( val . modifiedAt ) ,
72
81
[ 'integration_type' ] :
73
82
val . integrationType == void 0
74
83
? val . integrationType
@@ -91,15 +100,6 @@ export function serializeIntegrationMapping(
91
100
[ 'partner_item' ] : serializeIntegrationMappingPartnerItemSlackUnion (
92
101
val . partnerItem ,
93
102
) ,
94
- [ 'box_item' ] : serializeFolderMini ( val . boxItem ) ,
95
- [ 'created_at' ] :
96
- val . createdAt == void 0
97
- ? val . createdAt
98
- : serializeDateTime ( val . createdAt ) ,
99
- [ 'modified_at' ] :
100
- val . modifiedAt == void 0
101
- ? val . modifiedAt
102
- : serializeDateTime ( val . modifiedAt ) ,
103
103
} ,
104
104
} ;
105
105
}
@@ -111,6 +111,28 @@ export function deserializeIntegrationMapping(
111
111
message : 'Expecting a map for "IntegrationMapping"' ,
112
112
} ) ;
113
113
}
114
+ if ( val . box_item == void 0 ) {
115
+ throw new BoxSdkError ( {
116
+ message :
117
+ 'Expecting "box_item" of type "IntegrationMapping" to be defined' ,
118
+ } ) ;
119
+ }
120
+ const boxItem : FolderMini = deserializeFolderMini ( val . box_item ) ;
121
+ if ( ! ( val . created_at == void 0 ) && ! sdIsString ( val . created_at ) ) {
122
+ throw new BoxSdkError ( {
123
+ message : 'Expecting string for "created_at" of type "IntegrationMapping"' ,
124
+ } ) ;
125
+ }
126
+ const createdAt : undefined | DateTime =
127
+ val . created_at == void 0 ? void 0 : deserializeDateTime ( val . created_at ) ;
128
+ if ( ! ( val . modified_at == void 0 ) && ! sdIsString ( val . modified_at ) ) {
129
+ throw new BoxSdkError ( {
130
+ message :
131
+ 'Expecting string for "modified_at" of type "IntegrationMapping"' ,
132
+ } ) ;
133
+ }
134
+ const modifiedAt : undefined | DateTime =
135
+ val . modified_at == void 0 ? void 0 : deserializeDateTime ( val . modified_at ) ;
114
136
const integrationType : undefined | IntegrationMappingIntegrationTypeField =
115
137
val . integration_type == void 0
116
138
? void 0
@@ -146,28 +168,6 @@ export function deserializeIntegrationMapping(
146
168
}
147
169
const partnerItem : IntegrationMappingPartnerItemSlackUnion =
148
170
deserializeIntegrationMappingPartnerItemSlackUnion ( val . partner_item ) ;
149
- if ( val . box_item == void 0 ) {
150
- throw new BoxSdkError ( {
151
- message :
152
- 'Expecting "box_item" of type "IntegrationMapping" to be defined' ,
153
- } ) ;
154
- }
155
- const boxItem : FolderMini = deserializeFolderMini ( val . box_item ) ;
156
- if ( ! ( val . created_at == void 0 ) && ! sdIsString ( val . created_at ) ) {
157
- throw new BoxSdkError ( {
158
- message : 'Expecting string for "created_at" of type "IntegrationMapping"' ,
159
- } ) ;
160
- }
161
- const createdAt : undefined | DateTime =
162
- val . created_at == void 0 ? void 0 : deserializeDateTime ( val . created_at ) ;
163
- if ( ! ( val . modified_at == void 0 ) && ! sdIsString ( val . modified_at ) ) {
164
- throw new BoxSdkError ( {
165
- message :
166
- 'Expecting string for "modified_at" of type "IntegrationMapping"' ,
167
- } ) ;
168
- }
169
- const modifiedAt : undefined | DateTime =
170
- val . modified_at == void 0 ? void 0 : deserializeDateTime ( val . modified_at ) ;
171
171
if ( val . id == void 0 ) {
172
172
throw new BoxSdkError ( {
173
173
message : 'Expecting "id" of type "IntegrationMapping" to be defined' ,
@@ -187,15 +187,15 @@ export function deserializeIntegrationMapping(
187
187
const type : IntegrationMappingBaseTypeField =
188
188
deserializeIntegrationMappingBaseTypeField ( val . type ) ;
189
189
return {
190
+ boxItem : boxItem ,
191
+ createdAt : createdAt ,
192
+ modifiedAt : modifiedAt ,
190
193
integrationType : integrationType ,
191
194
isManuallyCreated : isManuallyCreated ,
192
195
options : options ,
193
196
createdBy : createdBy ,
194
197
modifiedBy : modifiedBy ,
195
198
partnerItem : partnerItem ,
196
- boxItem : boxItem ,
197
- createdAt : createdAt ,
198
- modifiedAt : modifiedAt ,
199
199
id : id ,
200
200
type : type ,
201
201
} satisfies IntegrationMapping ;
0 commit comments