示例#1
0
        /// <summary>Snippet for DeletePredictionApiKeyRegistration</summary>
        public void DeletePredictionApiKeyRegistrationRequestObject()
        {
            // Snippet: DeletePredictionApiKeyRegistration(DeletePredictionApiKeyRegistrationRequest, CallSettings)
            // Create client
            PredictionApiKeyRegistryClient predictionApiKeyRegistryClient = PredictionApiKeyRegistryClient.Create();
            // Initialize request argument(s)
            DeletePredictionApiKeyRegistrationRequest request = new DeletePredictionApiKeyRegistrationRequest
            {
                PredictionApiKeyRegistrationName = PredictionApiKeyRegistrationName.FromProjectLocationCatalogEventStorePredictionApiKeyRegistration("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]"),
            };

            // Make the request
            predictionApiKeyRegistryClient.DeletePredictionApiKeyRegistration(request);
            // End snippet
        }
        public void DeletePredictionApiKeyRegistrationResourceNames()
        {
            moq::Mock <PredictionApiKeyRegistry.PredictionApiKeyRegistryClient> mockGrpcClient = new moq::Mock <PredictionApiKeyRegistry.PredictionApiKeyRegistryClient>(moq::MockBehavior.Strict);
            DeletePredictionApiKeyRegistrationRequest request = new DeletePredictionApiKeyRegistrationRequest
            {
                PredictionApiKeyRegistrationName = PredictionApiKeyRegistrationName.FromProjectLocationCatalogEventStorePredictionApiKeyRegistration("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeletePredictionApiKeyRegistration(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            PredictionApiKeyRegistryClient client = new PredictionApiKeyRegistryClientImpl(mockGrpcClient.Object, null);

            client.DeletePredictionApiKeyRegistration(request.PredictionApiKeyRegistrationName);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task DeletePredictionApiKeyRegistrationResourceNamesAsync()
        {
            moq::Mock <PredictionApiKeyRegistry.PredictionApiKeyRegistryClient> mockGrpcClient = new moq::Mock <PredictionApiKeyRegistry.PredictionApiKeyRegistryClient>(moq::MockBehavior.Strict);
            DeletePredictionApiKeyRegistrationRequest request = new DeletePredictionApiKeyRegistrationRequest
            {
                PredictionApiKeyRegistrationName = PredictionApiKeyRegistrationName.FromProjectLocationCatalogEventStorePredictionApiKeyRegistration("[PROJECT]", "[LOCATION]", "[CATALOG]", "[EVENT_STORE]", "[PREDICTION_API_KEY_REGISTRATION]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeletePredictionApiKeyRegistrationAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            PredictionApiKeyRegistryClient client = new PredictionApiKeyRegistryClientImpl(mockGrpcClient.Object, null);
            await client.DeletePredictionApiKeyRegistrationAsync(request.PredictionApiKeyRegistrationName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeletePredictionApiKeyRegistrationAsync(request.PredictionApiKeyRegistrationName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
 /// <summary>
 /// Unregister an apiKey from using for predict method.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override stt::Task DeletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_DeletePredictionApiKeyRegistrationRequest(ref request, ref callSettings);
     return(_callDeletePredictionApiKeyRegistration.Async(request, callSettings));
 }
 /// <summary>
 /// Unregister an apiKey from using for predict method.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override void DeletePredictionApiKeyRegistration(DeletePredictionApiKeyRegistrationRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_DeletePredictionApiKeyRegistrationRequest(ref request, ref callSettings);
     _callDeletePredictionApiKeyRegistration.Sync(request, callSettings);
 }
 partial void Modify_DeletePredictionApiKeyRegistrationRequest(ref DeletePredictionApiKeyRegistrationRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Unregister an apiKey from using for predict method.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task DeletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest request, st::CancellationToken cancellationToken) =>
 DeletePredictionApiKeyRegistrationAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Unregister an apiKey from using for predict method.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task DeletePredictionApiKeyRegistrationAsync(DeletePredictionApiKeyRegistrationRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();