import * as thrift from "@creditkarma/thrift-server-core" ; export interface IDelegation { src ? : string ; dst ? : string ; } export interface IDelegationArgs { src ? : string ; dst ? : string ; } export const DelegationCodec = { encode ( args , output ) { const obj = { src : args . src , dst : args . dst } ; output . writeStructBegin ( "Delegation" ) ; if ( obj . src != null ) { output . writeFieldBegin ( "src" , thrift . TType . STRING , 1 ) ; output . writeString ( obj . src ) ; output . writeFieldEnd ( ) ; } if ( obj . dst != null ) { output . writeFieldBegin ( "dst" , thrift . TType . STRING , 2 ) ; output . writeString ( obj . dst ) ; output . writeFieldEnd ( ) ; } output . writeFieldStop ( ) ; output . writeStructEnd ( ) ; return ; } , decode ( input ) { let _args = { } ; input . readStructBegin ( ) ; while ( true ) { const ret = input . readFieldBegin ( ) ; const fieldType = ret . fieldType ; const fieldId = ret . fieldId ; if ( fieldType === thrift . TType . STOP ) { break ; } switch ( fieldId ) { case 1 : if ( fieldType === thrift . TType . STRING ) { const value_1 = input . readString ( ) ; _args . src = value_1 ; } else { input . skip ( fieldType ) ; } break ; case 2 : if ( fieldType === thrift . TType . STRING ) { const value_2 = input . readString ( ) ; _args . dst = value_2 ; } else { input . skip ( fieldType ) ; } break ; default : { input . skip ( fieldType ) ; } } input . readFieldEnd ( ) ; } input . readStructEnd ( ) ; return { src : _args . src , dst : _args . dst } ; } } ; export class Delegation extends thrift . StructLike implements IDelegation { public src ? : string ; public dst ? : string ; public readonly _annotations : thrift . IThriftAnnotations = { } ; public readonly _fieldAnnotations : thrift . IFieldAnnotations = { } ; constructor ( args = { } ) { super ( ) ; if ( args . src != null ) { const value_3 = args . src ; this . src = value_3 ; } if ( args . dst != null ) { const value_4 = args . dst ; this . dst = value_4 ; } } public static read ( input ) { return new Delegation ( DelegationCodec . decode ( input ) ) ; } public static write ( args , output ) { return DelegationCodec . encode ( args , output ) ; } public write ( output ) { return DelegationCodec . encode ( this , output ) ; } }