Esempio n. 1
0
        public async Task DeleteMultipleRecordDifferentResource()
        {
            using (var mocker = HrbcVersion.Trunk.ToRequestMocker())
                using (var session = mocker.Session)
                {
                    mocker.WhenRequest(HttpRequestConstraint.HttpRequest()
                                       .WithUri("privateapi/generic/resource-record",
                                                "?data%5B0%5D%5Bresource%5D=9&data%5B0%5D%5Bdelete%5D%5B0%5D=15&data%5B0%5D%5Bdelete%5D%5B1%5D=20&data%5B0%5D%5Bdelete%5D%5B2%5D=24&data%5B1%5D%5Bresource%5D=5&data%5B1%5D%5Bdelete%5D%5B0%5D=5&data%5B1%5D%5Bdelete%5D%5B1%5D=10&data%5B1%5D%5Bdelete%5D%5B2%5D=14")
                                       .WithMethod(HttpMethod.Delete)
                                       .WithAnyContent())
                    .RespondWith("{'ids':[[15,20,24],[5,10,14]]}");

                    var request = DeleteRecordRequest.Builder()
                                  .Append(ResourceId.Client, 5, 10, 14)
                                  .Append(ResourceId.Recruiter, 15, 20, 24);

                    var response = await session.CallAsync(request);

                    Assert.That(response.DeletedRecords, Has.Count.EqualTo(2));
                    Assert.That(response.DeletedRecords.Keys, Does.Contain(ResourceId.Client));
                    Assert.That(response.DeletedRecords[ResourceId.Client], Has.Count.EqualTo(3));
                    Assert.That(response.DeletedRecords[ResourceId.Client], Does.Contain(5));
                    Assert.That(response.DeletedRecords[ResourceId.Client], Does.Contain(10));
                    Assert.That(response.DeletedRecords[ResourceId.Client], Does.Contain(14));
                    Assert.That(response.DeletedRecords.Keys, Does.Contain(ResourceId.Recruiter));
                    Assert.That(response.DeletedRecords[ResourceId.Recruiter], Has.Count.EqualTo(3));
                    Assert.That(response.DeletedRecords[ResourceId.Recruiter], Does.Contain(15));
                    Assert.That(response.DeletedRecords[ResourceId.Recruiter], Does.Contain(20));
                    Assert.That(response.DeletedRecords[ResourceId.Recruiter], Does.Contain(24));
                }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!ConfirmDelete("OCIDatalabelingservicedataplaneRecord", "Remove"))
            {
                return;
            }

            DeleteRecordRequest request;

            try
            {
                request = new DeleteRecordRequest
                {
                    RecordId     = RecordId,
                    IfMatch      = IfMatch,
                    OpcRequestId = OpcRequestId
                };

                response = client.DeleteRecord(request).GetAwaiter().GetResult();
                WriteOutput(response);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeleteRecord operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DeleteRecord 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 EndDeleteRecord
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-featurestore-runtime-2020-07-01/DeleteRecord">REST API Reference for DeleteRecord Operation</seealso>
        public virtual IAsyncResult BeginDeleteRecord(DeleteRecordRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = DeleteRecordRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteRecordResponseUnmarshaller.Instance;

            return BeginInvoke(request, options, callback, state);
        }
        /// <summary>
        /// Deletes a <code>Record</code> from a <code>FeatureGroup</code>. A new record will
        /// show up in the <code>OfflineStore</code> when the <code>DeleteRecord</code> API is
        /// called. This record will have a value of <code>True</code> in the <code>is_deleted</code>
        /// column.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteRecord service method.</param>
        /// 
        /// <returns>The response from the DeleteRecord 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.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/DeleteRecord">REST API Reference for DeleteRecord Operation</seealso>
        public virtual DeleteRecordResponse DeleteRecord(DeleteRecordRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = DeleteRecordRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteRecordResponseUnmarshaller.Instance;

            return Invoke<DeleteRecordResponse>(request, options);
        }
        /// <summary>
        /// Deletes a <code>Record</code> from a <code>FeatureGroup</code>. A new record will
        /// show up in the <code>OfflineStore</code> when the <code>DeleteRecord</code> API is
        /// called. This record will have a value of <code>True</code> in the <code>is_deleted</code>
        /// column.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteRecord 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 DeleteRecord 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.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/DeleteRecord">REST API Reference for DeleteRecord Operation</seealso>
        public virtual Task <DeleteRecordResponse> DeleteRecordAsync(DeleteRecordRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteRecordRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteRecordResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteRecordResponse>(request, options, cancellationToken));
        }
