1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package appconfig
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/appconfig/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Retrieve information about a configuration deployment.
16func (c *Client) GetDeployment(ctx context.Context, params *GetDeploymentInput, optFns ...func(*Options)) (*GetDeploymentOutput, error) {
17	if params == nil {
18		params = &GetDeploymentInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "GetDeployment", params, optFns, addOperationGetDeploymentMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*GetDeploymentOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type GetDeploymentInput struct {
32
33	// The ID of the application that includes the deployment you want to get.
34	//
35	// This member is required.
36	ApplicationId *string
37
38	// The sequence number of the deployment.
39	//
40	// This member is required.
41	DeploymentNumber int32
42
43	// The ID of the environment that includes the deployment you want to get.
44	//
45	// This member is required.
46	EnvironmentId *string
47}
48
49type GetDeploymentOutput struct {
50
51	// The ID of the application that was deployed.
52	ApplicationId *string
53
54	// The time the deployment completed.
55	CompletedAt *time.Time
56
57	// Information about the source location of the configuration.
58	ConfigurationLocationUri *string
59
60	// The name of the configuration.
61	ConfigurationName *string
62
63	// The ID of the configuration profile that was deployed.
64	ConfigurationProfileId *string
65
66	// The configuration version that was deployed.
67	ConfigurationVersion *string
68
69	// Total amount of time the deployment lasted.
70	DeploymentDurationInMinutes int32
71
72	// The sequence number of the deployment.
73	DeploymentNumber int32
74
75	// The ID of the deployment strategy that was deployed.
76	DeploymentStrategyId *string
77
78	// The description of the deployment.
79	Description *string
80
81	// The ID of the environment that was deployed.
82	EnvironmentId *string
83
84	// A list containing all events related to a deployment. The most recent events are
85	// displayed first.
86	EventLog []types.DeploymentEvent
87
88	// The amount of time AppConfig monitored for alarms before considering the
89	// deployment to be complete and no longer eligible for automatic roll back.
90	FinalBakeTimeInMinutes int32
91
92	// The percentage of targets to receive a deployed configuration during each
93	// interval.
94	GrowthFactor float32
95
96	// The algorithm used to define how percentage grew over time.
97	GrowthType types.GrowthType
98
99	// The percentage of targets for which the deployment is available.
100	PercentageComplete float32
101
102	// The time the deployment started.
103	StartedAt *time.Time
104
105	// The state of the deployment.
106	State types.DeploymentState
107
108	// Metadata pertaining to the operation's result.
109	ResultMetadata middleware.Metadata
110}
111
112func addOperationGetDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) {
113	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeployment{}, middleware.After)
114	if err != nil {
115		return err
116	}
117	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeployment{}, middleware.After)
118	if err != nil {
119		return err
120	}
121	if err = addSetLoggerMiddleware(stack, options); err != nil {
122		return err
123	}
124	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
125		return err
126	}
127	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
128		return err
129	}
130	if err = addResolveEndpointMiddleware(stack, options); err != nil {
131		return err
132	}
133	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
134		return err
135	}
136	if err = addRetryMiddlewares(stack, options); err != nil {
137		return err
138	}
139	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
140		return err
141	}
142	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
143		return err
144	}
145	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
146		return err
147	}
148	if err = addClientUserAgent(stack); err != nil {
149		return err
150	}
151	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
152		return err
153	}
154	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addOpGetDeploymentValidationMiddleware(stack); err != nil {
158		return err
159	}
160	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeployment(options.Region), middleware.Before); err != nil {
161		return err
162	}
163	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
164		return err
165	}
166	if err = addResponseErrorMiddleware(stack); err != nil {
167		return err
168	}
169	if err = addRequestResponseLogging(stack, options); err != nil {
170		return err
171	}
172	return nil
173}
174
175func newServiceMetadataMiddleware_opGetDeployment(region string) *awsmiddleware.RegisterServiceMetadata {
176	return &awsmiddleware.RegisterServiceMetadata{
177		Region:        region,
178		ServiceID:     ServiceID,
179		SigningName:   "appconfig",
180		OperationName: "GetDeployment",
181	}
182}
183