1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package appstream 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/smithy-go/middleware" 10 smithyhttp "github.com/aws/smithy-go/transport/http" 11 "time" 12) 13 14// Creates a temporary URL to start an AppStream 2.0 streaming session for the 15// specified user. A streaming URL enables application streaming to be tested 16// without user setup. 17func (c *Client) CreateStreamingURL(ctx context.Context, params *CreateStreamingURLInput, optFns ...func(*Options)) (*CreateStreamingURLOutput, error) { 18 if params == nil { 19 params = &CreateStreamingURLInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "CreateStreamingURL", params, optFns, addOperationCreateStreamingURLMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*CreateStreamingURLOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30} 31 32type CreateStreamingURLInput struct { 33 34 // The name of the fleet. 35 // 36 // This member is required. 37 FleetName *string 38 39 // The name of the stack. 40 // 41 // This member is required. 42 StackName *string 43 44 // The identifier of the user. 45 // 46 // This member is required. 47 UserId *string 48 49 // The name of the application to launch after the session starts. This is the name 50 // that you specified as Name in the Image Assistant. If your fleet is enabled for 51 // the Desktop stream view, you can also choose to launch directly to the operating 52 // system desktop. To do so, specify Desktop. 53 ApplicationId *string 54 55 // The session context. For more information, see Session Context 56 // (https://docs.aws.amazon.com/appstream2/latest/developerguide/managing-stacks-fleets.html#managing-stacks-fleets-parameters) 57 // in the Amazon AppStream 2.0 Administration Guide. 58 SessionContext *string 59 60 // The time that the streaming URL will be valid, in seconds. Specify a value 61 // between 1 and 604800 seconds. The default is 60 seconds. 62 Validity *int64 63} 64 65type CreateStreamingURLOutput struct { 66 67 // The elapsed time, in seconds after the Unix epoch, when this URL expires. 68 Expires *time.Time 69 70 // The URL to start the AppStream 2.0 streaming session. 71 StreamingURL *string 72 73 // Metadata pertaining to the operation's result. 74 ResultMetadata middleware.Metadata 75} 76 77func addOperationCreateStreamingURLMiddlewares(stack *middleware.Stack, options Options) (err error) { 78 err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateStreamingURL{}, middleware.After) 79 if err != nil { 80 return err 81 } 82 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateStreamingURL{}, middleware.After) 83 if err != nil { 84 return err 85 } 86 if err = addSetLoggerMiddleware(stack, options); err != nil { 87 return err 88 } 89 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 90 return err 91 } 92 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 93 return err 94 } 95 if err = addResolveEndpointMiddleware(stack, options); err != nil { 96 return err 97 } 98 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 99 return err 100 } 101 if err = addRetryMiddlewares(stack, options); err != nil { 102 return err 103 } 104 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 105 return err 106 } 107 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 108 return err 109 } 110 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 111 return err 112 } 113 if err = addClientUserAgent(stack); err != nil { 114 return err 115 } 116 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 117 return err 118 } 119 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 120 return err 121 } 122 if err = addOpCreateStreamingURLValidationMiddleware(stack); err != nil { 123 return err 124 } 125 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStreamingURL(options.Region), middleware.Before); err != nil { 126 return err 127 } 128 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 129 return err 130 } 131 if err = addResponseErrorMiddleware(stack); err != nil { 132 return err 133 } 134 if err = addRequestResponseLogging(stack, options); err != nil { 135 return err 136 } 137 return nil 138} 139 140func newServiceMetadataMiddleware_opCreateStreamingURL(region string) *awsmiddleware.RegisterServiceMetadata { 141 return &awsmiddleware.RegisterServiceMetadata{ 142 Region: region, 143 ServiceID: ServiceID, 144 SigningName: "appstream", 145 OperationName: "CreateStreamingURL", 146 } 147} 148