Esempio n. 6
0
        /// <summary>
        /// 删除记录
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static CommonResponse _DeleteRecord(DeleteRecordRequest request)
        {
#if DEBUG
            request = new DeleteRecordRequest()
            {
                user_id = "1",
                r_id    = "41,42"
            };
#endif
            return(Post <CommonResponse>("deleterecord", request));
        }
        public void DeleteRecord()
        {
            var request = new DeleteRecordRequest(RawRequests.DeleteRecord);

            request.Parse();
            Assert.Equal("0", request.GameId.ToString());
            Assert.Equal("XXXXXX", request.SecretKey);
            Assert.Equal("xxxxxxxx_YYYYYYYYYY__", request.LoginTicket);
            Assert.Equal("test", request.TableId);
            Assert.Equal("150", request.RecordId);
        }
Esempio n. 8
0
        /// <summary>
        /// 删除hrv相关数据
        /// </summary>
        /// <param name="ids"></param>
        public void DeleteHrvData(ArrayList ids)
        {
            try
            {
                if (UserInfoStatic.ipAdd == null)
                {
                    ArrayList removeList = new ArrayList();
                    foreach (var item in MainRightPerson.TmpHrvRecord)
                    {
                        if (ids.Count > 0 && ids.Contains((item as UserHrvRecord).Id))
                        {
                            removeList.Add(item);
                        }
                    }
                    foreach (var item in removeList)
                    {
                        MainRightPerson.TmpHrvRecord.Remove(item);
                    }
                }
                else
                {
                    var request = new DeleteRecordRequest()
                    {
                        user_id = UserInfoStatic.UserInfo.id,
                        r_id    = string.Join(",", ids.ToArray())
                    };
                    var resp = HeartWavesSDK.API.APIClient._DeleteRecord(request);

                    if (null == resp || null == resp.data)
                    {
                        PmtsMessageBox.CustomControl1.Show("网络异常,请稍后重试");
                    }
                    else if (resp.data.success == "1")
                    {
                        PmtsMessageBox.CustomControl1.Show(resp.data.message);
                    }
                }
            }
            catch (Exception ex)
            {
                PmtsMessageBox.CustomControl1.Show(ex.Message);
            }
        }
Esempio n. 9
0
        public async Task DeleteSingleRecordI()
        {
            using (var client = PrivateClient.CreateClient(new PrivateServerSettings()
            {
                ServerUrl = new Uri("http://deletetest-web.dynamic.ps.porters.local"), LoggerFactory = TestLoggerFactoryAttribute.CurrentLoggerFactory
            }))
                using (var session = client.CreateSession(PrivateAuthentication.WithCredentials("TestCompany", "*****@*****.**", "password")))
                {
                    var request = DeleteRecordRequest.Builder().Append(ResourceId.Process, 10001, 10002);

                    var response = await session.CallAsync(request);

                    Assert.That(response.DeletedRecords, Has.Count.EqualTo(1));
                    Assert.That(response.DeletedRecords.Keys, Does.Contain(ResourceId.Process));
                    Assert.That(response.DeletedRecords[ResourceId.Process], Has.Count.EqualTo(2));
                    Assert.That(response.DeletedRecords[ResourceId.Process], Does.Contain(10001));
                    Assert.That(response.DeletedRecords[ResourceId.Process], Does.Contain(10002));
                }
        }
Esempio n. 10
0
        public async Task DeleteSingleRecord()
        {
            using (var mocker = HrbcVersion.Trunk.ToRequestMocker())
                using (var session = mocker.Session)
                {
                    mocker.WhenRequest(HttpRequestConstraint.HttpRequest()
                                       .WithUri("privateapi/generic/resource-record",
                                                "?data%5B0%5D%5Bresource%5D=5&data%5B0%5D%5Bdelete%5D%5B0%5D=5")
                                       .WithMethod(HttpMethod.Delete)
                                       .WithAnyContent())
                    .RespondWith("{'ids':[[5]]}");

                    var request = DeleteRecordRequest.Builder().Append(ResourceId.Client, 5);

                    var response = await session.CallAsync(request);

                    Assert.That(response.DeletedRecords, Has.Count.EqualTo(1));
                    Assert.That(response.DeletedRecords.Keys, Does.Contain(ResourceId.Client));
                    Assert.That(response.DeletedRecords[ResourceId.Client], Has.Count.EqualTo(1));
                    Assert.That(response.DeletedRecords[ResourceId.Client], Does.Contain(5));
                }
        }