1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package iot
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/iot/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Returns information about a job template.
16func (c *Client) DescribeJobTemplate(ctx context.Context, params *DescribeJobTemplateInput, optFns ...func(*Options)) (*DescribeJobTemplateOutput, error) {
17	if params == nil {
18		params = &DescribeJobTemplateInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "DescribeJobTemplate", params, optFns, c.addOperationDescribeJobTemplateMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*DescribeJobTemplateOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type DescribeJobTemplateInput struct {
32
33	// The unique identifier of the job template.
34	//
35	// This member is required.
36	JobTemplateId *string
37
38	noSmithyDocumentSerde
39}
40
41type DescribeJobTemplateOutput struct {
42
43	// The criteria that determine when and how a job abort takes place.
44	AbortConfig *types.AbortConfig
45
46	// The time, in seconds since the epoch, when the job template was created.
47	CreatedAt *time.Time
48
49	// A description of the job template.
50	Description *string
51
52	// The job document.
53	Document *string
54
55	// An S3 link to the job document.
56	DocumentSource *string
57
58	// Allows you to create a staged rollout of a job.
59	JobExecutionsRolloutConfig *types.JobExecutionsRolloutConfig
60
61	// The ARN of the job template.
62	JobTemplateArn *string
63
64	// The unique identifier of the job template.
65	JobTemplateId *string
66
67	// Configuration for pre-signed S3 URLs.
68	PresignedUrlConfig *types.PresignedUrlConfig
69
70	// Specifies the amount of time each device has to finish its execution of the job.
71	// A timer is started when the job execution status is set to IN_PROGRESS. If the
72	// job execution status is not set to another terminal state before the timer
73	// expires, it will be automatically set to TIMED_OUT.
74	TimeoutConfig *types.TimeoutConfig
75
76	// Metadata pertaining to the operation's result.
77	ResultMetadata middleware.Metadata
78
79	noSmithyDocumentSerde
80}
81
82func (c *Client) addOperationDescribeJobTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
83	err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeJobTemplate{}, middleware.After)
84	if err != nil {
85		return err
86	}
87	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeJobTemplate{}, middleware.After)
88	if err != nil {
89		return err
90	}
91	if err = addSetLoggerMiddleware(stack, options); err != nil {
92		return err
93	}
94	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
95		return err
96	}
97	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
98		return err
99	}
100	if err = addResolveEndpointMiddleware(stack, options); err != nil {
101		return err
102	}
103	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
104		return err
105	}
106	if err = addRetryMiddlewares(stack, options); err != nil {
107		return err
108	}
109	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
110		return err
111	}
112	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
113		return err
114	}
115	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
116		return err
117	}
118	if err = addClientUserAgent(stack); err != nil {
119		return err
120	}
121	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
122		return err
123	}
124	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
125		return err
126	}
127	if err = addOpDescribeJobTemplateValidationMiddleware(stack); err != nil {
128		return err
129	}
130	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeJobTemplate(options.Region), middleware.Before); err != nil {
131		return err
132	}
133	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
134		return err
135	}
136	if err = addResponseErrorMiddleware(stack); err != nil {
137		return err
138	}
139	if err = addRequestResponseLogging(stack, options); err != nil {
140		return err
141	}
142	return nil
143}
144
145func newServiceMetadataMiddleware_opDescribeJobTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
146	return &awsmiddleware.RegisterServiceMetadata{
147		Region:        region,
148		ServiceID:     ServiceID,
149		SigningName:   "execute-api",
150		OperationName: "DescribeJobTemplate",
151	}
152}
153