private Amazon.GameLift.Model.UpdateRuntimeConfigurationResponse CallAWSServiceOperation(IAmazonGameLift client, Amazon.GameLift.Model.UpdateRuntimeConfigurationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon GameLift Service", "UpdateRuntimeConfiguration"); try { #if DESKTOP return(client.UpdateRuntimeConfiguration(request)); #elif CORECLR return(client.UpdateRuntimeConfigurationAsync(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.GameLift.Model.UpdateRuntimeConfigurationRequest(); if (cmdletContext.FleetId != null) { request.FleetId = cmdletContext.FleetId; } // populate RuntimeConfiguration var requestRuntimeConfigurationIsNull = true; request.RuntimeConfiguration = new Amazon.GameLift.Model.RuntimeConfiguration(); System.Int32?requestRuntimeConfiguration_runtimeConfiguration_GameSessionActivationTimeoutSecond = null; if (cmdletContext.RuntimeConfiguration_GameSessionActivationTimeoutSecond != null) { requestRuntimeConfiguration_runtimeConfiguration_GameSessionActivationTimeoutSecond = cmdletContext.RuntimeConfiguration_GameSessionActivationTimeoutSecond.Value; } if (requestRuntimeConfiguration_runtimeConfiguration_GameSessionActivationTimeoutSecond != null) { request.RuntimeConfiguration.GameSessionActivationTimeoutSeconds = requestRuntimeConfiguration_runtimeConfiguration_GameSessionActivationTimeoutSecond.Value; requestRuntimeConfigurationIsNull = false; } System.Int32?requestRuntimeConfiguration_runtimeConfiguration_MaxConcurrentGameSessionActivation = null; if (cmdletContext.RuntimeConfiguration_MaxConcurrentGameSessionActivation != null) { requestRuntimeConfiguration_runtimeConfiguration_MaxConcurrentGameSessionActivation = cmdletContext.RuntimeConfiguration_MaxConcurrentGameSessionActivation.Value; } if (requestRuntimeConfiguration_runtimeConfiguration_MaxConcurrentGameSessionActivation != null) { request.RuntimeConfiguration.MaxConcurrentGameSessionActivations = requestRuntimeConfiguration_runtimeConfiguration_MaxConcurrentGameSessionActivation.Value; requestRuntimeConfigurationIsNull = false; } List <Amazon.GameLift.Model.ServerProcess> requestRuntimeConfiguration_runtimeConfiguration_ServerProcess = null; if (cmdletContext.RuntimeConfiguration_ServerProcess != null) { requestRuntimeConfiguration_runtimeConfiguration_ServerProcess = cmdletContext.RuntimeConfiguration_ServerProcess; } if (requestRuntimeConfiguration_runtimeConfiguration_ServerProcess != null) { request.RuntimeConfiguration.ServerProcesses = requestRuntimeConfiguration_runtimeConfiguration_ServerProcess; requestRuntimeConfigurationIsNull = false; } // determine if request.RuntimeConfiguration should be set to null if (requestRuntimeConfigurationIsNull) { request.RuntimeConfiguration = null; } 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 UpdateRuntimeConfigurationResponse UpdateRuntimeConfiguration(UpdateRuntimeConfigurationRequest request) { var marshaller = new UpdateRuntimeConfigurationRequestMarshaller(); var unmarshaller = UpdateRuntimeConfigurationResponseUnmarshaller.Instance; return Invoke<UpdateRuntimeConfigurationRequest,UpdateRuntimeConfigurationResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the UpdateRuntimeConfiguration operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRuntimeConfiguration 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<UpdateRuntimeConfigurationResponse> UpdateRuntimeConfigurationAsync(UpdateRuntimeConfigurationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateRuntimeConfigurationRequestMarshaller(); var unmarshaller = UpdateRuntimeConfigurationResponseUnmarshaller.Instance; return InvokeAsync<UpdateRuntimeConfigurationRequest,UpdateRuntimeConfigurationResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the UpdateRuntimeConfiguration operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateRuntimeConfiguration operation on AmazonGameLiftClient.</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 EndUpdateRuntimeConfiguration /// operation.</returns> public IAsyncResult BeginUpdateRuntimeConfiguration(UpdateRuntimeConfigurationRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateRuntimeConfigurationRequestMarshaller(); var unmarshaller = UpdateRuntimeConfigurationResponseUnmarshaller.Instance; return BeginInvoke<UpdateRuntimeConfigurationRequest>(request, marshaller, unmarshaller, callback, state); }