internal static AppendFileParams AppendParameters(AppendFileParams appendParameters) { if (appendParameters is null) { throw new ArgumentNullException(nameof(appendParameters), "File Update Parameters argument is missing. Please check that it is not null."); } if (appendParameters.File is null) { throw new ArgumentNullException(nameof(appendParameters.File), "File identifier is missing. Please check that it is not null."); } return(appendParameters); }
protected async Task HandleValidSubmit() { _output = null; await _network.ExecuteAsync(_input.Gateway, _input.Payer, async client => { var createParams = new AppendFileParams { File = _input.File, Contents = _input.Content }; _output = await client.AppendFileAsync(createParams, ctx => ctx.Memo = _input.Memo?.Trim()); }); }
/// <summary> /// Appends content to an existing file. /// </summary> /// <param name="appendParameters"> /// Configuration object identifying the file and contents to append. /// </param> /// <param name="configure"> /// Optional callback method providing an opportunity to modify /// the execution configuration for just this method call. /// It is executed prior to submitting the request to the network. /// </param> /// <returns> /// A transaction receipt containing the details of the transaction & fees. /// </returns> /// <exception cref="ArgumentOutOfRangeException">If required arguments are missing.</exception> /// <exception cref="InvalidOperationException">If required context configuration is missing.</exception> /// <exception cref="PrecheckException">If the gateway node create rejected the request upon submission.</exception> /// <exception cref="ConsensusException">If the network was unable to come to consensus before the duration of the transaction expired.</exception> /// <exception cref="TransactionException">If the network rejected the create request as invalid or had missing data.</exception> public async Task <TransactionRecord> AppendFileWithRecordAsync(AppendFileParams appendParameters, Action <IContext>?configure = null) { return(new TransactionRecord(await ExecuteTransactionAsync(new FileAppendTransactionBody(appendParameters), configure, true, appendParameters.Signatory).ConfigureAwait(false))); }