private Amazon.DeviceFarm.Model.CreateRemoteAccessSessionResponse CallAWSServiceOperation(IAmazonDeviceFarm client, Amazon.DeviceFarm.Model.CreateRemoteAccessSessionRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Device Farm", "CreateRemoteAccessSession"); try { #if DESKTOP return(client.CreateRemoteAccessSession(request)); #elif CORECLR return(client.CreateRemoteAccessSessionAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.DeviceFarm.Model.CreateRemoteAccessSessionRequest(); if (cmdletContext.ClientId != null) { request.ClientId = cmdletContext.ClientId; } // populate Configuration var requestConfigurationIsNull = true; request.Configuration = new Amazon.DeviceFarm.Model.CreateRemoteAccessSessionConfiguration(); Amazon.DeviceFarm.BillingMethod requestConfiguration_configuration_BillingMethod = null; if (cmdletContext.Configuration_BillingMethod != null) { requestConfiguration_configuration_BillingMethod = cmdletContext.Configuration_BillingMethod; } if (requestConfiguration_configuration_BillingMethod != null) { request.Configuration.BillingMethod = requestConfiguration_configuration_BillingMethod; requestConfigurationIsNull = false; } List <System.String> requestConfiguration_configuration_VpceConfigurationArn = null; if (cmdletContext.Configuration_VpceConfigurationArn != null) { requestConfiguration_configuration_VpceConfigurationArn = cmdletContext.Configuration_VpceConfigurationArn; } if (requestConfiguration_configuration_VpceConfigurationArn != null) { request.Configuration.VpceConfigurationArns = requestConfiguration_configuration_VpceConfigurationArn; requestConfigurationIsNull = false; } // determine if request.Configuration should be set to null if (requestConfigurationIsNull) { request.Configuration = null; } if (cmdletContext.DeviceArn != null) { request.DeviceArn = cmdletContext.DeviceArn; } if (cmdletContext.InstanceArn != null) { request.InstanceArn = cmdletContext.InstanceArn; } if (cmdletContext.InteractionMode != null) { request.InteractionMode = cmdletContext.InteractionMode; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.ProjectArn != null) { request.ProjectArn = cmdletContext.ProjectArn; } if (cmdletContext.RemoteDebugEnabled != null) { request.RemoteDebugEnabled = cmdletContext.RemoteDebugEnabled.Value; } if (cmdletContext.RemoteRecordAppArn != null) { request.RemoteRecordAppArn = cmdletContext.RemoteRecordAppArn; } if (cmdletContext.RemoteRecordEnabled != null) { request.RemoteRecordEnabled = cmdletContext.RemoteRecordEnabled.Value; } if (cmdletContext.SkipAppResign != null) { request.SkipAppResign = cmdletContext.SkipAppResign.Value; } if (cmdletContext.SshPublicKey != null) { request.SshPublicKey = cmdletContext.SshPublicKey; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
internal CreateRemoteAccessSessionResponse CreateRemoteAccessSession(CreateRemoteAccessSessionRequest request) { var marshaller = new CreateRemoteAccessSessionRequestMarshaller(); var unmarshaller = CreateRemoteAccessSessionResponseUnmarshaller.Instance; return Invoke<CreateRemoteAccessSessionRequest,CreateRemoteAccessSessionResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateRemoteAccessSession operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateRemoteAccessSession 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<CreateRemoteAccessSessionResponse> CreateRemoteAccessSessionAsync(CreateRemoteAccessSessionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateRemoteAccessSessionRequestMarshaller(); var unmarshaller = CreateRemoteAccessSessionResponseUnmarshaller.Instance; return InvokeAsync<CreateRemoteAccessSessionRequest,CreateRemoteAccessSessionResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the CreateRemoteAccessSession operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateRemoteAccessSession operation on AmazonDeviceFarmClient.</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 EndCreateRemoteAccessSession /// operation.</returns> public IAsyncResult BeginCreateRemoteAccessSession(CreateRemoteAccessSessionRequest request, AsyncCallback callback, object state) { var marshaller = new CreateRemoteAccessSessionRequestMarshaller(); var unmarshaller = CreateRemoteAccessSessionResponseUnmarshaller.Instance; return BeginInvoke<CreateRemoteAccessSessionRequest>(request, marshaller, unmarshaller, callback, state); }