// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package appconfig import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) type UpdateDeploymentStrategyInput struct { _ struct{} `type:"structure"` // Total amount of time for a deployment to last. DeploymentDurationInMinutes *int64 `type:"integer"` // The deployment strategy ID. // // DeploymentStrategyId is a required field DeploymentStrategyId *string `location:"uri" locationName:"DeploymentStrategyId" type:"string" required:"true"` // A description of the deployment strategy. Description *string `type:"string"` // The amount of time AppConfig monitors for alarms before considering the deployment // to be complete and no longer eligible for automatic roll back. FinalBakeTimeInMinutes *int64 `type:"integer"` // The percentage of targets to receive a deployed configuration during each // interval. GrowthFactor *float64 `min:"1" type:"float"` // The algorithm used to define how percentage grows over time. AWS AppConfig // supports the following growth types: // // Linear: For this type, AppConfig processes the deployment by increments of // the growth factor evenly distributed over the deployment time. For example, // a linear deployment that uses a growth factor of 20 initially makes the configuration // available to 20 percent of the targets. After 1/5th of the deployment time // has passed, the system updates the percentage to 40 percent. This continues // until 100% of the targets are set to receive the deployed configuration. // // Exponential: For this type, AppConfig processes the deployment exponentially // using the following formula: G*(2^N). In this formula, G is the growth factor // specified by the user and N is the number of steps until the configuration // is deployed to all targets. For example, if you specify a growth factor of // 2, then the system rolls out the configuration as follows: // // 2*(2^0) // // 2*(2^1) // // 2*(2^2) // // Expressed numerically, the deployment rolls out as follows: 2% of the targets, // 4% of the targets, 8% of the targets, and continues until the configuration // has been deployed to all targets. GrowthType GrowthType `type:"string" enum:"true"` } // String returns the string representation func (s UpdateDeploymentStrategyInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateDeploymentStrategyInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "UpdateDeploymentStrategyInput"} if s.DeploymentStrategyId == nil { invalidParams.Add(aws.NewErrParamRequired("DeploymentStrategyId")) } if s.GrowthFactor != nil && *s.GrowthFactor < 1 { invalidParams.Add(aws.NewErrParamMinValue("GrowthFactor", 1)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s UpdateDeploymentStrategyInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if s.DeploymentDurationInMinutes != nil { v := *s.DeploymentDurationInMinutes metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "DeploymentDurationInMinutes", protocol.Int64Value(v), metadata) } if s.Description != nil { v := *s.Description metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "Description", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.FinalBakeTimeInMinutes != nil { v := *s.FinalBakeTimeInMinutes metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "FinalBakeTimeInMinutes", protocol.Int64Value(v), metadata) } if s.GrowthFactor != nil { v := *s.GrowthFactor metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "GrowthFactor", protocol.Float64Value(v), metadata) } if len(s.GrowthType) > 0 { v := s.GrowthType metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "GrowthType", protocol.QuotedValue{ValueMarshaler: v}, metadata) } if s.DeploymentStrategyId != nil { v := *s.DeploymentStrategyId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "DeploymentStrategyId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } return nil } type UpdateDeploymentStrategyOutput struct { _ struct{} `type:"structure"` // Total amount of time the deployment lasted. DeploymentDurationInMinutes *int64 `type:"integer"` // The description of the deployment strategy. Description *string `type:"string"` // The amount of time AppConfig monitored for alarms before considering the // deployment to be complete and no longer eligible for automatic roll back. FinalBakeTimeInMinutes *int64 `type:"integer"` // The percentage of targets that received a deployed configuration during each // interval. GrowthFactor *float64 `min:"1" type:"float"` // The algorithm used to define how percentage grew over time. GrowthType GrowthType `type:"string" enum:"true"` // The deployment strategy ID. Id *string `type:"string"` // The name of the deployment strategy. Name *string `min:"1" type:"string"` // Save the deployment strategy to a Systems Manager (SSM) document. ReplicateTo ReplicateTo `type:"string" enum:"true"` } // String returns the string representation func (s UpdateDeploymentStrategyOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s UpdateDeploymentStrategyOutput) MarshalFields(e protocol.FieldEncoder) error { if s.DeploymentDurationInMinutes != nil { v := *s.DeploymentDurationInMinutes metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "DeploymentDurationInMinutes", protocol.Int64Value(v), metadata) } if s.Description != nil { v := *s.Description metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "Description", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.FinalBakeTimeInMinutes != nil { v := *s.FinalBakeTimeInMinutes metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "FinalBakeTimeInMinutes", protocol.Int64Value(v), metadata) } if s.GrowthFactor != nil { v := *s.GrowthFactor metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "GrowthFactor", protocol.Float64Value(v), metadata) } if len(s.GrowthType) > 0 { v := s.GrowthType metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "GrowthType", protocol.QuotedValue{ValueMarshaler: v}, metadata) } if s.Id != nil { v := *s.Id metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "Id", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.Name != nil { v := *s.Name metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "Name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if len(s.ReplicateTo) > 0 { v := s.ReplicateTo metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "ReplicateTo", protocol.QuotedValue{ValueMarshaler: v}, metadata) } return nil } const opUpdateDeploymentStrategy = "UpdateDeploymentStrategy" // UpdateDeploymentStrategyRequest returns a request value for making API operation for // Amazon AppConfig. // // Updates a deployment strategy. // // // Example sending a request using UpdateDeploymentStrategyRequest. // req := client.UpdateDeploymentStrategyRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/appconfig-2019-10-09/UpdateDeploymentStrategy func (c *Client) UpdateDeploymentStrategyRequest(input *UpdateDeploymentStrategyInput) UpdateDeploymentStrategyRequest { op := &aws.Operation{ Name: opUpdateDeploymentStrategy, HTTPMethod: "PATCH", HTTPPath: "/deploymentstrategies/{DeploymentStrategyId}", } if input == nil { input = &UpdateDeploymentStrategyInput{} } req := c.newRequest(op, input, &UpdateDeploymentStrategyOutput{}) return UpdateDeploymentStrategyRequest{Request: req, Input: input, Copy: c.UpdateDeploymentStrategyRequest} } // UpdateDeploymentStrategyRequest is the request type for the // UpdateDeploymentStrategy API operation. type UpdateDeploymentStrategyRequest struct { *aws.Request Input *UpdateDeploymentStrategyInput Copy func(*UpdateDeploymentStrategyInput) UpdateDeploymentStrategyRequest } // Send marshals and sends the UpdateDeploymentStrategy API request. func (r UpdateDeploymentStrategyRequest) Send(ctx context.Context) (*UpdateDeploymentStrategyResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &UpdateDeploymentStrategyResponse{ UpdateDeploymentStrategyOutput: r.Request.Data.(*UpdateDeploymentStrategyOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // UpdateDeploymentStrategyResponse is the response type for the // UpdateDeploymentStrategy API operation. type UpdateDeploymentStrategyResponse struct { *UpdateDeploymentStrategyOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // UpdateDeploymentStrategy request. func (r *UpdateDeploymentStrategyResponse) SDKResponseMetdata() *aws.Response { return r.response }