/// <summary> /// Initiates the asynchronous execution of the GetRecord operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetRecord operation on AmazonSageMakerFeatureStoreRuntimeClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetRecord /// operation.</returns> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-featurestore-runtime-2020-07-01/GetRecord">REST API Reference for GetRecord Operation</seealso> public virtual IAsyncResult BeginGetRecord(GetRecordRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = GetRecordRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRecordResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); }
/// <summary> /// Use for <code>OnlineStore</code> serving from a <code>FeatureStore</code>. Only the /// latest records stored in the <code>OnlineStore</code> can be retrieved. If no Record /// with <code>RecordIdentifierValue</code> is found, then an empty result is returned. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRecord service method.</param> /// /// <returns>The response from the GetRecord service method, as returned by SageMakerFeatureStoreRuntime.</returns> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.AccessForbiddenException"> /// You do not have permission to perform an action. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.InternalFailureException"> /// An internal failure occurred. Try your request again. If the problem persists, contact /// AWS customer support. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.ResourceNotFoundException"> /// A resource that is required to perform an action was not found. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.ServiceUnavailableException"> /// The service is currently unavailable. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.ValidationErrorException"> /// There was an error validating your request. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-featurestore-runtime-2020-07-01/GetRecord">REST API Reference for GetRecord Operation</seealso> public virtual GetRecordResponse GetRecord(GetRecordRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetRecordRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRecordResponseUnmarshaller.Instance; return Invoke<GetRecordResponse>(request, options); }
/// <summary> /// Use for <code>OnlineStore</code> serving from a <code>FeatureStore</code>. Only the /// latest records stored in the <code>OnlineStore</code> can be retrieved. If no Record /// with <code>RecordIdentifierValue</code> is found, then an empty result is returned. /// </summary> /// <param name="request">Container for the necessary parameters to execute the GetRecord service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the GetRecord service method, as returned by SageMakerFeatureStoreRuntime.</returns> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.AccessForbiddenException"> /// You do not have permission to perform an action. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.InternalFailureException"> /// An internal failure occurred. Try your request again. If the problem persists, contact /// AWS customer support. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.ResourceNotFoundException"> /// A resource that is required to perform an action was not found. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.ServiceUnavailableException"> /// The service is currently unavailable. /// </exception> /// <exception cref="Amazon.SageMakerFeatureStoreRuntime.Model.ValidationErrorException"> /// There was an error validating your request. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-featurestore-runtime-2020-07-01/GetRecord">REST API Reference for GetRecord Operation</seealso> public virtual Task <GetRecordResponse> GetRecordAsync(GetRecordRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetRecordRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRecordResponseUnmarshaller.Instance; return(InvokeAsync <GetRecordResponse>(request, options, cancellationToken)); }
/// <summary> /// Gets a record by its identifier. /// </summary> /// <param name="request"></param> /// <returns></returns> public async Task <ApiResponse <ResultRecord> > GetRecordAsync(GetRecordRequest request) { Arg.IsNotNull(request, nameof(request)); var path = UrlHelper.GetRecordByIdPath(request.AppId, request.RecordId, request.FieldIds, request.DataFormat); var apiResponse = await GetAsync <ResultRecord>(path); return(apiResponse); }
/// <summary> /// 记录列表 /// </summary> /// <param name="request"></param> /// <returns></returns> public static GetRecordResponse _GetRecord(GetRecordRequest request) { #if DEBUG request = new GetRecordRequest() { user_id = "1", type = "1", pageNum = "0" }; #endif return(Post <GetRecordResponse>("getrecord", request)); }
public override Task <StudyRecordReply> GetRecordList(GetRecordRequest request, ServerCallContext context) { this._logger.LogInformation("This is StudyRecordService GetRecordList"); StudyRecordReply studyRecordReply = new StudyRecordReply(); for (int i = 0; i < 10; i++) { studyRecordReply.StudyRecordModelList.Add(new StudyRecordReply.Types.StudyRecordModel() { Id = 100 + i, StudentId = request.Id, Description = $"这是第{i}次上课 {this._IConfiguration["Port"]}" }); } return(Task.FromResult(studyRecordReply)); }
private void HandleOutput(GetRecordRequest request) { var waiterConfig = new WaiterConfiguration { MaxAttempts = MaxWaitAttempts, GetNextDelayInSeconds = (_) => WaitIntervalSeconds }; switch (ParameterSetName) { case LifecycleStateParamSet: response = client.Waiters.ForRecord(request, waiterConfig, WaitForLifecycleState).Execute(); break; case Default: response = client.GetRecord(request).GetAwaiter().GetResult(); break; } WriteOutput(response, response.Record); }
protected override void ProcessRecord() { base.ProcessRecord(); GetRecordRequest request; try { request = new GetRecordRequest { RecordId = RecordId, OpcRequestId = OpcRequestId }; HandleOutput(request); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// 常量列表和历史记录列表查询 /// </summary> /// <param name="where">常量列表的条件</param> public ArrayList GetConstAndHistoryListData(int timeType = 0, int mood = 0, string type = "1", string pageNum = "0") { ArrayList retArr = new ArrayList(); try { var request = new GetRecordRequest() { user_id = UserInfoStatic.UserInfo.id, type = type, pageNum = pageNum }; var resp = HeartWavesSDK.API.APIClient._GetRecord(request); if (null == resp || null == resp.data) { PmtsMessageBox.CustomControl1.Show("网络异常,请稍后重试"); } else if (resp.data.success != "1") { PmtsMessageBox.CustomControl1.Show(resp.data.message); } else { if (resp.data.data != null) { foreach (var entity in resp.data.data) { UserHrvRecord hrvRecord = new UserHrvRecord(); hrvRecord.HRVData = CommonUtils.getArrayListFromJson(entity.hrvdata); hrvRecord.EPData = CommonUtils.getArrayListFromJson(entity.epdata); hrvRecord.MarkData = CommonUtils.getArrayListFromJson(entity.hrvmark); hrvRecord.PWRData = CommonUtils.getArrayListFromJson(entity.ibidata); hrvRecord.TimeData.Add(entity.fmean); hrvRecord.TimeData.Add(entity.fstddev); hrvRecord.TimeData.Add(entity.fsdnn); hrvRecord.TimeData.Add(entity.frmssd); hrvRecord.TimeData.Add(entity.fsd); hrvRecord.TimeData.Add(entity.fsdsd); hrvRecord.TimeData.Add(entity.fpnn); hrvRecord.FreData.Add(entity.tp); hrvRecord.FreData.Add(entity.vlf); hrvRecord.FreData.Add(entity.lf); hrvRecord.FreData.Add(entity.hf); hrvRecord.FreData.Add(entity.lhr); hrvRecord.FreData.Add(entity.lfnorm); hrvRecord.FreData.Add(entity.hfnorm); hrvRecord.AnsBalance = Convert.ToDouble(entity.nb); hrvRecord.Pressure = Convert.ToDouble(entity.pressureindex); hrvRecord.Adjust = Convert.ToDouble(entity.deflatingindex); hrvRecord.Stable = Convert.ToDouble(entity.stabilityindex); hrvRecord.Score = Convert.ToDouble(entity.synthesisscore); hrvRecord.HrvScore = Convert.ToDouble(entity.hrvscore); var hrvdata = CommonUtils.getArrayListFromJson(entity.hrvdata); hrvRecord.TimeLength = Convert.ToDouble(hrvdata.Count / 2.0); hrvRecord.StartTime = CommonUtils.getDateTime(entity.s_time); hrvRecord.EndTime = CommonUtils.getDateTime(entity.endtime); hrvRecord.RecordType = Convert.ToInt32(entity.recordtype); hrvRecord.Mood = string.IsNullOrWhiteSpace(entity.mood) ? 0 : Convert.ToInt32(entity.mood); hrvRecord.Report = Convert.ToString(entity.report); hrvRecord.Id = entity.id; retArr.Add(hrvRecord); } } } } catch (Exception ex) { PmtsMessageBox.CustomControl1.Show(ex.Message); } return(retArr); }
public async Task CrudAsync() { // Prepare initial record. var record = TestDataFactory.GetFullyFilledOutRecord(_appIdWithRecords, default); // Insert var insertResponse = await _apiClient.SaveRecordAsync(record); // Used for single delete var secondInsertResponse = await _apiClient.SaveRecordAsync(record); // Used for batch delete AssertHelper.AssertSuccess(insertResponse); // Update record.RecordId = insertResponse.Value.Id; UpdateRecordFields(record); var updateResponse = await _apiClient.SaveRecordAsync(record); AssertHelper.AssertSuccess(updateResponse); // Reads // Get by ID var getRequest = new GetRecordRequest(_appIdWithRecords, insertResponse.Value.Id) { FieldIds = { _fieldId }, }; var getResponse = await _apiClient.GetRecordAsync(getRequest); AssertHelper.AssertSuccess(getResponse); AssertHelper.AssertCasting(getResponse.Value); // Get batch var getBatchRequest = new GetRecordsRequest { AppId = _appIdWithRecords, RecordIds = { insertResponse.Value.Id, secondInsertResponse.Value.Id }, FieldIds = { _fieldId }, }; var batchGetResponse = await _apiClient.GetRecordsAsync(getBatchRequest); AssertHelper.AssertSuccess(batchGetResponse); AssertHelper.AssertCasting(batchGetResponse.Value.Items); // Get by app var pagingRequest = new PagingRequest(1, 10); var getByAppRequest = new GetRecordsByAppRequest(_appIdWithRecords, pagingRequest) { FieldIds = { _fieldId }, }; var getByAppResponse = await _apiClient.GetRecordsForAppAsync(getByAppRequest); AssertHelper.AssertSuccess(getByAppResponse); AssertHelper.AssertCasting(getByAppResponse.Value.Items); // Query var queryRequest = new QueryRecordsRequest { AppId = _appIdWithRecords, }; var queryResponse = await _apiClient.QueryRecordsAsync(queryRequest); AssertHelper.AssertSuccess(queryResponse); AssertHelper.AssertCasting(queryResponse.Value.Items); // Delete // Single delete var deleteResponse = await _apiClient.DeleteRecordAsync(_appIdWithRecords, insertResponse.Value.Id); AssertHelper.AssertSuccess(deleteResponse); // Batch delete var batchDeleteRequest = new DeleteRecordsRequest(_appIdWithRecords, new[] { secondInsertResponse.Value.Id }); var batchDeleteResponse = await _apiClient.DeleteRecordsAsync(batchDeleteRequest); AssertHelper.AssertSuccess(batchDeleteResponse); }