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/aws-sdk-go-v2/service/appstream/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Creates a stack to start streaming applications to users. A stack consists of an 15// associated fleet, user access policies, and storage configurations. 16func (c *Client) CreateStack(ctx context.Context, params *CreateStackInput, optFns ...func(*Options)) (*CreateStackOutput, error) { 17 if params == nil { 18 params = &CreateStackInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "CreateStack", params, optFns, addOperationCreateStackMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*CreateStackOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31type CreateStackInput struct { 32 33 // The name of the stack. 34 // 35 // This member is required. 36 Name *string 37 38 // The list of interface VPC endpoint (interface endpoint) objects. Users of the 39 // stack can connect to AppStream 2.0 only through the specified endpoints. 40 AccessEndpoints []types.AccessEndpoint 41 42 // The persistent application settings for users of a stack. When these settings 43 // are enabled, changes that users make to applications and Windows settings are 44 // automatically saved after each session and applied to the next session. 45 ApplicationSettings *types.ApplicationSettings 46 47 // The description to display. 48 Description *string 49 50 // The stack name to display. 51 DisplayName *string 52 53 // The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. 54 // You must approve the domains that you want to host embedded AppStream 2.0 55 // streaming sessions. 56 EmbedHostDomains []string 57 58 // The URL that users are redirected to after they click the Send Feedback link. If 59 // no URL is specified, no Send Feedback link is displayed. 60 FeedbackURL *string 61 62 // The URL that users are redirected to after their streaming session ends. 63 RedirectURL *string 64 65 // The storage connectors to enable. 66 StorageConnectors []types.StorageConnector 67 68 // The tags to associate with the stack. A tag is a key-value pair, and the value 69 // is optional. For example, Environment=Test. If you do not specify a value, 70 // Environment=. If you do not specify a value, the value is set to an empty 71 // string. Generally allowed characters are: letters, numbers, and spaces 72 // representable in UTF-8, and the following special characters: _ . : / = + \ - @ 73 // For more information about tags, see Tagging Your Resources 74 // (https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html) 75 // in the Amazon AppStream 2.0 Administration Guide. 76 Tags map[string]string 77 78 // The actions that are enabled or disabled for users during their streaming 79 // sessions. By default, these actions are enabled. 80 UserSettings []types.UserSetting 81} 82 83type CreateStackOutput struct { 84 85 // Information about the stack. 86 Stack *types.Stack 87 88 // Metadata pertaining to the operation's result. 89 ResultMetadata middleware.Metadata 90} 91 92func addOperationCreateStackMiddlewares(stack *middleware.Stack, options Options) (err error) { 93 err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateStack{}, middleware.After) 94 if err != nil { 95 return err 96 } 97 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateStack{}, middleware.After) 98 if err != nil { 99 return err 100 } 101 if err = addSetLoggerMiddleware(stack, options); err != nil { 102 return err 103 } 104 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 105 return err 106 } 107 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 108 return err 109 } 110 if err = addResolveEndpointMiddleware(stack, options); err != nil { 111 return err 112 } 113 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 114 return err 115 } 116 if err = addRetryMiddlewares(stack, options); err != nil { 117 return err 118 } 119 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 120 return err 121 } 122 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 123 return err 124 } 125 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 126 return err 127 } 128 if err = addClientUserAgent(stack); err != nil { 129 return err 130 } 131 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 132 return err 133 } 134 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 135 return err 136 } 137 if err = addOpCreateStackValidationMiddleware(stack); err != nil { 138 return err 139 } 140 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStack(options.Region), middleware.Before); err != nil { 141 return err 142 } 143 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 144 return err 145 } 146 if err = addResponseErrorMiddleware(stack); err != nil { 147 return err 148 } 149 if err = addRequestResponseLogging(stack, options); err != nil { 150 return err 151 } 152 return nil 153} 154 155func newServiceMetadataMiddleware_opCreateStack(region string) *awsmiddleware.RegisterServiceMetadata { 156 return &awsmiddleware.RegisterServiceMetadata{ 157 Region: region, 158 ServiceID: ServiceID, 159 SigningName: "appstream", 160 OperationName: "CreateStack", 161 } 162} 163