1
1
/* eslint-disable */
2
- import { ScanCriteria } from "@topcoder-framework/lib-common" ;
3
2
import _m0 from "protobufjs/minimal" ;
4
3
5
4
export interface LongComponentState {
@@ -24,11 +23,7 @@ export interface CreateLongComponentStateInput {
24
23
}
25
24
26
25
export interface UpdateLongComponentStateInput {
27
- filterCriteria : ScanCriteria [ ] ;
28
- updateInput ?: UpdateLongComponentStateInput_UpdateInput ;
29
- }
30
-
31
- export interface UpdateLongComponentStateInput_UpdateInput {
26
+ longComponentStateId : number ;
32
27
submissionNumber ?: number | undefined ;
33
28
points ?: number | undefined ;
34
29
}
@@ -278,16 +273,19 @@ export const CreateLongComponentStateInput = {
278
273
} ;
279
274
280
275
function createBaseUpdateLongComponentStateInput ( ) : UpdateLongComponentStateInput {
281
- return { filterCriteria : [ ] , updateInput : undefined } ;
276
+ return { longComponentStateId : 0 , submissionNumber : undefined , points : undefined } ;
282
277
}
283
278
284
279
export const UpdateLongComponentStateInput = {
285
280
encode ( message : UpdateLongComponentStateInput , writer : _m0 . Writer = _m0 . Writer . create ( ) ) : _m0 . Writer {
286
- for ( const v of message . filterCriteria ) {
287
- ScanCriteria . encode ( v ! , writer . uint32 ( 10 ) . fork ( ) ) . ldelim ( ) ;
281
+ if ( message . longComponentStateId !== 0 ) {
282
+ writer . uint32 ( 8 ) . int32 ( message . longComponentStateId ) ;
288
283
}
289
- if ( message . updateInput !== undefined ) {
290
- UpdateLongComponentStateInput_UpdateInput . encode ( message . updateInput , writer . uint32 ( 26 ) . fork ( ) ) . ldelim ( ) ;
284
+ if ( message . submissionNumber !== undefined ) {
285
+ writer . uint32 ( 16 ) . int32 ( message . submissionNumber ) ;
286
+ }
287
+ if ( message . points !== undefined ) {
288
+ writer . uint32 ( 24 ) . int32 ( message . points ) ;
291
289
}
292
290
return writer ;
293
291
} ,
@@ -300,10 +298,13 @@ export const UpdateLongComponentStateInput = {
300
298
const tag = reader . uint32 ( ) ;
301
299
switch ( tag >>> 3 ) {
302
300
case 1 :
303
- message . filterCriteria . push ( ScanCriteria . decode ( reader , reader . uint32 ( ) ) ) ;
301
+ message . longComponentStateId = reader . int32 ( ) ;
302
+ break ;
303
+ case 2 :
304
+ message . submissionNumber = reader . int32 ( ) ;
304
305
break ;
305
306
case 3 :
306
- message . updateInput = UpdateLongComponentStateInput_UpdateInput . decode ( reader , reader . uint32 ( ) ) ;
307
+ message . points = reader . int32 ( ) ;
307
308
break ;
308
309
default :
309
310
reader . skipType ( tag & 7 ) ;
@@ -315,25 +316,17 @@ export const UpdateLongComponentStateInput = {
315
316
316
317
fromJSON ( object : any ) : UpdateLongComponentStateInput {
317
318
return {
318
- filterCriteria : Array . isArray ( object ?. filterCriteria )
319
- ? object . filterCriteria . map ( ( e : any ) => ScanCriteria . fromJSON ( e ) )
320
- : [ ] ,
321
- updateInput : isSet ( object . updateInput )
322
- ? UpdateLongComponentStateInput_UpdateInput . fromJSON ( object . updateInput )
323
- : undefined ,
319
+ longComponentStateId : isSet ( object . longComponentStateId ) ? Number ( object . longComponentStateId ) : 0 ,
320
+ submissionNumber : isSet ( object . submissionNumber ) ? Number ( object . submissionNumber ) : undefined ,
321
+ points : isSet ( object . points ) ? Number ( object . points ) : undefined ,
324
322
} ;
325
323
} ,
326
324
327
325
toJSON ( message : UpdateLongComponentStateInput ) : unknown {
328
326
const obj : any = { } ;
329
- if ( message . filterCriteria ) {
330
- obj . filterCriteria = message . filterCriteria . map ( ( e ) => e ? ScanCriteria . toJSON ( e ) : undefined ) ;
331
- } else {
332
- obj . filterCriteria = [ ] ;
333
- }
334
- message . updateInput !== undefined && ( obj . updateInput = message . updateInput
335
- ? UpdateLongComponentStateInput_UpdateInput . toJSON ( message . updateInput )
336
- : undefined ) ;
327
+ message . longComponentStateId !== undefined && ( obj . longComponentStateId = Math . round ( message . longComponentStateId ) ) ;
328
+ message . submissionNumber !== undefined && ( obj . submissionNumber = Math . round ( message . submissionNumber ) ) ;
329
+ message . points !== undefined && ( obj . points = Math . round ( message . points ) ) ;
337
330
return obj ;
338
331
} ,
339
332
@@ -345,74 +338,7 @@ export const UpdateLongComponentStateInput = {
345
338
object : I ,
346
339
) : UpdateLongComponentStateInput {
347
340
const message = createBaseUpdateLongComponentStateInput ( ) ;
348
- message . filterCriteria = object . filterCriteria ?. map ( ( e ) => ScanCriteria . fromPartial ( e ) ) || [ ] ;
349
- message . updateInput = ( object . updateInput !== undefined && object . updateInput !== null )
350
- ? UpdateLongComponentStateInput_UpdateInput . fromPartial ( object . updateInput )
351
- : undefined ;
352
- return message ;
353
- } ,
354
- } ;
355
-
356
- function createBaseUpdateLongComponentStateInput_UpdateInput ( ) : UpdateLongComponentStateInput_UpdateInput {
357
- return { submissionNumber : undefined , points : undefined } ;
358
- }
359
-
360
- export const UpdateLongComponentStateInput_UpdateInput = {
361
- encode ( message : UpdateLongComponentStateInput_UpdateInput , writer : _m0 . Writer = _m0 . Writer . create ( ) ) : _m0 . Writer {
362
- if ( message . submissionNumber !== undefined ) {
363
- writer . uint32 ( 8 ) . int32 ( message . submissionNumber ) ;
364
- }
365
- if ( message . points !== undefined ) {
366
- writer . uint32 ( 16 ) . int32 ( message . points ) ;
367
- }
368
- return writer ;
369
- } ,
370
-
371
- decode ( input : _m0 . Reader | Uint8Array , length ?: number ) : UpdateLongComponentStateInput_UpdateInput {
372
- const reader = input instanceof _m0 . Reader ? input : new _m0 . Reader ( input ) ;
373
- let end = length === undefined ? reader . len : reader . pos + length ;
374
- const message = createBaseUpdateLongComponentStateInput_UpdateInput ( ) ;
375
- while ( reader . pos < end ) {
376
- const tag = reader . uint32 ( ) ;
377
- switch ( tag >>> 3 ) {
378
- case 1 :
379
- message . submissionNumber = reader . int32 ( ) ;
380
- break ;
381
- case 2 :
382
- message . points = reader . int32 ( ) ;
383
- break ;
384
- default :
385
- reader . skipType ( tag & 7 ) ;
386
- break ;
387
- }
388
- }
389
- return message ;
390
- } ,
391
-
392
- fromJSON ( object : any ) : UpdateLongComponentStateInput_UpdateInput {
393
- return {
394
- submissionNumber : isSet ( object . submissionNumber ) ? Number ( object . submissionNumber ) : undefined ,
395
- points : isSet ( object . points ) ? Number ( object . points ) : undefined ,
396
- } ;
397
- } ,
398
-
399
- toJSON ( message : UpdateLongComponentStateInput_UpdateInput ) : unknown {
400
- const obj : any = { } ;
401
- message . submissionNumber !== undefined && ( obj . submissionNumber = Math . round ( message . submissionNumber ) ) ;
402
- message . points !== undefined && ( obj . points = Math . round ( message . points ) ) ;
403
- return obj ;
404
- } ,
405
-
406
- create < I extends Exact < DeepPartial < UpdateLongComponentStateInput_UpdateInput > , I > > (
407
- base ?: I ,
408
- ) : UpdateLongComponentStateInput_UpdateInput {
409
- return UpdateLongComponentStateInput_UpdateInput . fromPartial ( base ?? { } ) ;
410
- } ,
411
-
412
- fromPartial < I extends Exact < DeepPartial < UpdateLongComponentStateInput_UpdateInput > , I > > (
413
- object : I ,
414
- ) : UpdateLongComponentStateInput_UpdateInput {
415
- const message = createBaseUpdateLongComponentStateInput_UpdateInput ( ) ;
341
+ message . longComponentStateId = object . longComponentStateId ?? 0 ;
416
342
message . submissionNumber = object . submissionNumber ?? undefined ;
417
343
message . points = object . points ?? undefined ;
418
344
return message ;
0 commit comments