@@ -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' ;
7
5
import { serializeIntegrationMappingSlackOptions } from './integrationMappingSlackOptions.generated.js' ;
8
6
import { deserializeIntegrationMappingSlackOptions } from './integrationMappingSlackOptions.generated.js' ;
9
7
import { serializeUserIntegrationMappings } from './userIntegrationMappings.generated.js' ;
10
8
import { deserializeUserIntegrationMappings } from './userIntegrationMappings.generated.js' ;
11
9
import { serializeIntegrationMappingPartnerItemSlackUnion } from './integrationMappingPartnerItemSlackUnion.generated.js' ;
12
10
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' ;
18
17
import { IntegrationMappingSlackOptions } from './integrationMappingSlackOptions.generated.js' ;
19
18
import { UserIntegrationMappings } from './userIntegrationMappings.generated.js' ;
20
19
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 ;
35
32
readonly integrationType ?: IntegrationMappingIntegrationTypeField ;
36
33
readonly isManuallyCreated ?: boolean ;
37
34
readonly options ?: IntegrationMappingSlackOptions ;
38
35
readonly createdBy ?: UserIntegrationMappings ;
39
36
readonly modifiedBy ?: UserIntegrationMappings ;
40
37
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,15 +69,6 @@ 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 ) ,
81
72
[ 'integration_type' ] :
82
73
val . integrationType == void 0
83
74
? val . integrationType
@@ -100,6 +91,15 @@ export function serializeIntegrationMapping(
100
91
[ 'partner_item' ] : serializeIntegrationMappingPartnerItemSlackUnion (
101
92
val . partnerItem ,
102
93
) ,
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,28 +111,6 @@ 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 ) ;
136
114
const integrationType : undefined | IntegrationMappingIntegrationTypeField =
137
115
val . integration_type == void 0
138
116
? void 0
@@ -168,6 +146,28 @@ export function deserializeIntegrationMapping(
168
146
}
169
147
const partnerItem : IntegrationMappingPartnerItemSlackUnion =
170
148
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 ,
193
190
integrationType : integrationType ,
194
191
isManuallyCreated : isManuallyCreated ,
195
192
options : options ,
196
193
createdBy : createdBy ,
197
194
modifiedBy : modifiedBy ,
198
195
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