internal virtual ImportSshPublicKeyResponse ImportSshPublicKey(ImportSshPublicKeyRequest request) { var marshaller = ImportSshPublicKeyRequestMarshaller.Instance; var unmarshaller = ImportSshPublicKeyResponseUnmarshaller.Instance; return(Invoke <ImportSshPublicKeyRequest, ImportSshPublicKeyResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// Initiates the asynchronous execution of the ImportSshPublicKey operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ImportSshPublicKey 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ImportSshPublicKey">REST API Reference for ImportSshPublicKey Operation</seealso> public virtual Task <ImportSshPublicKeyResponse> ImportSshPublicKeyAsync(ImportSshPublicKeyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = ImportSshPublicKeyRequestMarshaller.Instance; var unmarshaller = ImportSshPublicKeyResponseUnmarshaller.Instance; return(InvokeAsync <ImportSshPublicKeyRequest, ImportSshPublicKeyResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the ImportSshPublicKey operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ImportSshPublicKey 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> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ImportSshPublicKey">REST API Reference for ImportSshPublicKey Operation</seealso> public virtual Task <ImportSshPublicKeyResponse> ImportSshPublicKeyAsync(ImportSshPublicKeyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ImportSshPublicKeyRequestMarshaller.Instance; options.ResponseUnmarshaller = ImportSshPublicKeyResponseUnmarshaller.Instance; return(InvokeAsync <ImportSshPublicKeyResponse>(request, options, cancellationToken)); }
internal virtual ImportSshPublicKeyResponse ImportSshPublicKey(ImportSshPublicKeyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ImportSshPublicKeyRequestMarshaller.Instance; options.ResponseUnmarshaller = ImportSshPublicKeyResponseUnmarshaller.Instance; return(Invoke <ImportSshPublicKeyResponse>(request, options)); }
/// <summary>Snippet for ImportSshPublicKey</summary> public void ImportSshPublicKey_RequestObject() { // Snippet: ImportSshPublicKey(ImportSshPublicKeyRequest,CallSettings) // Create client OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.Create(); // Initialize request argument(s) ImportSshPublicKeyRequest request = new ImportSshPublicKeyRequest { ParentAsUserName = new UserName("[USER]"), SshPublicKey = new SshPublicKey(), }; // Make the request ImportSshPublicKeyResponse response = osLoginServiceClient.ImportSshPublicKey(request); // End snippet }
public async Task ImportSshPublicKeyAsync3() { Mock<OsLoginService.OsLoginServiceClient> mockGrpcClient = new Mock<OsLoginService.OsLoginServiceClient>(MockBehavior.Strict); ImportSshPublicKeyRequest request = new ImportSshPublicKeyRequest { ParentAsUserName = new UserName("[USER]"), SshPublicKey = new SshPublicKey(), }; ImportSshPublicKeyResponse expectedResponse = new ImportSshPublicKeyResponse(); mockGrpcClient.Setup(x => x.ImportSshPublicKeyAsync(request, It.IsAny<CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall<ImportSshPublicKeyResponse>(Task.FromResult(expectedResponse), null, null, null, null)); OsLoginServiceClient client = new OsLoginServiceClientImpl(mockGrpcClient.Object, null); ImportSshPublicKeyResponse response = await client.ImportSshPublicKeyAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void ImportSshPublicKey3() { Mock<OsLoginService.OsLoginServiceClient> mockGrpcClient = new Mock<OsLoginService.OsLoginServiceClient>(MockBehavior.Strict); ImportSshPublicKeyRequest request = new ImportSshPublicKeyRequest { ParentAsUserName = new UserName("[USER]"), SshPublicKey = new SshPublicKey(), }; ImportSshPublicKeyResponse expectedResponse = new ImportSshPublicKeyResponse(); mockGrpcClient.Setup(x => x.ImportSshPublicKey(request, It.IsAny<CallOptions>())) .Returns(expectedResponse); OsLoginServiceClient client = new OsLoginServiceClientImpl(mockGrpcClient.Object, null); ImportSshPublicKeyResponse response = client.ImportSshPublicKey(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for ImportSshPublicKeyAsync</summary> public async Task ImportSshPublicKeyAsync_RequestObject() { // Snippet: ImportSshPublicKeyAsync(ImportSshPublicKeyRequest,CallSettings) // Additional: ImportSshPublicKeyAsync(ImportSshPublicKeyRequest,CancellationToken) // Create client OsLoginServiceClient osLoginServiceClient = await OsLoginServiceClient.CreateAsync(); // Initialize request argument(s) ImportSshPublicKeyRequest request = new ImportSshPublicKeyRequest { ParentAsUserName = new UserName("[USER]"), SshPublicKey = new SshPublicKey(), }; // Make the request ImportSshPublicKeyResponse response = await osLoginServiceClient.ImportSshPublicKeyAsync(request); // End snippet }
public void ImportSshPublicKey2() { Mock<OsLoginService.OsLoginServiceClient> mockGrpcClient = new Mock<OsLoginService.OsLoginServiceClient>(MockBehavior.Strict); ImportSshPublicKeyRequest expectedRequest = new ImportSshPublicKeyRequest { ParentAsUserName = new UserName("[USER]"), SshPublicKey = new SshPublicKey(), ProjectId = "projectId-1969970175", }; ImportSshPublicKeyResponse expectedResponse = new ImportSshPublicKeyResponse(); mockGrpcClient.Setup(x => x.ImportSshPublicKey(expectedRequest, It.IsAny<CallOptions>())) .Returns(expectedResponse); OsLoginServiceClient client = new OsLoginServiceClientImpl(mockGrpcClient.Object, null); UserName parent = new UserName("[USER]"); SshPublicKey sshPublicKey = new SshPublicKey(); string projectId = "projectId-1969970175"; ImportSshPublicKeyResponse response = client.ImportSshPublicKey(parent, sshPublicKey, projectId); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }