Information about the AccessLog attribute.
示例#1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.ElasticLoadBalancing.Model.ModifyLoadBalancerAttributesRequest();


            // populate LoadBalancerAttributes
            var requestLoadBalancerAttributesIsNull = true;

            request.LoadBalancerAttributes = new Amazon.ElasticLoadBalancing.Model.LoadBalancerAttributes();
            List <Amazon.ElasticLoadBalancing.Model.AdditionalAttribute> requestLoadBalancerAttributes_loadBalancerAttributes_AdditionalAttribute = null;

            if (cmdletContext.LoadBalancerAttributes_AdditionalAttribute != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AdditionalAttribute = cmdletContext.LoadBalancerAttributes_AdditionalAttribute;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AdditionalAttribute != null)
            {
                request.LoadBalancerAttributes.AdditionalAttributes = requestLoadBalancerAttributes_loadBalancerAttributes_AdditionalAttribute;
                requestLoadBalancerAttributesIsNull = false;
            }
            Amazon.ElasticLoadBalancing.Model.ConnectionSettings requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings = null;

            // populate ConnectionSettings
            var requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettingsIsNull = true;

            requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings = new Amazon.ElasticLoadBalancing.Model.ConnectionSettings();
            System.Int32?requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings_connectionSettings_IdleTimeout = null;
            if (cmdletContext.ConnectionSettings_IdleTimeout != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings_connectionSettings_IdleTimeout = cmdletContext.ConnectionSettings_IdleTimeout.Value;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings_connectionSettings_IdleTimeout != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings.IdleTimeout = requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings_connectionSettings_IdleTimeout.Value;
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettingsIsNull       = false;
            }
            // determine if requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings should be set to null
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettingsIsNull)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings = null;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings != null)
            {
                request.LoadBalancerAttributes.ConnectionSettings = requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionSettings;
                requestLoadBalancerAttributesIsNull = false;
            }
            Amazon.ElasticLoadBalancing.Model.CrossZoneLoadBalancing requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing = null;

            // populate CrossZoneLoadBalancing
            var requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancingIsNull = true;

            requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing = new Amazon.ElasticLoadBalancing.Model.CrossZoneLoadBalancing();
            System.Boolean?requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing_crossZoneLoadBalancing_Enabled = null;
            if (cmdletContext.CrossZoneLoadBalancing_Enabled != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing_crossZoneLoadBalancing_Enabled = cmdletContext.CrossZoneLoadBalancing_Enabled.Value;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing_crossZoneLoadBalancing_Enabled != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing.Enabled = requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing_crossZoneLoadBalancing_Enabled.Value;
                requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancingIsNull   = false;
            }
            // determine if requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing should be set to null
            if (requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancingIsNull)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing = null;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing != null)
            {
                request.LoadBalancerAttributes.CrossZoneLoadBalancing = requestLoadBalancerAttributes_loadBalancerAttributes_CrossZoneLoadBalancing;
                requestLoadBalancerAttributesIsNull = false;
            }
            Amazon.ElasticLoadBalancing.Model.ConnectionDraining requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining = null;

            // populate ConnectionDraining
            var requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDrainingIsNull = true;

            requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining = new Amazon.ElasticLoadBalancing.Model.ConnectionDraining();
            System.Boolean?requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Enabled = null;
            if (cmdletContext.ConnectionDraining_Enabled != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Enabled = cmdletContext.ConnectionDraining_Enabled.Value;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Enabled != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining.Enabled = requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Enabled.Value;
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDrainingIsNull   = false;
            }
            System.Int32?requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Timeout = null;
            if (cmdletContext.ConnectionDraining_Timeout != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Timeout = cmdletContext.ConnectionDraining_Timeout.Value;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Timeout != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining.Timeout = requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining_connectionDraining_Timeout.Value;
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDrainingIsNull   = false;
            }
            // determine if requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining should be set to null
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDrainingIsNull)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining = null;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining != null)
            {
                request.LoadBalancerAttributes.ConnectionDraining = requestLoadBalancerAttributes_loadBalancerAttributes_ConnectionDraining;
                requestLoadBalancerAttributesIsNull = false;
            }
            Amazon.ElasticLoadBalancing.Model.AccessLog requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog = null;

            // populate AccessLog
            var requestLoadBalancerAttributes_loadBalancerAttributes_AccessLogIsNull = true;

            requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog = new Amazon.ElasticLoadBalancing.Model.AccessLog();
            System.Int32?requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_EmitInterval = null;
            if (cmdletContext.AccessLog_EmitInterval != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_EmitInterval = cmdletContext.AccessLog_EmitInterval.Value;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_EmitInterval != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog.EmitInterval = requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_EmitInterval.Value;
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLogIsNull        = false;
            }
            System.Boolean?requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_Enabled = null;
            if (cmdletContext.AccessLog_Enabled != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_Enabled = cmdletContext.AccessLog_Enabled.Value;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_Enabled != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog.Enabled = requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_Enabled.Value;
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLogIsNull   = false;
            }
            System.String requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketName = null;
            if (cmdletContext.AccessLog_S3BucketName != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketName = cmdletContext.AccessLog_S3BucketName;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketName != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog.S3BucketName = requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketName;
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLogIsNull        = false;
            }
            System.String requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketPrefix = null;
            if (cmdletContext.AccessLog_S3BucketPrefix != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketPrefix = cmdletContext.AccessLog_S3BucketPrefix;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketPrefix != null)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog.S3BucketPrefix = requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog_accessLog_S3BucketPrefix;
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLogIsNull          = false;
            }
            // determine if requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog should be set to null
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AccessLogIsNull)
            {
                requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog = null;
            }
            if (requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog != null)
            {
                request.LoadBalancerAttributes.AccessLog = requestLoadBalancerAttributes_loadBalancerAttributes_AccessLog;
                requestLoadBalancerAttributesIsNull      = false;
            }
            // determine if request.LoadBalancerAttributes should be set to null
            if (requestLoadBalancerAttributesIsNull)
            {
                request.LoadBalancerAttributes = null;
            }
            if (cmdletContext.LoadBalancerName != null)
            {
                request.LoadBalancerName = cmdletContext.LoadBalancerName;
            }

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