private Amazon.CodeGuruReviewer.Model.AssociateRepositoryResponse CallAWSServiceOperation(IAmazonCodeGuruReviewer client, Amazon.CodeGuruReviewer.Model.AssociateRepositoryRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CodeGuru Reviewer", "AssociateRepository"); try { #if DESKTOP return(client.AssociateRepository(request)); #elif CORECLR return(client.AssociateRepositoryAsync(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.CodeGuruReviewer.Model.AssociateRepositoryRequest(); if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } // populate Repository var requestRepositoryIsNull = true; request.Repository = new Amazon.CodeGuruReviewer.Model.Repository(); Amazon.CodeGuruReviewer.Model.CodeCommitRepository requestRepository_repository_CodeCommit = null; // populate CodeCommit var requestRepository_repository_CodeCommitIsNull = true; requestRepository_repository_CodeCommit = new Amazon.CodeGuruReviewer.Model.CodeCommitRepository(); System.String requestRepository_repository_CodeCommit_codeCommit_Name = null; if (cmdletContext.CodeCommit_Name != null) { requestRepository_repository_CodeCommit_codeCommit_Name = cmdletContext.CodeCommit_Name; } if (requestRepository_repository_CodeCommit_codeCommit_Name != null) { requestRepository_repository_CodeCommit.Name = requestRepository_repository_CodeCommit_codeCommit_Name; requestRepository_repository_CodeCommitIsNull = false; } // determine if requestRepository_repository_CodeCommit should be set to null if (requestRepository_repository_CodeCommitIsNull) { requestRepository_repository_CodeCommit = null; } if (requestRepository_repository_CodeCommit != null) { request.Repository.CodeCommit = requestRepository_repository_CodeCommit; requestRepositoryIsNull = false; } Amazon.CodeGuruReviewer.Model.ThirdPartySourceRepository requestRepository_repository_Bitbucket = null; // populate Bitbucket var requestRepository_repository_BitbucketIsNull = true; requestRepository_repository_Bitbucket = new Amazon.CodeGuruReviewer.Model.ThirdPartySourceRepository(); System.String requestRepository_repository_Bitbucket_bitbucket_ConnectionArn = null; if (cmdletContext.Bitbucket_ConnectionArn != null) { requestRepository_repository_Bitbucket_bitbucket_ConnectionArn = cmdletContext.Bitbucket_ConnectionArn; } if (requestRepository_repository_Bitbucket_bitbucket_ConnectionArn != null) { requestRepository_repository_Bitbucket.ConnectionArn = requestRepository_repository_Bitbucket_bitbucket_ConnectionArn; requestRepository_repository_BitbucketIsNull = false; } System.String requestRepository_repository_Bitbucket_bitbucket_Name = null; if (cmdletContext.Bitbucket_Name != null) { requestRepository_repository_Bitbucket_bitbucket_Name = cmdletContext.Bitbucket_Name; } if (requestRepository_repository_Bitbucket_bitbucket_Name != null) { requestRepository_repository_Bitbucket.Name = requestRepository_repository_Bitbucket_bitbucket_Name; requestRepository_repository_BitbucketIsNull = false; } System.String requestRepository_repository_Bitbucket_bitbucket_Owner = null; if (cmdletContext.Bitbucket_Owner != null) { requestRepository_repository_Bitbucket_bitbucket_Owner = cmdletContext.Bitbucket_Owner; } if (requestRepository_repository_Bitbucket_bitbucket_Owner != null) { requestRepository_repository_Bitbucket.Owner = requestRepository_repository_Bitbucket_bitbucket_Owner; requestRepository_repository_BitbucketIsNull = false; } // determine if requestRepository_repository_Bitbucket should be set to null if (requestRepository_repository_BitbucketIsNull) { requestRepository_repository_Bitbucket = null; } if (requestRepository_repository_Bitbucket != null) { request.Repository.Bitbucket = requestRepository_repository_Bitbucket; requestRepositoryIsNull = false; } Amazon.CodeGuruReviewer.Model.ThirdPartySourceRepository requestRepository_repository_GitHubEnterpriseServer = null; // populate GitHubEnterpriseServer var requestRepository_repository_GitHubEnterpriseServerIsNull = true; requestRepository_repository_GitHubEnterpriseServer = new Amazon.CodeGuruReviewer.Model.ThirdPartySourceRepository(); System.String requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_ConnectionArn = null; if (cmdletContext.GitHubEnterpriseServer_ConnectionArn != null) { requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_ConnectionArn = cmdletContext.GitHubEnterpriseServer_ConnectionArn; } if (requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_ConnectionArn != null) { requestRepository_repository_GitHubEnterpriseServer.ConnectionArn = requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_ConnectionArn; requestRepository_repository_GitHubEnterpriseServerIsNull = false; } System.String requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Name = null; if (cmdletContext.GitHubEnterpriseServer_Name != null) { requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Name = cmdletContext.GitHubEnterpriseServer_Name; } if (requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Name != null) { requestRepository_repository_GitHubEnterpriseServer.Name = requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Name; requestRepository_repository_GitHubEnterpriseServerIsNull = false; } System.String requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Owner = null; if (cmdletContext.GitHubEnterpriseServer_Owner != null) { requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Owner = cmdletContext.GitHubEnterpriseServer_Owner; } if (requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Owner != null) { requestRepository_repository_GitHubEnterpriseServer.Owner = requestRepository_repository_GitHubEnterpriseServer_gitHubEnterpriseServer_Owner; requestRepository_repository_GitHubEnterpriseServerIsNull = false; } // determine if requestRepository_repository_GitHubEnterpriseServer should be set to null if (requestRepository_repository_GitHubEnterpriseServerIsNull) { requestRepository_repository_GitHubEnterpriseServer = null; } if (requestRepository_repository_GitHubEnterpriseServer != null) { request.Repository.GitHubEnterpriseServer = requestRepository_repository_GitHubEnterpriseServer; requestRepositoryIsNull = false; } // determine if request.Repository should be set to null if (requestRepositoryIsNull) { request.Repository = 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); }