private Amazon.GreengrassV2.Model.ResolveComponentCandidatesResponse CallAWSServiceOperation(IAmazonGreengrassV2 client, Amazon.GreengrassV2.Model.ResolveComponentCandidatesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS GreengrassV2", "ResolveComponentCandidates");
     try
     {
         #if DESKTOP
         return(client.ResolveComponentCandidates(request));
         #elif CORECLR
         return(client.ResolveComponentCandidatesAsync(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.GreengrassV2.Model.ResolveComponentCandidatesRequest();

            if (cmdletContext.ComponentCandidate != null)
            {
                request.ComponentCandidates = cmdletContext.ComponentCandidate;
            }

            // populate Platform
            var requestPlatformIsNull = true;

            request.Platform = new Amazon.GreengrassV2.Model.ComponentPlatform();
            Dictionary <System.String, System.String> requestPlatform_platform_Attribute = null;

            if (cmdletContext.Platform_Attribute != null)
            {
                requestPlatform_platform_Attribute = cmdletContext.Platform_Attribute;
            }
            if (requestPlatform_platform_Attribute != null)
            {
                request.Platform.Attributes = requestPlatform_platform_Attribute;
                requestPlatformIsNull       = false;
            }
            System.String requestPlatform_platform_Name = null;
            if (cmdletContext.Platform_Name != null)
            {
                requestPlatform_platform_Name = cmdletContext.Platform_Name;
            }
            if (requestPlatform_platform_Name != null)
            {
                request.Platform.Name = requestPlatform_platform_Name;
                requestPlatformIsNull = false;
            }
            // determine if request.Platform should be set to null
            if (requestPlatformIsNull)
            {
                request.Platform = 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);
        }