// Code generated by smithy-go-codegen DO NOT EDIT. package applicationinsights import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/applicationinsights/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds an application that is created from a resource group. func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) { if params == nil { params = &CreateApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, c.addOperationCreateApplicationMiddlewares) if err != nil { return nil, err } out := result.(*CreateApplicationOutput) out.ResultMetadata = metadata return out, nil } type CreateApplicationInput struct { // Indicates whether Application Insights automatically configures unmonitored // resources in the resource group. AutoConfigEnabled *bool // Configures all of the resources in the resource group by applying the // recommended configurations. AutoCreate *bool // Indicates whether Application Insights can listen to CloudWatch events for the // application resources, such as instance terminated , failed deployment , and // others. CWEMonitorEnabled *bool // Application Insights can create applications based on a resource group or on an // account. To create an account-based application using all of the resources in // the account, set this parameter to ACCOUNT_BASED . GroupingType types.GroupingType // When set to true , creates opsItems for any problems detected on an application. OpsCenterEnabled *bool // The SNS topic provided to Application Insights that is associated to the // created opsItem. Allows you to receive notifications for updates to the opsItem. OpsItemSNSTopicArn *string // The name of the resource group. ResourceGroupName *string // List of tags to add to the application. tag key ( Key ) and an associated tag // value ( Value ). The maximum length of a tag key is 128 characters. The maximum // length of a tag value is 256 characters. Tags []types.Tag noSmithyDocumentSerde } type CreateApplicationOutput struct { // Information about the application. ApplicationInfo *types.ApplicationInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "applicationinsights", OperationName: "CreateApplication", } }