1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package location
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/location/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Creates a tracker resource in your AWS account, which lets you retrieve current
16// and historical location of devices.
17func (c *Client) CreateTracker(ctx context.Context, params *CreateTrackerInput, optFns ...func(*Options)) (*CreateTrackerOutput, error) {
18	if params == nil {
19		params = &CreateTrackerInput{}
20	}
21
22	result, metadata, err := c.invokeOperation(ctx, "CreateTracker", params, optFns, addOperationCreateTrackerMiddlewares)
23	if err != nil {
24		return nil, err
25	}
26
27	out := result.(*CreateTrackerOutput)
28	out.ResultMetadata = metadata
29	return out, nil
30}
31
32type CreateTrackerInput struct {
33
34	// Specifies the pricing plan for your tracker resource. For additional details and
35	// restrictions on each pricing plan option, see the Amazon Location Service
36	// pricing page (https://aws.amazon.com/location/pricing/).
37	//
38	// This member is required.
39	PricingPlan types.PricingPlan
40
41	// The name for the tracker resource. Requirements:
42	//
43	// * Contain only alphanumeric
44	// characters (A-Z, a-z, 0-9) , hyphens (-), periods (.), and underscores (_).
45	//
46	// *
47	// Must be a unique tracker resource name.
48	//
49	// * No spaces allowed. For example,
50	// ExampleTracker.
51	//
52	// This member is required.
53	TrackerName *string
54
55	// An optional description for the tracker resource.
56	Description *string
57
58	// Specifies the plan data source. Required if the Mobile Asset Tracking (MAT) or
59	// the Mobile Asset Management (MAM) pricing plan is selected. Billing is
60	// determined by the resource usage, the associated pricing plan, and data source
61	// that was specified. For more information about each pricing plan option and
62	// restrictions, see the Amazon Location Service pricing page
63	// (https://aws.amazon.com/location/pricing/). Valid Values: Esri | Here
64	PricingPlanDataSource *string
65}
66
67type CreateTrackerOutput struct {
68
69	// The timestamp for when the tracker resource was created in  ISO 8601
70	// (https://www.iso.org/iso-8601-date-and-time-format.html) format:
71	// YYYY-MM-DDThh:mm:ss.sssZ.
72	//
73	// This member is required.
74	CreateTime *time.Time
75
76	// The Amazon Resource Name (ARN) for the tracker resource. Used when you need to
77	// specify a resource across all AWS.
78	//
79	// This member is required.
80	TrackerArn *string
81
82	// The name of the tracker resource.
83	//
84	// This member is required.
85	TrackerName *string
86
87	// Metadata pertaining to the operation's result.
88	ResultMetadata middleware.Metadata
89}
90
91func addOperationCreateTrackerMiddlewares(stack *middleware.Stack, options Options) (err error) {
92	err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTracker{}, middleware.After)
93	if err != nil {
94		return err
95	}
96	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTracker{}, middleware.After)
97	if err != nil {
98		return err
99	}
100	if err = addSetLoggerMiddleware(stack, options); err != nil {
101		return err
102	}
103	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
104		return err
105	}
106	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
107		return err
108	}
109	if err = addResolveEndpointMiddleware(stack, options); err != nil {
110		return err
111	}
112	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
113		return err
114	}
115	if err = addRetryMiddlewares(stack, options); err != nil {
116		return err
117	}
118	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
119		return err
120	}
121	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
122		return err
123	}
124	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
125		return err
126	}
127	if err = addClientUserAgent(stack); err != nil {
128		return err
129	}
130	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
131		return err
132	}
133	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
134		return err
135	}
136	if err = addOpCreateTrackerValidationMiddleware(stack); err != nil {
137		return err
138	}
139	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
140		return err
141	}
142	if err = addResponseErrorMiddleware(stack); err != nil {
143		return err
144	}
145	if err = addRequestResponseLogging(stack, options); err != nil {
146		return err
147	}
148	return nil
149}
150