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, 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
75// Contains the output of SetTaskStatus.
76type SetTaskStatusOutput struct {
77	// Metadata pertaining to the operation's result.
78	ResultMetadata middleware.Metadata
79}
80
81func addOperationSetTaskStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
82	err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetTaskStatus{}, middleware.After)
83	if err != nil {
84		return err
85	}
86	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetTaskStatus{}, middleware.After)
87	if err != nil {
88		return err
89	}
90	if err = addSetLoggerMiddleware(stack, options); err != nil {
91		return err
92	}
93	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
94		return err
95	}
96	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
97		return err
98	}
99	if err = addResolveEndpointMiddleware(stack, options); err != nil {
100		return err
101	}
102	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
103		return err
104	}
105	if err = addRetryMiddlewares(stack, options); err != nil {
106		return err
107	}
108	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
109		return err
110	}
111	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
112		return err
113	}
114	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
115		return err
116	}
117	if err = addClientUserAgent(stack); err != nil {
118		return err
119	}
120	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
121		return err
122	}
123	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
124		return err
125	}
126	if err = addOpSetTaskStatusValidationMiddleware(stack); err != nil {
127		return err
128	}
129	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetTaskStatus(options.Region), middleware.Before); err != nil {
130		return err
131	}
132	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
133		return err
134	}
135	if err = addResponseErrorMiddleware(stack); err != nil {
136		return err
137	}
138	if err = addRequestResponseLogging(stack, options); err != nil {
139		return err
140	}
141	return nil
142}
143
144func newServiceMetadataMiddleware_opSetTaskStatus(region string) *awsmiddleware.RegisterServiceMetadata {
145	return &awsmiddleware.RegisterServiceMetadata{
146		Region:        region,
147		ServiceID:     ServiceID,
148		SigningName:   "datapipeline",
149		OperationName: "SetTaskStatus",
150	}
151}
152