1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package mediaconvert
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/mediaconvert/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Modify one of your existing job templates.
15func (c *Client) UpdateJobTemplate(ctx context.Context, params *UpdateJobTemplateInput, optFns ...func(*Options)) (*UpdateJobTemplateOutput, error) {
16	if params == nil {
17		params = &UpdateJobTemplateInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "UpdateJobTemplate", params, optFns, c.addOperationUpdateJobTemplateMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*UpdateJobTemplateOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type UpdateJobTemplateInput struct {
31
32	// The name of the job template you are modifying
33	//
34	// This member is required.
35	Name *string
36
37	// Accelerated transcoding can significantly speed up jobs with long, visually
38	// complex content. Outputs that use this feature incur pro-tier pricing. For
39	// information about feature limitations, see the AWS Elemental MediaConvert User
40	// Guide.
41	AccelerationSettings *types.AccelerationSettings
42
43	// The new category for the job template, if you are changing it.
44	Category *string
45
46	// The new description for the job template, if you are changing it.
47	Description *string
48
49	// Optional list of hop destinations.
50	HopDestinations []types.HopDestination
51
52	// Specify the relative priority for this job. In any given queue, the service
53	// begins processing the job with the highest value first. When more than one job
54	// has the same priority, the service begins processing the job that you submitted
55	// first. If you don't specify a priority, the service uses the default value 0.
56	Priority int32
57
58	// The new queue for the job template, if you are changing it.
59	Queue *string
60
61	// JobTemplateSettings contains all the transcode settings saved in the template
62	// that will be applied to jobs created from it.
63	Settings *types.JobTemplateSettings
64
65	// Specify how often MediaConvert sends STATUS_UPDATE events to Amazon CloudWatch
66	// Events. Set the interval, in seconds, between status updates. MediaConvert sends
67	// an update at this interval from the time the service begins processing your job
68	// to the time it completes the transcode or encounters an error.
69	StatusUpdateInterval types.StatusUpdateInterval
70
71	noSmithyDocumentSerde
72}
73
74type UpdateJobTemplateOutput struct {
75
76	// A job template is a pre-made set of encoding instructions that you can use to
77	// quickly create a job.
78	JobTemplate *types.JobTemplate
79
80	// Metadata pertaining to the operation's result.
81	ResultMetadata middleware.Metadata
82
83	noSmithyDocumentSerde
84}
85
86func (c *Client) addOperationUpdateJobTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
87	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateJobTemplate{}, middleware.After)
88	if err != nil {
89		return err
90	}
91	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateJobTemplate{}, middleware.After)
92	if err != nil {
93		return err
94	}
95	if err = addSetLoggerMiddleware(stack, options); err != nil {
96		return err
97	}
98	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
99		return err
100	}
101	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
102		return err
103	}
104	if err = addResolveEndpointMiddleware(stack, options); err != nil {
105		return err
106	}
107	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
108		return err
109	}
110	if err = addRetryMiddlewares(stack, options); err != nil {
111		return err
112	}
113	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
114		return err
115	}
116	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
117		return err
118	}
119	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
120		return err
121	}
122	if err = addClientUserAgent(stack); err != nil {
123		return err
124	}
125	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addOpUpdateJobTemplateValidationMiddleware(stack); err != nil {
132		return err
133	}
134	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateJobTemplate(options.Region), middleware.Before); err != nil {
135		return err
136	}
137	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
138		return err
139	}
140	if err = addResponseErrorMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addRequestResponseLogging(stack, options); err != nil {
144		return err
145	}
146	return nil
147}
148
149func newServiceMetadataMiddleware_opUpdateJobTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
150	return &awsmiddleware.RegisterServiceMetadata{
151		Region:        region,
152		ServiceID:     ServiceID,
153		SigningName:   "mediaconvert",
154		OperationName: "UpdateJobTemplate",
155	}
156}
157