1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package datasync
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/datasync/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Defines a file system on a Server Message Block (SMB) server that can be read
15// from or written to.
16func (c *Client) CreateLocationSmb(ctx context.Context, params *CreateLocationSmbInput, optFns ...func(*Options)) (*CreateLocationSmbOutput, error) {
17	if params == nil {
18		params = &CreateLocationSmbInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "CreateLocationSmb", params, optFns, addOperationCreateLocationSmbMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*CreateLocationSmbOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31// CreateLocationSmbRequest
32type CreateLocationSmbInput struct {
33
34	// The Amazon Resource Names (ARNs) of agents to use for a Simple Message Block
35	// (SMB) location.
36	//
37	// This member is required.
38	AgentArns []string
39
40	// The password of the user who can mount the share, has the permissions to access
41	// files and folders in the SMB share.
42	//
43	// This member is required.
44	Password *string
45
46	// The name of the SMB server. This value is the IP address or Domain Name Service
47	// (DNS) name of the SMB server. An agent that is installed on-premises uses this
48	// hostname to mount the SMB server in a network. This name must either be
49	// DNS-compliant or must be an IP version 4 (IPv4) address.
50	//
51	// This member is required.
52	ServerHostname *string
53
54	// The subdirectory in the SMB file system that is used to read data from the SMB
55	// source location or write data to the SMB destination. The SMB path should be a
56	// path that's exported by the SMB server, or a subdirectory of that path. The path
57	// should be such that it can be mounted by other SMB clients in your network.
58	// Subdirectory must be specified with forward slashes. For example,
59	// /path/to/folder. To transfer all the data in the folder you specified, DataSync
60	// needs to have permissions to mount the SMB share, as well as to access all the
61	// data in that share. To ensure this, either ensure that the user/password
62	// specified belongs to the user who can mount the share, and who has the
63	// appropriate permissions for all of the files and directories that you want
64	// DataSync to access, or use credentials of a member of the Backup Operators group
65	// to mount the share. Doing either enables the agent to access the data. For the
66	// agent to access directories, you must additionally enable all execute access.
67	//
68	// This member is required.
69	Subdirectory *string
70
71	// The user who can mount the share, has the permissions to access files and
72	// folders in the SMB share.
73	//
74	// This member is required.
75	User *string
76
77	// The name of the Windows domain that the SMB server belongs to.
78	Domain *string
79
80	// The mount options used by DataSync to access the SMB server.
81	MountOptions *types.SmbMountOptions
82
83	// The key-value pair that represents the tag that you want to add to the location.
84	// The value can be an empty string. We recommend using tags to name your
85	// resources.
86	Tags []types.TagListEntry
87}
88
89// CreateLocationSmbResponse
90type CreateLocationSmbOutput struct {
91
92	// The Amazon Resource Name (ARN) of the source SMB file system location that is
93	// created.
94	LocationArn *string
95
96	// Metadata pertaining to the operation's result.
97	ResultMetadata middleware.Metadata
98}
99
100func addOperationCreateLocationSmbMiddlewares(stack *middleware.Stack, options Options) (err error) {
101	err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLocationSmb{}, middleware.After)
102	if err != nil {
103		return err
104	}
105	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLocationSmb{}, middleware.After)
106	if err != nil {
107		return err
108	}
109	if err = addSetLoggerMiddleware(stack, options); err != nil {
110		return err
111	}
112	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
113		return err
114	}
115	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
116		return err
117	}
118	if err = addResolveEndpointMiddleware(stack, options); err != nil {
119		return err
120	}
121	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
122		return err
123	}
124	if err = addRetryMiddlewares(stack, options); err != nil {
125		return err
126	}
127	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
128		return err
129	}
130	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
131		return err
132	}
133	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
134		return err
135	}
136	if err = addClientUserAgent(stack); err != nil {
137		return err
138	}
139	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
140		return err
141	}
142	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
143		return err
144	}
145	if err = addOpCreateLocationSmbValidationMiddleware(stack); err != nil {
146		return err
147	}
148	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLocationSmb(options.Region), middleware.Before); err != nil {
149		return err
150	}
151	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
152		return err
153	}
154	if err = addResponseErrorMiddleware(stack); err != nil {
155		return err
156	}
157	if err = addRequestResponseLogging(stack, options); err != nil {
158		return err
159	}
160	return nil
161}
162
163func newServiceMetadataMiddleware_opCreateLocationSmb(region string) *awsmiddleware.RegisterServiceMetadata {
164	return &awsmiddleware.RegisterServiceMetadata{
165		Region:        region,
166		ServiceID:     ServiceID,
167		SigningName:   "datasync",
168		OperationName: "CreateLocationSmb",
169	}
170}
171