/// <inheritdoc/> public async Task <MethodCallResultModel> NodeMethodCallAsync( EndpointApiModel endpoint, MethodCallRequestModel request) { var result = await _client.NodeMethodCallAsync(endpoint, request.Map <MethodCallRequestApiModel>()); return(result.Map <MethodCallResultModel>()); }
/// <inheritdoc/> public async Task <MethodCallResultModel> NodeMethodCallAsync( string endpoint, MethodCallRequestModel request) { var result = await _client.NodeMethodCallAsync(endpoint, Map <MethodCallRequestApiModel>(request)); return(Map <MethodCallResultModel>(result)); }
/// <inheritdoc/> public async Task <MethodCallResultModel> NodeMethodCallAsync( string endpoint, MethodCallRequestModel request) { var result = await _client.NodeMethodCallAsync(endpoint, request.ToApiModel()); return(result.ToServiceModel()); }
/// <inheritdoc/> public async Task <MethodCallResultModel> NodeMethodCallAsync( string endpointId, MethodCallRequestModel request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } return(await CallServiceOnTwin <MethodCallRequestModel, MethodCallResultModel>( "MethodCall_V2", endpointId, request)); }
/// <inheritdoc/> public async Task <MethodCallResultModel> NodeMethodCallAsync( EndpointRegistrationModel registration, MethodCallRequestModel request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } return(await CallServiceOnSupervisor <MethodCallRequestModel, MethodCallResultModel>( "MethodCall_V2", registration, request)); }
/// <summary> /// Create from service model /// </summary> /// <param name="model"></param> public MethodCallRequestApiModel(MethodCallRequestModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } MethodId = model.MethodId; ObjectId = model.ObjectId; MethodBrowsePath = model.MethodBrowsePath; ObjectBrowsePath = model.ObjectBrowsePath; Arguments = model.Arguments? .Select(a => a != null ? new MethodCallArgumentApiModel(a) : null) .ToList(); Header = model.Header == null ? null : new RequestHeaderApiModel(model.Header); }
/// <summary> /// Create from service model /// </summary> /// <param name="model"></param> public static MethodCallRequestApiModel ToApiModel( this MethodCallRequestModel model) { if (model == null) { return(null); } return(new MethodCallRequestApiModel { MethodId = model.MethodId, ObjectId = model.ObjectId, MethodBrowsePath = model.MethodBrowsePath, ObjectBrowsePath = model.ObjectBrowsePath, Arguments = model.Arguments? .Select(s => s.ToApiModel()).ToList(), Header = model.Header.ToApiModel() }); }
/// <inheritdoc/> public Task <MethodCallResultModel> NodeMethodCallAsync( string endpointId, MethodCallRequestModel request) { return(_nodes.NodeMethodCallAsync(Endpoint, request)); }