1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package devicefarm
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/devicefarm/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Specifies and starts a remote access session.
15func (c *Client) CreateRemoteAccessSession(ctx context.Context, params *CreateRemoteAccessSessionInput, optFns ...func(*Options)) (*CreateRemoteAccessSessionOutput, error) {
16	if params == nil {
17		params = &CreateRemoteAccessSessionInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "CreateRemoteAccessSession", params, optFns, addOperationCreateRemoteAccessSessionMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*CreateRemoteAccessSessionOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30// Creates and submits a request to start a remote access session.
31type CreateRemoteAccessSessionInput struct {
32
33	// The ARN of the device for which you want to create a remote access session.
34	//
35	// This member is required.
36	DeviceArn *string
37
38	// The Amazon Resource Name (ARN) of the project for which you want to create a
39	// remote access session.
40	//
41	// This member is required.
42	ProjectArn *string
43
44	// Unique identifier for the client. If you want access to multiple devices on the
45	// same client, you should pass the same clientId value in each call to
46	// CreateRemoteAccessSession. This identifier is required only if
47	// remoteDebugEnabled is set to true. Remote debugging is no longer supported
48	// (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html).
49	ClientId *string
50
51	// The configuration information for the remote access session request.
52	Configuration *types.CreateRemoteAccessSessionConfiguration
53
54	// The Amazon Resource Name (ARN) of the device instance for which you want to
55	// create a remote access session.
56	InstanceArn *string
57
58	// The interaction mode of the remote access session. Valid values are:
59	//
60	// *
61	// INTERACTIVE: You can interact with the iOS device by viewing, touching, and
62	// rotating the screen. You cannot run XCUITest framework-based tests in this
63	// mode.
64	//
65	// * NO_VIDEO: You are connected to the device, but cannot interact with it
66	// or view the screen. This mode has the fastest test execution speed. You can run
67	// XCUITest framework-based tests in this mode.
68	//
69	// * VIDEO_ONLY: You can view the
70	// screen, but cannot touch or rotate it. You can run XCUITest framework-based
71	// tests and watch the screen in this mode.
72	InteractionMode types.InteractionMode
73
74	// The name of the remote access session to create.
75	Name *string
76
77	// Set to true if you want to access devices remotely for debugging in your remote
78	// access session. Remote debugging is no longer supported
79	// (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html).
80	RemoteDebugEnabled *bool
81
82	// The Amazon Resource Name (ARN) for the app to be recorded in the remote access
83	// session.
84	RemoteRecordAppArn *string
85
86	// Set to true to enable remote recording for the remote access session.
87	RemoteRecordEnabled *bool
88
89	// When set to true, for private devices, Device Farm does not sign your app again.
90	// For public devices, Device Farm always signs your apps again. For more
91	// information on how Device Farm modifies your uploads during tests, see Do you
92	// modify my app? (https://aws.amazon.com/device-farm/faq/)
93	SkipAppResign *bool
94
95	// Ignored. The public key of the ssh key pair you want to use for connecting to
96	// remote devices in your remote debugging session. This key is required only if
97	// remoteDebugEnabled is set to true. Remote debugging is no longer supported
98	// (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html).
99	SshPublicKey *string
100}
101
102// Represents the server response from a request to create a remote access session.
103type CreateRemoteAccessSessionOutput struct {
104
105	// A container that describes the remote access session when the request to create
106	// a remote access session is sent.
107	RemoteAccessSession *types.RemoteAccessSession
108
109	// Metadata pertaining to the operation's result.
110	ResultMetadata middleware.Metadata
111}
112
113func addOperationCreateRemoteAccessSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
114	err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRemoteAccessSession{}, middleware.After)
115	if err != nil {
116		return err
117	}
118	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRemoteAccessSession{}, middleware.After)
119	if err != nil {
120		return err
121	}
122	if err = addSetLoggerMiddleware(stack, options); err != nil {
123		return err
124	}
125	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addResolveEndpointMiddleware(stack, options); err != nil {
132		return err
133	}
134	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
135		return err
136	}
137	if err = addRetryMiddlewares(stack, options); err != nil {
138		return err
139	}
140	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
141		return err
142	}
143	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
144		return err
145	}
146	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
147		return err
148	}
149	if err = addClientUserAgent(stack); err != nil {
150		return err
151	}
152	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
153		return err
154	}
155	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
156		return err
157	}
158	if err = addOpCreateRemoteAccessSessionValidationMiddleware(stack); err != nil {
159		return err
160	}
161	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRemoteAccessSession(options.Region), middleware.Before); err != nil {
162		return err
163	}
164	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
165		return err
166	}
167	if err = addResponseErrorMiddleware(stack); err != nil {
168		return err
169	}
170	if err = addRequestResponseLogging(stack, options); err != nil {
171		return err
172	}
173	return nil
174}
175
176func newServiceMetadataMiddleware_opCreateRemoteAccessSession(region string) *awsmiddleware.RegisterServiceMetadata {
177	return &awsmiddleware.RegisterServiceMetadata{
178		Region:        region,
179		ServiceID:     ServiceID,
180		SigningName:   "devicefarm",
181		OperationName: "CreateRemoteAccessSession",
182	}
183}
184