public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.StepFunctions.Model.CreateStateMachineRequest(); if (cmdletContext.Definition != null) { request.Definition = cmdletContext.Definition; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.RoleArn != null) { request.RoleArn = cmdletContext.RoleArn; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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); }
private Amazon.StepFunctions.Model.CreateStateMachineResponse CallAWSServiceOperation(IAmazonStepFunctions client, Amazon.StepFunctions.Model.CreateStateMachineRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Step Functions", "CreateStateMachine"); try { #if DESKTOP return(client.CreateStateMachine(request)); #elif CORECLR return(client.CreateStateMachineAsync(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.StepFunctions.Model.CreateStateMachineRequest(); if (cmdletContext.Definition != null) { request.Definition = cmdletContext.Definition; } // populate LoggingConfiguration var requestLoggingConfigurationIsNull = true; request.LoggingConfiguration = new Amazon.StepFunctions.Model.LoggingConfiguration(); List <Amazon.StepFunctions.Model.LogDestination> requestLoggingConfiguration_loggingConfiguration_Destination = null; if (cmdletContext.LoggingConfiguration_Destination != null) { requestLoggingConfiguration_loggingConfiguration_Destination = cmdletContext.LoggingConfiguration_Destination; } if (requestLoggingConfiguration_loggingConfiguration_Destination != null) { request.LoggingConfiguration.Destinations = requestLoggingConfiguration_loggingConfiguration_Destination; requestLoggingConfigurationIsNull = false; } System.Boolean?requestLoggingConfiguration_loggingConfiguration_IncludeExecutionData = null; if (cmdletContext.LoggingConfiguration_IncludeExecutionData != null) { requestLoggingConfiguration_loggingConfiguration_IncludeExecutionData = cmdletContext.LoggingConfiguration_IncludeExecutionData.Value; } if (requestLoggingConfiguration_loggingConfiguration_IncludeExecutionData != null) { request.LoggingConfiguration.IncludeExecutionData = requestLoggingConfiguration_loggingConfiguration_IncludeExecutionData.Value; requestLoggingConfigurationIsNull = false; } Amazon.StepFunctions.LogLevel requestLoggingConfiguration_loggingConfiguration_Level = null; if (cmdletContext.LoggingConfiguration_Level != null) { requestLoggingConfiguration_loggingConfiguration_Level = cmdletContext.LoggingConfiguration_Level; } if (requestLoggingConfiguration_loggingConfiguration_Level != null) { request.LoggingConfiguration.Level = requestLoggingConfiguration_loggingConfiguration_Level; requestLoggingConfigurationIsNull = false; } // determine if request.LoggingConfiguration should be set to null if (requestLoggingConfigurationIsNull) { request.LoggingConfiguration = null; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.RoleArn != null) { request.RoleArn = cmdletContext.RoleArn; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.Type != null) { request.Type = cmdletContext.Type; } 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); }
/// <summary> /// Initiates the asynchronous execution of the CreateStateMachine operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateStateMachine 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<CreateStateMachineResponse> CreateStateMachineAsync(CreateStateMachineRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateStateMachineRequestMarshaller(); var unmarshaller = CreateStateMachineResponseUnmarshaller.Instance; return InvokeAsync<CreateStateMachineRequest,CreateStateMachineResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal CreateStateMachineResponse CreateStateMachine(CreateStateMachineRequest request) { var marshaller = new CreateStateMachineRequestMarshaller(); var unmarshaller = CreateStateMachineResponseUnmarshaller.Instance; return Invoke<CreateStateMachineRequest,CreateStateMachineResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the CreateStateMachine operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateStateMachine operation on AmazonStepFunctionsClient.</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 EndCreateStateMachine /// operation.</returns> public IAsyncResult BeginCreateStateMachine(CreateStateMachineRequest request, AsyncCallback callback, object state) { var marshaller = new CreateStateMachineRequestMarshaller(); var unmarshaller = CreateStateMachineResponseUnmarshaller.Instance; return BeginInvoke<CreateStateMachineRequest>(request, marshaller, unmarshaller, callback, state); }