/// <summary> /// Initiates the asynchronous execution of the GetHealthCheck operation. /// <seealso cref="Amazon.Route53.IAmazonRoute53.GetHealthCheck"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetHealthCheck operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <GetHealthCheckResponse> GetHealthCheckAsync(GetHealthCheckRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetHealthCheckRequestMarshaller(); var unmarshaller = GetHealthCheckResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, GetHealthCheckRequest, GetHealthCheckResponse>(request, marshaller, unmarshaller, signer, cancellationToken)); }
internal GetHealthCheckResponse GetHealthCheck(GetHealthCheckRequest request) { var marshaller = new GetHealthCheckRequestMarshaller(); var unmarshaller = GetHealthCheckResponseUnmarshaller.Instance; return(Invoke <GetHealthCheckRequest, GetHealthCheckResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the GetHealthCheck operation. /// <seealso cref="Amazon.Route53.IAmazonRoute53"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetHealthCheck operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task <GetHealthCheckResponse> GetHealthCheckAsync(GetHealthCheckRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new GetHealthCheckRequestMarshaller(); var unmarshaller = GetHealthCheckResponseUnmarshaller.Instance; return(InvokeAsync <GetHealthCheckRequest, GetHealthCheckResponse>(request, marshaller, unmarshaller, cancellationToken)); }
public GetHealthCheckResponse Get(GetHealthCheckRequest request) { return(new GetHealthCheckResponse { Name = HostContext.ServiceName, Version = HostContext.AppHost.GetAssemblyFileVersion() }); }
/// <summary> /// <para> To retrieve the health check, send a <c>GET</c> request to the <c>2013-04-01/healthcheck/health check ID </c> resource. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the GetHealthCheck service method on /// AmazonRoute53.</param> /// /// <returns>The response from the GetHealthCheck service method, as returned by AmazonRoute53.</returns> /// /// <exception cref="T:Amazon.Route53.Model.NoSuchHealthCheckException" /> /// <exception cref="T:Amazon.Route53.Model.IncompatibleVersionException" /> /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" /> public GetHealthCheckResponse GetHealthCheck(GetHealthCheckRequest request) { var task = GetHealthCheckAsync(request); try { return(task.Result); } catch (AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return(null); } }
/// <summary>Snippet for Get</summary> public void GetRequestObject() { // Snippet: Get(GetHealthCheckRequest, CallSettings) // Create client HealthChecksClient healthChecksClient = HealthChecksClient.Create(); // Initialize request argument(s) GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "", HealthCheck = "", }; // Make the request HealthCheck response = healthChecksClient.Get(request); // End snippet }
/// <summary>Snippet for GetAsync</summary> public async Task GetRequestObjectAsync() { // Snippet: GetAsync(GetHealthCheckRequest, CallSettings) // Additional: GetAsync(GetHealthCheckRequest, CancellationToken) // Create client HealthChecksClient healthChecksClient = await HealthChecksClient.CreateAsync(); // Initialize request argument(s) GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "", HealthCheck = "", }; // Make the request HealthCheck response = await healthChecksClient.GetAsync(request); // End snippet }
public async stt::Task GetRequestObjectAsync() { moq::Mock <HealthChecks.HealthChecksClient> mockGrpcClient = new moq::Mock <HealthChecks.HealthChecksClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object); GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "projectaa6ff846", HealthCheck = "health_check13a16219", }; HealthCheck expectedResponse = new HealthCheck { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", Type = HealthCheck.Types.Type.Tcp, Http2HealthCheck = new HTTP2HealthCheck(), CreationTimestamp = "creation_timestamp235e59a1", TimeoutSec = -1529270667, GrpcHealthCheck = new GRPCHealthCheck(), Region = "regionedb20d96", UnhealthyThreshold = -790413526, SslHealthCheck = new SSLHealthCheck(), CheckIntervalSec = 932847778, LogConfig = new HealthCheckLogConfig(), HealthyThreshold = -1266282289, HttpHealthCheck = new HTTPHealthCheck(), Description = "description2cf9da67", HttpsHealthCheck = new HTTPSHealthCheck(), SelfLink = "self_link7e87f12d", TcpHealthCheck = new TCPHealthCheck(), }; mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <HealthCheck>(stt::Task.FromResult(expectedResponse), null, null, null, null)); HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); HealthCheck responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); HealthCheck responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void Get() { moq::Mock <HealthChecks.HealthChecksClient> mockGrpcClient = new moq::Mock <HealthChecks.HealthChecksClient>(moq::MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object); GetHealthCheckRequest request = new GetHealthCheckRequest { Project = "projectaa6ff846", HealthCheck = "health_check13a16219", }; HealthCheck expectedResponse = new HealthCheck { Id = 11672635353343658936UL, Kind = "kindf7aa39d9", Name = "name1c9368b0", Type = "typee2cc9d59", Http2HealthCheck = new HTTP2HealthCheck(), CreationTimestamp = "creation_timestamp235e59a1", TimeoutSec = -1529270667, GrpcHealthCheck = new GRPCHealthCheck(), Region = "regionedb20d96", UnhealthyThreshold = -790413526, SslHealthCheck = new SSLHealthCheck(), CheckIntervalSec = 932847778, LogConfig = new HealthCheckLogConfig(), HealthyThreshold = -1266282289, HttpHealthCheck = new HTTPHealthCheck(), Description = "description2cf9da67", HttpsHealthCheck = new HTTPSHealthCheck(), SelfLink = "self_link7e87f12d", TcpHealthCheck = new TCPHealthCheck(), }; mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); HealthChecksClient client = new HealthChecksClientImpl(mockGrpcClient.Object, null); HealthCheck response = client.Get(request.Project, request.HealthCheck); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public virtual Task <GetHealthCheckResponse> GetHealthCheckAsync(GetHealthCheckRequest request, CancellationToken cancellationToken = default(CancellationToken)) { throw new NotImplementedException(); }