Beispiel #1
0
 private Amazon.AmplifyUIBuilder.Model.UpdateComponentResponse CallAWSServiceOperation(IAmazonAmplifyUIBuilder client, Amazon.AmplifyUIBuilder.Model.UpdateComponentRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Amplify UI Builder", "UpdateComponent");
     try
     {
         #if DESKTOP
         return(client.UpdateComponent(request));
         #elif CORECLR
         return(client.UpdateComponentAsync(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;
     }
 }
Beispiel #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.AmplifyUIBuilder.Model.UpdateComponentRequest();

            if (cmdletContext.AppId != null)
            {
                request.AppId = cmdletContext.AppId;
            }
            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.EnvironmentName != null)
            {
                request.EnvironmentName = cmdletContext.EnvironmentName;
            }
            if (cmdletContext.Id != null)
            {
                request.Id = cmdletContext.Id;
            }

            // populate UpdatedComponent
            var requestUpdatedComponentIsNull = true;

            request.UpdatedComponent = new Amazon.AmplifyUIBuilder.Model.UpdateComponentData();
            Dictionary <System.String, Amazon.AmplifyUIBuilder.Model.ComponentBindingPropertiesValue> requestUpdatedComponent_updatedComponent_BindingProperty = null;

            if (cmdletContext.UpdatedComponent_BindingProperty != null)
            {
                requestUpdatedComponent_updatedComponent_BindingProperty = cmdletContext.UpdatedComponent_BindingProperty;
            }
            if (requestUpdatedComponent_updatedComponent_BindingProperty != null)
            {
                request.UpdatedComponent.BindingProperties = requestUpdatedComponent_updatedComponent_BindingProperty;
                requestUpdatedComponentIsNull = false;
            }
            List <Amazon.AmplifyUIBuilder.Model.ComponentChild> requestUpdatedComponent_updatedComponent_Child = null;

            if (cmdletContext.UpdatedComponent_Child != null)
            {
                requestUpdatedComponent_updatedComponent_Child = cmdletContext.UpdatedComponent_Child;
            }
            if (requestUpdatedComponent_updatedComponent_Child != null)
            {
                request.UpdatedComponent.Children = requestUpdatedComponent_updatedComponent_Child;
                requestUpdatedComponentIsNull     = false;
            }
            Dictionary <System.String, Amazon.AmplifyUIBuilder.Model.ComponentDataConfiguration> requestUpdatedComponent_updatedComponent_CollectionProperty = null;

            if (cmdletContext.UpdatedComponent_CollectionProperty != null)
            {
                requestUpdatedComponent_updatedComponent_CollectionProperty = cmdletContext.UpdatedComponent_CollectionProperty;
            }
            if (requestUpdatedComponent_updatedComponent_CollectionProperty != null)
            {
                request.UpdatedComponent.CollectionProperties = requestUpdatedComponent_updatedComponent_CollectionProperty;
                requestUpdatedComponentIsNull = false;
            }
            System.String requestUpdatedComponent_updatedComponent_ComponentType = null;
            if (cmdletContext.UpdatedComponent_ComponentType != null)
            {
                requestUpdatedComponent_updatedComponent_ComponentType = cmdletContext.UpdatedComponent_ComponentType;
            }
            if (requestUpdatedComponent_updatedComponent_ComponentType != null)
            {
                request.UpdatedComponent.ComponentType = requestUpdatedComponent_updatedComponent_ComponentType;
                requestUpdatedComponentIsNull          = false;
            }
            System.String requestUpdatedComponent_updatedComponent_Id = null;
            if (cmdletContext.UpdatedComponent_Id != null)
            {
                requestUpdatedComponent_updatedComponent_Id = cmdletContext.UpdatedComponent_Id;
            }
            if (requestUpdatedComponent_updatedComponent_Id != null)
            {
                request.UpdatedComponent.Id   = requestUpdatedComponent_updatedComponent_Id;
                requestUpdatedComponentIsNull = false;
            }
            System.String requestUpdatedComponent_updatedComponent_Name = null;
            if (cmdletContext.UpdatedComponent_Name != null)
            {
                requestUpdatedComponent_updatedComponent_Name = cmdletContext.UpdatedComponent_Name;
            }
            if (requestUpdatedComponent_updatedComponent_Name != null)
            {
                request.UpdatedComponent.Name = requestUpdatedComponent_updatedComponent_Name;
                requestUpdatedComponentIsNull = false;
            }
            Dictionary <System.String, Dictionary <System.String, System.String> > requestUpdatedComponent_updatedComponent_Override = null;

            if (cmdletContext.UpdatedComponent_Override != null)
            {
                requestUpdatedComponent_updatedComponent_Override = cmdletContext.UpdatedComponent_Override;
            }
            if (requestUpdatedComponent_updatedComponent_Override != null)
            {
                request.UpdatedComponent.Overrides = requestUpdatedComponent_updatedComponent_Override;
                requestUpdatedComponentIsNull      = false;
            }
            Dictionary <System.String, Amazon.AmplifyUIBuilder.Model.ComponentProperty> requestUpdatedComponent_updatedComponent_Property = null;

            if (cmdletContext.UpdatedComponent_Property != null)
            {
                requestUpdatedComponent_updatedComponent_Property = cmdletContext.UpdatedComponent_Property;
            }
            if (requestUpdatedComponent_updatedComponent_Property != null)
            {
                request.UpdatedComponent.Properties = requestUpdatedComponent_updatedComponent_Property;
                requestUpdatedComponentIsNull       = false;
            }
            System.String requestUpdatedComponent_updatedComponent_SourceId = null;
            if (cmdletContext.UpdatedComponent_SourceId != null)
            {
                requestUpdatedComponent_updatedComponent_SourceId = cmdletContext.UpdatedComponent_SourceId;
            }
            if (requestUpdatedComponent_updatedComponent_SourceId != null)
            {
                request.UpdatedComponent.SourceId = requestUpdatedComponent_updatedComponent_SourceId;
                requestUpdatedComponentIsNull     = false;
            }
            List <Amazon.AmplifyUIBuilder.Model.ComponentVariant> requestUpdatedComponent_updatedComponent_Variant = null;

            if (cmdletContext.UpdatedComponent_Variant != null)
            {
                requestUpdatedComponent_updatedComponent_Variant = cmdletContext.UpdatedComponent_Variant;
            }
            if (requestUpdatedComponent_updatedComponent_Variant != null)
            {
                request.UpdatedComponent.Variants = requestUpdatedComponent_updatedComponent_Variant;
                requestUpdatedComponentIsNull     = false;
            }
            // determine if request.UpdatedComponent should be set to null
            if (requestUpdatedComponentIsNull)
            {
                request.UpdatedComponent = 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);
        }