private Amazon.ECRPublic.Model.CreateRepositoryResponse CallAWSServiceOperation(IAmazonECRPublic client, Amazon.ECRPublic.Model.CreateRepositoryRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic Container Registry Public", "CreateRepository");
     try
     {
         #if DESKTOP
         return(client.CreateRepository(request));
         #elif CORECLR
         return(client.CreateRepositoryAsync(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)
        {
            System.IO.MemoryStream _CatalogData_LogoImageBlobStream = null;

            try
            {
                var cmdletContext = context as CmdletContext;
                // create request
                var request = new Amazon.ECRPublic.Model.CreateRepositoryRequest();


                // populate CatalogData
                var requestCatalogDataIsNull = true;
                request.CatalogData = new Amazon.ECRPublic.Model.RepositoryCatalogDataInput();
                System.String requestCatalogData_catalogData_AboutText = null;
                if (cmdletContext.CatalogData_AboutText != null)
                {
                    requestCatalogData_catalogData_AboutText = cmdletContext.CatalogData_AboutText;
                }
                if (requestCatalogData_catalogData_AboutText != null)
                {
                    request.CatalogData.AboutText = requestCatalogData_catalogData_AboutText;
                    requestCatalogDataIsNull      = false;
                }
                List <System.String> requestCatalogData_catalogData_Architecture = null;
                if (cmdletContext.CatalogData_Architecture != null)
                {
                    requestCatalogData_catalogData_Architecture = cmdletContext.CatalogData_Architecture;
                }
                if (requestCatalogData_catalogData_Architecture != null)
                {
                    request.CatalogData.Architectures = requestCatalogData_catalogData_Architecture;
                    requestCatalogDataIsNull          = false;
                }
                System.String requestCatalogData_catalogData_Description = null;
                if (cmdletContext.CatalogData_Description != null)
                {
                    requestCatalogData_catalogData_Description = cmdletContext.CatalogData_Description;
                }
                if (requestCatalogData_catalogData_Description != null)
                {
                    request.CatalogData.Description = requestCatalogData_catalogData_Description;
                    requestCatalogDataIsNull        = false;
                }
                System.IO.MemoryStream requestCatalogData_catalogData_LogoImageBlob = null;
                if (cmdletContext.CatalogData_LogoImageBlob != null)
                {
                    _CatalogData_LogoImageBlobStream             = new System.IO.MemoryStream(cmdletContext.CatalogData_LogoImageBlob);
                    requestCatalogData_catalogData_LogoImageBlob = _CatalogData_LogoImageBlobStream;
                }
                if (requestCatalogData_catalogData_LogoImageBlob != null)
                {
                    request.CatalogData.LogoImageBlob = requestCatalogData_catalogData_LogoImageBlob;
                    requestCatalogDataIsNull          = false;
                }
                List <System.String> requestCatalogData_catalogData_OperatingSystem = null;
                if (cmdletContext.CatalogData_OperatingSystem != null)
                {
                    requestCatalogData_catalogData_OperatingSystem = cmdletContext.CatalogData_OperatingSystem;
                }
                if (requestCatalogData_catalogData_OperatingSystem != null)
                {
                    request.CatalogData.OperatingSystems = requestCatalogData_catalogData_OperatingSystem;
                    requestCatalogDataIsNull             = false;
                }
                System.String requestCatalogData_catalogData_UsageText = null;
                if (cmdletContext.CatalogData_UsageText != null)
                {
                    requestCatalogData_catalogData_UsageText = cmdletContext.CatalogData_UsageText;
                }
                if (requestCatalogData_catalogData_UsageText != null)
                {
                    request.CatalogData.UsageText = requestCatalogData_catalogData_UsageText;
                    requestCatalogDataIsNull      = false;
                }
                // determine if request.CatalogData should be set to null
                if (requestCatalogDataIsNull)
                {
                    request.CatalogData = null;
                }
                if (cmdletContext.RepositoryName != null)
                {
                    request.RepositoryName = cmdletContext.RepositoryName;
                }
                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);
            }
            finally
            {
                if (_CatalogData_LogoImageBlobStream != null)
                {
                    _CatalogData_LogoImageBlobStream.Dispose();
                }
            }
        }