private Amazon.CloudFormation.Model.RegisterTypeResponse CallAWSServiceOperation(IAmazonCloudFormation client, Amazon.CloudFormation.Model.RegisterTypeRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CloudFormation", "RegisterType"); try { #if DESKTOP return(client.RegisterType(request)); #elif CORECLR return(client.RegisterTypeAsync(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.CloudFormation.Model.RegisterTypeRequest(); if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } if (cmdletContext.ExecutionRoleArn != null) { request.ExecutionRoleArn = cmdletContext.ExecutionRoleArn; } // populate LoggingConfig var requestLoggingConfigIsNull = true; request.LoggingConfig = new Amazon.CloudFormation.Model.LoggingConfig(); System.String requestLoggingConfig_loggingConfig_LogGroupName = null; if (cmdletContext.LoggingConfig_LogGroupName != null) { requestLoggingConfig_loggingConfig_LogGroupName = cmdletContext.LoggingConfig_LogGroupName; } if (requestLoggingConfig_loggingConfig_LogGroupName != null) { request.LoggingConfig.LogGroupName = requestLoggingConfig_loggingConfig_LogGroupName; requestLoggingConfigIsNull = false; } System.String requestLoggingConfig_loggingConfig_LogRoleArn = null; if (cmdletContext.LoggingConfig_LogRoleArn != null) { requestLoggingConfig_loggingConfig_LogRoleArn = cmdletContext.LoggingConfig_LogRoleArn; } if (requestLoggingConfig_loggingConfig_LogRoleArn != null) { request.LoggingConfig.LogRoleArn = requestLoggingConfig_loggingConfig_LogRoleArn; requestLoggingConfigIsNull = false; } // determine if request.LoggingConfig should be set to null if (requestLoggingConfigIsNull) { request.LoggingConfig = null; } if (cmdletContext.SchemaHandlerPackage != null) { request.SchemaHandlerPackage = cmdletContext.SchemaHandlerPackage; } if (cmdletContext.Type != null) { request.Type = cmdletContext.Type; } if (cmdletContext.TypeName != null) { request.TypeName = cmdletContext.TypeName; } 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); }