1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package datapipeline
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/datapipeline/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Task runners call SetTaskStatus to notify AWS Data Pipeline that a task is
15// completed and provide information about the final status. A task runner makes
16// this call regardless of whether the task was sucessful. A task runner does not
17// need to call SetTaskStatus for tasks that are canceled by the web service during
18// a call to ReportTaskProgress. POST / HTTP/1.1 Content-Type:
19// application/x-amz-json-1.1 X-Amz-Target: DataPipeline.SetTaskStatus
20// Content-Length: 847 Host: datapipeline.us-east-1.amazonaws.com X-Amz-Date: Mon,
21// 12 Nov 2012 17:49:52 GMT Authorization: AuthParams {"taskId":
22// "aaGgHT4LuH0T0Y0oLrJRjas5qH0d8cDPADxqq3tn+zCWGELkCdV2JprLreXm1oxeP5EFZHFLJ69kjSsLYE0iYHYBYVGBrB+E/pYq7ANEEeGJFnSBMRiXZVA+8UJ3OzcInvXeinqBmBaKwii7hnnKb/AXjXiNTXyxgydX1KAyg1AxkwBYG4cfPYMZbuEbQJFJvv5C/2+GVXz1w94nKYTeUeepwUOFOuRLS6JVtZoYwpF56E+Yfk1IcGpFOvCZ01B4Bkuu7x3J+MD/j6kJgZLAgbCJQtI3eiW3kdGmX0p0I2BdY1ZsX6b4UiSvM3OMj6NEHJCJL4E0ZfitnhCoe24Kvjo6C2hFbZq+ei/HPgSXBQMSagkr4vS9c0ChzxH2+LNYvec6bY4kymkaZI1dvOzmpa0FcnGf5AjSK4GpsViZ/ujz6zxFv81qBXzjF0/4M1775rjV1VUdyKaixiA/sJiACNezqZqETidp8d24BDPRhGsj6pBCrnelqGFrk/gXEXUsJ+xwMifRC8UVwiKekpAvHUywVk7Ku4jH/n3i2VoLRP6FXwpUbelu34iiZ9czpXyLtyPKwxa87dlrnRVURwkcVjOt2Mcrcaqe+cbWHvNRhyrPkkdfSF3ac8/wfgVbXvLEB2k9mKc67aD9rvdc1PKX09Tk8BKklsMTpZ3TRCd4NzQlJKigMe8Jat9+1tKj4Ole5ZzW6uyTu2s2iFjEV8KXu4MaiRJyNKCdKeGhhZWY37Qk4NBK4Ppgu+C6Y41dpfOh288SLDEVx0/UySlqOEdhba7c6BiPp5r3hKj3mk9lFy5OYp1aoGLeeFmjXveTnPdf2gkWqXXg7AUbJ7jEs1F0lKZQg4szep2gcKyAJXgvXLfJJHcha8Lfb/Ee7wYmyOcAaRpDBoFNSbtoVXar46teIrpho+ZDvynUXvU0grHWGOk=:wn3SgymHZM99bEXAMPLE",
23// "taskStatus": "FINISHED"} x-amzn-RequestId: 8c8deb53-0788-11e2-af9c-6bc7a6be6qr8
24// Content-Type: application/x-amz-json-1.1 Content-Length: 0 Date: Mon, 12 Nov
25// 2012 17:50:53 GMT {}
26func (c *Client) SetTaskStatus(ctx context.Context, params *SetTaskStatusInput, optFns ...func(*Options)) (*SetTaskStatusOutput, error) {
27	if params == nil {
28		params = &SetTaskStatusInput{}
29	}
30
31	result, metadata, err := c.invokeOperation(ctx, "SetTaskStatus", params, optFns, c.addOperationSetTaskStatusMiddlewares)
32	if err != nil {
33		return nil, err
34	}
35
36	out := result.(*SetTaskStatusOutput)
37	out.ResultMetadata = metadata
38	return out, nil
39}
40
41// Contains the parameters for SetTaskStatus.
42type SetTaskStatusInput struct {
43
44	// The ID of the task assigned to the task runner. This value is provided in the
45	// response for PollForTask.
46	//
47	// This member is required.
48	TaskId *string
49
50	// If FINISHED, the task successfully completed. If FAILED, the task ended
51	// unsuccessfully. Preconditions use false.
52	//
53	// This member is required.
54	TaskStatus types.TaskStatus
55
56	// If an error occurred during the task, this value specifies the error code. This
57	// value is set on the physical attempt object. It is used to display error
58	// information to the user. It should not start with string "Service_" which is
59	// reserved by the system.
60	ErrorId *string
61
62	// If an error occurred during the task, this value specifies a text description of
63	// the error. This value is set on the physical attempt object. It is used to
64	// display error information to the user. The web service does not parse this
65	// value.
66	ErrorMessage *string
67
68	// If an error occurred during the task, this value specifies the stack trace
69	// associated with the error. This value is set on the physical attempt object. It
70	// is used to display error information to the user. The web service does not parse
71	// this value.
72	ErrorStackTrace *string
73
74	noSmithyDocumentSerde
75}
76
77// Contains the output of SetTaskStatus.
78type SetTaskStatusOutput struct {
79	// Metadata pertaining to the operation's result.
80	ResultMetadata middleware.Metadata
81
82	noSmithyDocumentSerde
83}
84
85func (c *Client) addOperationSetTaskStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
86	err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetTaskStatus{}, middleware.After)
87	if err != nil {
88		return err
89	}
90	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetTaskStatus{}, middleware.After)
91	if err != nil {
92		return err
93	}
94	if err = addSetLoggerMiddleware(stack, options); err != nil {
95		return err
96	}
97	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
98		return err
99	}
100	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
101		return err
102	}
103	if err = addResolveEndpointMiddleware(stack, options); err != nil {
104		return err
105	}
106	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
107		return err
108	}
109	if err = addRetryMiddlewares(stack, options); err != nil {
110		return err
111	}
112	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
113		return err
114	}
115	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
116		return err
117	}
118	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
119		return err
120	}
121	if err = addClientUserAgent(stack); err != nil {
122		return err
123	}
124	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
125		return err
126	}
127	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
128		return err
129	}
130	if err = addOpSetTaskStatusValidationMiddleware(stack); err != nil {
131		return err
132	}
133	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetTaskStatus(options.Region), middleware.Before); err != nil {
134		return err
135	}
136	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
137		return err
138	}
139	if err = addResponseErrorMiddleware(stack); err != nil {
140		return err
141	}
142	if err = addRequestResponseLogging(stack, options); err != nil {
143		return err
144	}
145	return nil
146}
147
148func newServiceMetadataMiddleware_opSetTaskStatus(region string) *awsmiddleware.RegisterServiceMetadata {
149	return &awsmiddleware.RegisterServiceMetadata{
150		Region:        region,
151		ServiceID:     ServiceID,
152		SigningName:   "datapipeline",
153		OperationName: "SetTaskStatus",
154	}
155}
156