import * as jspb from 'google-protobuf' ; import * as grpcWeb from 'grpc-web' ; import * as googleProtobufWrappers from 'google-protobuf/google/protobuf/wrappers_pb' ; import * as googleProtobufTimestamp from 'google-protobuf/google/protobuf/timestamp_pb' ; import * as googleProtobufEmpty from 'google-protobuf/google/protobuf/empty_pb' ; export class Devices { private client_ = new grpcWeb . GrpcWebClientBase ( { format : 'text' , } ) ; private methodInfoAddDevice = new grpcWeb . MethodDescriptor < AddDeviceReq , Device > ( "AddDevice" , null , AddDeviceReq , Device , ( req ) => req . serializeBinary ( ) , Device . deserializeBinary ) ; private methodInfoListDevices = new grpcWeb . MethodDescriptor < ListDevicesReq , ListDevicesRes > ( "ListDevices" , null , ListDevicesReq , ListDevicesRes , ( req ) => req . serializeBinary ( ) , ListDevicesRes . deserializeBinary ) ; private methodInfoDeleteDevice = new grpcWeb . MethodDescriptor < DeleteDeviceReq , googleProtobufEmpty . Empty > ( "DeleteDevice" , null , DeleteDeviceReq , googleProtobufEmpty . Empty , ( req ) => req . serializeBinary ( ) , googleProtobufEmpty . Empty . deserializeBinary ) ; private methodInfoListAllDevices = new grpcWeb . MethodDescriptor < ListAllDevicesReq , ListAllDevicesRes > ( "ListAllDevices" , null , ListAllDevicesReq , ListAllDevicesRes , ( req ) => req . serializeBinary ( ) , ListAllDevicesRes . deserializeBinary ) ; constructor ( private hostname , private defaultMetadata ? ) { } addDevice ( req , metadata ? ) { return new Promise ( ( resolve , reject ) => { const message = AddDeviceReqFromObject ( req ) ; this . client_ . rpcCall ( this . hostname + '/proto.Devices/AddDevice' , message , Object . assign ( { } , this . defaultMetadata ? this . defaultMetadata ( ) : { } , metadata ) , this . methodInfoAddDevice , ( err , res ) => { if ( err ) { reject ( err ) ; } else { resolve ( res . toObject ( ) ) ; } } ) ; } ) ; } listDevices ( req , metadata ? ) { return new Promise ( ( resolve , reject ) => { const message = ListDevicesReqFromObject ( req ) ; this . client_ . rpcCall ( this . hostname + '/proto.Devices/ListDevices' , message , Object . assign ( { } , this . defaultMetadata ? this . defaultMetadata ( ) : { } , metadata ) , this . methodInfoListDevices , ( err , res ) => { if ( err ) { reject ( err ) ; } else { resolve ( res . toObject ( ) ) ; } } ) ; } ) ; } deleteDevice ( req , metadata ? ) { return new Promise ( ( resolve , reject ) => { const message = DeleteDeviceReqFromObject ( req ) ; this . client_ . rpcCall ( this . hostname + '/proto.Devices/DeleteDevice' , message , Object . assign ( { } , this . defaultMetadata ? this . defaultMetadata ( ) : { } , metadata ) , this . methodInfoDeleteDevice , ( err , res ) => { if ( err ) { reject ( err ) ; } else { resolve ( res . toObject ( ) ) ; } } ) ; } ) ; } listAllDevices ( req , metadata ? ) { return new Promise ( ( resolve , reject ) => { const message = ListAllDevicesReqFromObject ( req ) ; this . client_ . rpcCall ( this . hostname + '/proto.Devices/ListAllDevices' , message , Object . assign ( { } , this . defaultMetadata ? this . defaultMetadata ( ) : { } , metadata ) , this . methodInfoListAllDevices , ( err , res ) => { if ( err ) { reject ( err ) ; } else { resolve ( res . toObject ( ) ) ; } } ) ; } ) ; } } export declare namespace Device { export type AsObject = { name : string ; owner : string ; publicKey : string ; address : string ; createdAt ? : googleProtobufTimestamp . Timestamp . AsObject ; connected : boolean ; lastHandshakeTime ? : googleProtobufTimestamp . Timestamp . AsObject ; receiveBytes : number ; transmitBytes : number ; endpoint : string ; ownerName : string ; ownerEmail : string ; ownerProvider : string ; } ; } export class Device extends jspb . Message { private static repeatedFields_ = [ ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , Device . repeatedFields_ , null ) ; } getName ( ) { return jspb . Message . getFieldWithDefault ( this , 1 , "" ) ; } setName ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 1 , value ) ; } getOwner ( ) { return jspb . Message . getFieldWithDefault ( this , 2 , "" ) ; } setOwner ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 2 , value ) ; } getPublicKey ( ) { return jspb . Message . getFieldWithDefault ( this , 3 , "" ) ; } setPublicKey ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 3 , value ) ; } getAddress ( ) { return jspb . Message . getFieldWithDefault ( this , 4 , "" ) ; } setAddress ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 4 , value ) ; } getCreatedAt ( ) { return jspb . Message . getWrapperField ( this , googleProtobufTimestamp . Timestamp , 5 ) ; } setCreatedAt ( value ? ) { ( jspb . Message as any ) . setWrapperField ( this , 5 , value ) ; } getConnected ( ) { return jspb . Message . getFieldWithDefault ( this , 6 , false ) ; } setConnected ( value ) { ( jspb . Message as any ) . setProto3BooleanField ( this , 6 , value ) ; } getLastHandshakeTime ( ) { return jspb . Message . getWrapperField ( this , googleProtobufTimestamp . Timestamp , 7 ) ; } setLastHandshakeTime ( value ? ) { ( jspb . Message as any ) . setWrapperField ( this , 7 , value ) ; } getReceiveBytes ( ) { return jspb . Message . getFieldWithDefault ( this , 8 , 0 ) ; } setReceiveBytes ( value ) { ( jspb . Message as any ) . setProto3IntField ( this , 8 , value ) ; } getTransmitBytes ( ) { return jspb . Message . getFieldWithDefault ( this , 9 , 0 ) ; } setTransmitBytes ( value ) { ( jspb . Message as any ) . setProto3IntField ( this , 9 , value ) ; } getEndpoint ( ) { return jspb . Message . getFieldWithDefault ( this , 10 , "" ) ; } setEndpoint ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 10 , value ) ; } getOwnerName ( ) { return jspb . Message . getFieldWithDefault ( this , 11 , "" ) ; } setOwnerName ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 11 , value ) ; } getOwnerEmail ( ) { return jspb . Message . getFieldWithDefault ( this , 12 , "" ) ; } setOwnerEmail ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 12 , value ) ; } getOwnerProvider ( ) { return jspb . Message . getFieldWithDefault ( this , 13 , "" ) ; } setOwnerProvider ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 13 , value ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; Device . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { name : this . getName ( ) , owner : this . getOwner ( ) , publicKey : this . getPublicKey ( ) , address : this . getAddress ( ) , createdAt : ( f = this . getCreatedAt ( ) ) && f . toObject ( ) , connected : this . getConnected ( ) , lastHandshakeTime : ( f = this . getLastHandshakeTime ( ) ) && f . toObject ( ) , receiveBytes : this . getReceiveBytes ( ) , transmitBytes : this . getTransmitBytes ( ) , endpoint : this . getEndpoint ( ) , ownerName : this . getOwnerName ( ) , ownerEmail : this . getOwnerEmail ( ) , ownerProvider : this . getOwnerProvider ( ) , } ; } static serializeBinaryToWriter ( message , writer ) { const field1 = message . getName ( ) ; if ( field1 . length > 0 ) { writer . writeString ( 1 , field1 ) ; } const field2 = message . getOwner ( ) ; if ( field2 . length > 0 ) { writer . writeString ( 2 , field2 ) ; } const field3 = message . getPublicKey ( ) ; if ( field3 . length > 0 ) { writer . writeString ( 3 , field3 ) ; } const field4 = message . getAddress ( ) ; if ( field4 . length > 0 ) { writer . writeString ( 4 , field4 ) ; } const field5 = message . getCreatedAt ( ) ; if ( field5 != null ) { writer . writeMessage ( 5 , field5 , googleProtobufTimestamp . Timestamp . serializeBinaryToWriter ) ; } const field6 = message . getConnected ( ) ; if ( field6 != false ) { writer . writeBool ( 6 , field6 ) ; } const field7 = message . getLastHandshakeTime ( ) ; if ( field7 != null ) { writer . writeMessage ( 7 , field7 , googleProtobufTimestamp . Timestamp . serializeBinaryToWriter ) ; } const field8 = message . getReceiveBytes ( ) ; if ( field8 != 0 ) { writer . writeInt64 ( 8 , field8 ) ; } const field9 = message . getTransmitBytes ( ) ; if ( field9 != 0 ) { writer . writeInt64 ( 9 , field9 ) ; } const field10 = message . getEndpoint ( ) ; if ( field10 . length > 0 ) { writer . writeString ( 10 , field10 ) ; } const field11 = message . getOwnerName ( ) ; if ( field11 . length > 0 ) { writer . writeString ( 11 , field11 ) ; } const field12 = message . getOwnerEmail ( ) ; if ( field12 . length > 0 ) { writer . writeString ( 12 , field12 ) ; } const field13 = message . getOwnerProvider ( ) ; if ( field13 . length > 0 ) { writer . writeString ( 13 , field13 ) ; } } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new Device ( ) ; return Device . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { case 1 : const field1 = reader . readString ( ) ; message . setName ( field1 ) ; break ; case 2 : const field2 = reader . readString ( ) ; message . setOwner ( field2 ) ; break ; case 3 : const field3 = reader . readString ( ) ; message . setPublicKey ( field3 ) ; break ; case 4 : const field4 = reader . readString ( ) ; message . setAddress ( field4 ) ; break ; case 5 : const field5 = new googleProtobufTimestamp . Timestamp ( ) ; reader . readMessage ( field5 , googleProtobufTimestamp . Timestamp . deserializeBinaryFromReader ) ; message . setCreatedAt ( field5 ) ; break ; case 6 : const field6 = reader . readBool ( ) ; message . setConnected ( field6 ) ; break ; case 7 : const field7 = new googleProtobufTimestamp . Timestamp ( ) ; reader . readMessage ( field7 , googleProtobufTimestamp . Timestamp . deserializeBinaryFromReader ) ; message . setLastHandshakeTime ( field7 ) ; break ; case 8 : const field8 = reader . readInt64 ( ) ; message . setReceiveBytes ( field8 ) ; break ; case 9 : const field9 = reader . readInt64 ( ) ; message . setTransmitBytes ( field9 ) ; break ; case 10 : const field10 = reader . readString ( ) ; message . setEndpoint ( field10 ) ; break ; case 11 : const field11 = reader . readString ( ) ; message . setOwnerName ( field11 ) ; break ; case 12 : const field12 = reader . readString ( ) ; message . setOwnerEmail ( field12 ) ; break ; case 13 : const field13 = reader . readString ( ) ; message . setOwnerProvider ( field13 ) ; break ; default : reader . skipField ( ) ; break ; } } return message ; } } export declare namespace AddDeviceReq { export type AsObject = { name : string ; publicKey : string ; } ; } export class AddDeviceReq extends jspb . Message { private static repeatedFields_ = [ ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , AddDeviceReq . repeatedFields_ , null ) ; } getName ( ) { return jspb . Message . getFieldWithDefault ( this , 1 , "" ) ; } setName ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 1 , value ) ; } getPublicKey ( ) { return jspb . Message . getFieldWithDefault ( this , 2 , "" ) ; } setPublicKey ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 2 , value ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; AddDeviceReq . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { name : this . getName ( ) , publicKey : this . getPublicKey ( ) , } ; } static serializeBinaryToWriter ( message , writer ) { const field1 = message . getName ( ) ; if ( field1 . length > 0 ) { writer . writeString ( 1 , field1 ) ; } const field2 = message . getPublicKey ( ) ; if ( field2 . length > 0 ) { writer . writeString ( 2 , field2 ) ; } } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new AddDeviceReq ( ) ; return AddDeviceReq . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { case 1 : const field1 = reader . readString ( ) ; message . setName ( field1 ) ; break ; case 2 : const field2 = reader . readString ( ) ; message . setPublicKey ( field2 ) ; break ; default : reader . skipField ( ) ; break ; } } return message ; } } export declare namespace ListDevicesReq { export type AsObject = { } ; } export class ListDevicesReq extends jspb . Message { private static repeatedFields_ = [ ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , ListDevicesReq . repeatedFields_ , null ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; ListDevicesReq . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { } ; } static serializeBinaryToWriter ( message , writer ) { } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new ListDevicesReq ( ) ; return ListDevicesReq . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { default : reader . skipField ( ) ; break ; } } return message ; } } export declare namespace ListDevicesRes { export type AsObject = { items : Array < Device . AsObject > ; } ; } export class ListDevicesRes extends jspb . Message { private static repeatedFields_ = [ 1 , ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , ListDevicesRes . repeatedFields_ , null ) ; } getItems ( ) { return jspb . Message . getRepeatedWrapperField ( this , Device , 1 ) ; } setItems ( value ) { ( jspb . Message as any ) . setRepeatedWrapperField ( this , 1 , value ) ; } addItems ( value ? , index ? ) { return jspb . Message . addToRepeatedWrapperField ( this , 1 , value , Device , index ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; ListDevicesRes . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { items : this . getItems ( ) . map ( ( item ) => item . toObject ( ) ) , } ; } static serializeBinaryToWriter ( message , writer ) { const field1 = message . getItems ( ) ; if ( field1 . length > 0 ) { writer . writeRepeatedMessage ( 1 , field1 , Device . serializeBinaryToWriter ) ; } } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new ListDevicesRes ( ) ; return ListDevicesRes . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { case 1 : const field1 = new Device ( ) ; reader . readMessage ( field1 , Device . deserializeBinaryFromReader ) ; message . addItems ( field1 ) ; break ; default : reader . skipField ( ) ; break ; } } return message ; } } export declare namespace DeleteDeviceReq { export type AsObject = { name : string ; owner ? : googleProtobufWrappers . StringValue . AsObject ; } ; } export class DeleteDeviceReq extends jspb . Message { private static repeatedFields_ = [ ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , DeleteDeviceReq . repeatedFields_ , null ) ; } getName ( ) { return jspb . Message . getFieldWithDefault ( this , 1 , "" ) ; } setName ( value ) { ( jspb . Message as any ) . setProto3StringField ( this , 1 , value ) ; } getOwner ( ) { return jspb . Message . getWrapperField ( this , googleProtobufWrappers . StringValue , 2 ) ; } setOwner ( value ? ) { ( jspb . Message as any ) . setWrapperField ( this , 2 , value ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; DeleteDeviceReq . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { name : this . getName ( ) , owner : ( f = this . getOwner ( ) ) && f . toObject ( ) , } ; } static serializeBinaryToWriter ( message , writer ) { const field1 = message . getName ( ) ; if ( field1 . length > 0 ) { writer . writeString ( 1 , field1 ) ; } const field2 = message . getOwner ( ) ; if ( field2 != null ) { writer . writeMessage ( 2 , field2 , googleProtobufWrappers . StringValue . serializeBinaryToWriter ) ; } } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new DeleteDeviceReq ( ) ; return DeleteDeviceReq . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { case 1 : const field1 = reader . readString ( ) ; message . setName ( field1 ) ; break ; case 2 : const field2 = new googleProtobufWrappers . StringValue ( ) ; reader . readMessage ( field2 , googleProtobufWrappers . StringValue . deserializeBinaryFromReader ) ; message . setOwner ( field2 ) ; break ; default : reader . skipField ( ) ; break ; } } return message ; } } export declare namespace ListAllDevicesReq { export type AsObject = { } ; } export class ListAllDevicesReq extends jspb . Message { private static repeatedFields_ = [ ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , ListAllDevicesReq . repeatedFields_ , null ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; ListAllDevicesReq . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { } ; } static serializeBinaryToWriter ( message , writer ) { } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new ListAllDevicesReq ( ) ; return ListAllDevicesReq . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { default : reader . skipField ( ) ; break ; } } return message ; } } export declare namespace ListAllDevicesRes { export type AsObject = { items : Array < Device . AsObject > ; } ; } export class ListAllDevicesRes extends jspb . Message { private static repeatedFields_ = [ 1 , ] ; constructor ( data ? ) { super ( ) ; jspb . Message . initialize ( this , data || [ ] , 0 , - 1 , ListAllDevicesRes . repeatedFields_ , null ) ; } getItems ( ) { return jspb . Message . getRepeatedWrapperField ( this , Device , 1 ) ; } setItems ( value ) { ( jspb . Message as any ) . setRepeatedWrapperField ( this , 1 , value ) ; } addItems ( value ? , index ? ) { return jspb . Message . addToRepeatedWrapperField ( this , 1 , value , Device , index ) ; } serializeBinary ( ) { const writer = new jspb . BinaryWriter ( ) ; ListAllDevicesRes . serializeBinaryToWriter ( this , writer ) ; return writer . getResultBuffer ( ) ; } toObject ( ) { let f ; return { items : this . getItems ( ) . map ( ( item ) => item . toObject ( ) ) , } ; } static serializeBinaryToWriter ( message , writer ) { const field1 = message . getItems ( ) ; if ( field1 . length > 0 ) { writer . writeRepeatedMessage ( 1 , field1 , Device . serializeBinaryToWriter ) ; } } static deserializeBinary ( bytes ) { var reader = new jspb . BinaryReader ( bytes ) ; var message = new ListAllDevicesRes ( ) ; return ListAllDevicesRes . deserializeBinaryFromReader ( message , reader ) ; } static deserializeBinaryFromReader ( message , reader ) { while ( reader . nextField ( ) ) { if ( reader . isEndGroup ( ) ) { break ; } const field = reader . getFieldNumber ( ) ; switch ( field ) { case 1 : const field1 = new Device ( ) ; reader . readMessage ( field1 , Device . deserializeBinaryFromReader ) ; message . addItems ( field1 ) ; break ; default : reader . skipField ( ) ; break ; } } return message ; } } function DeviceFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new Device ( ) ; message . setName ( obj . name ) ; message . setOwner ( obj . owner ) ; message . setPublicKey ( obj . publicKey ) ; message . setAddress ( obj . address ) ; message . setCreatedAt ( TimestampFromObject ( obj . createdAt ) ) ; message . setConnected ( obj . connected ) ; message . setLastHandshakeTime ( TimestampFromObject ( obj . lastHandshakeTime ) ) ; message . setReceiveBytes ( obj . receiveBytes ) ; message . setTransmitBytes ( obj . transmitBytes ) ; message . setEndpoint ( obj . endpoint ) ; message . setOwnerName ( obj . ownerName ) ; message . setOwnerEmail ( obj . ownerEmail ) ; message . setOwnerProvider ( obj . ownerProvider ) ; return message ; } function TimestampFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new googleProtobufTimestamp . Timestamp ( ) ; message . setSeconds ( obj . seconds ) ; message . setNanos ( obj . nanos ) ; return message ; } function AddDeviceReqFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new AddDeviceReq ( ) ; message . setName ( obj . name ) ; message . setPublicKey ( obj . publicKey ) ; return message ; } function ListDevicesReqFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new ListDevicesReq ( ) ; return message ; } function ListDevicesResFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new ListDevicesRes ( ) ; ( obj . items || [ ] ) . map ( ( item ) => DeviceFromObject ( item ) ) . forEach ( ( item ) => message . addItems ( item ) ) ; return message ; } function DeleteDeviceReqFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new DeleteDeviceReq ( ) ; message . setName ( obj . name ) ; message . setOwner ( StringValueFromObject ( obj . owner ) ) ; return message ; } function StringValueFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new googleProtobufWrappers . StringValue ( ) ; message . setValue ( obj . value ) ; return message ; } function ListAllDevicesReqFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new ListAllDevicesReq ( ) ; return message ; } function ListAllDevicesResFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new ListAllDevicesRes ( ) ; ( obj . items || [ ] ) . map ( ( item ) => DeviceFromObject ( item ) ) . forEach ( ( item ) => message . addItems ( item ) ) ; return message ; } function EmptyFromObject ( obj ) { if ( obj === undefined ) { return undefined ; } const message = new googleProtobufEmpty . Empty ( ) ; return message ; }