private Amazon.Lambda.Model.CreateCodeSigningConfigResponse CallAWSServiceOperation(IAmazonLambda client, Amazon.Lambda.Model.CreateCodeSigningConfigRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Lambda", "CreateCodeSigningConfig"); try { #if DESKTOP return(client.CreateCodeSigningConfig(request)); #elif CORECLR return(client.CreateCodeSigningConfigAsync(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.Lambda.Model.CreateCodeSigningConfigRequest(); // populate AllowedPublishers var requestAllowedPublishersIsNull = true; request.AllowedPublishers = new Amazon.Lambda.Model.AllowedPublishers(); List <System.String> requestAllowedPublishers_allowedPublishers_SigningProfileVersionArn = null; if (cmdletContext.AllowedPublishers_SigningProfileVersionArn != null) { requestAllowedPublishers_allowedPublishers_SigningProfileVersionArn = cmdletContext.AllowedPublishers_SigningProfileVersionArn; } if (requestAllowedPublishers_allowedPublishers_SigningProfileVersionArn != null) { request.AllowedPublishers.SigningProfileVersionArns = requestAllowedPublishers_allowedPublishers_SigningProfileVersionArn; requestAllowedPublishersIsNull = false; } // determine if request.AllowedPublishers should be set to null if (requestAllowedPublishersIsNull) { request.AllowedPublishers = null; } // populate CodeSigningPolicies var requestCodeSigningPoliciesIsNull = true; request.CodeSigningPolicies = new Amazon.Lambda.Model.CodeSigningPolicies(); Amazon.Lambda.CodeSigningPolicy requestCodeSigningPolicies_codeSigningPolicies_UntrustedArtifactOnDeployment = null; if (cmdletContext.CodeSigningPolicies_UntrustedArtifactOnDeployment != null) { requestCodeSigningPolicies_codeSigningPolicies_UntrustedArtifactOnDeployment = cmdletContext.CodeSigningPolicies_UntrustedArtifactOnDeployment; } if (requestCodeSigningPolicies_codeSigningPolicies_UntrustedArtifactOnDeployment != null) { request.CodeSigningPolicies.UntrustedArtifactOnDeployment = requestCodeSigningPolicies_codeSigningPolicies_UntrustedArtifactOnDeployment; requestCodeSigningPoliciesIsNull = false; } // determine if request.CodeSigningPolicies should be set to null if (requestCodeSigningPoliciesIsNull) { request.CodeSigningPolicies = null; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } 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); }