private Amazon.NetworkManager.Model.UpdateSiteResponse CallAWSServiceOperation(IAmazonNetworkManager client, Amazon.NetworkManager.Model.UpdateSiteRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Network Manager", "UpdateSite");
     try
     {
         #if DESKTOP
         return(client.UpdateSite(request));
         #elif CORECLR
         return(client.UpdateSiteAsync(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.NetworkManager.Model.UpdateSiteRequest();

            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.GlobalNetworkId != null)
            {
                request.GlobalNetworkId = cmdletContext.GlobalNetworkId;
            }

            // populate Location
            var requestLocationIsNull = true;

            request.Location = new Amazon.NetworkManager.Model.Location();
            System.String requestLocation_location_Address = null;
            if (cmdletContext.Location_Address != null)
            {
                requestLocation_location_Address = cmdletContext.Location_Address;
            }
            if (requestLocation_location_Address != null)
            {
                request.Location.Address = requestLocation_location_Address;
                requestLocationIsNull    = false;
            }
            System.String requestLocation_location_Latitude = null;
            if (cmdletContext.Location_Latitude != null)
            {
                requestLocation_location_Latitude = cmdletContext.Location_Latitude;
            }
            if (requestLocation_location_Latitude != null)
            {
                request.Location.Latitude = requestLocation_location_Latitude;
                requestLocationIsNull     = false;
            }
            System.String requestLocation_location_Longitude = null;
            if (cmdletContext.Location_Longitude != null)
            {
                requestLocation_location_Longitude = cmdletContext.Location_Longitude;
            }
            if (requestLocation_location_Longitude != null)
            {
                request.Location.Longitude = requestLocation_location_Longitude;
                requestLocationIsNull      = false;
            }
            // determine if request.Location should be set to null
            if (requestLocationIsNull)
            {
                request.Location = null;
            }
            if (cmdletContext.SiteId != null)
            {
                request.SiteId = cmdletContext.SiteId;
            }

            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);
        }