1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package connect 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/connect/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Creates a contact flow for the specified Amazon Connect instance. You can also 15// create and update contact flows using the Amazon Connect Flow language 16// (https://docs.aws.amazon.com/connect/latest/adminguide/flow-language.html). 17func (c *Client) CreateContactFlow(ctx context.Context, params *CreateContactFlowInput, optFns ...func(*Options)) (*CreateContactFlowOutput, error) { 18 if params == nil { 19 params = &CreateContactFlowInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "CreateContactFlow", params, optFns, addOperationCreateContactFlowMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*CreateContactFlowOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30} 31 32type CreateContactFlowInput struct { 33 34 // The content of the contact flow. 35 // 36 // This member is required. 37 Content *string 38 39 // The identifier of the Amazon Connect instance. 40 // 41 // This member is required. 42 InstanceId *string 43 44 // The name of the contact flow. 45 // 46 // This member is required. 47 Name *string 48 49 // The type of the contact flow. For descriptions of the available types, see 50 // Choose a Contact Flow Type 51 // (https://docs.aws.amazon.com/connect/latest/adminguide/create-contact-flow.html#contact-flow-types) 52 // in the Amazon Connect Administrator Guide. 53 // 54 // This member is required. 55 Type types.ContactFlowType 56 57 // The description of the contact flow. 58 Description *string 59 60 // One or more tags. 61 Tags map[string]string 62} 63 64type CreateContactFlowOutput struct { 65 66 // The Amazon Resource Name (ARN) of the contact flow. 67 ContactFlowArn *string 68 69 // The identifier of the contact flow. 70 ContactFlowId *string 71 72 // Metadata pertaining to the operation's result. 73 ResultMetadata middleware.Metadata 74} 75 76func addOperationCreateContactFlowMiddlewares(stack *middleware.Stack, options Options) (err error) { 77 err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateContactFlow{}, middleware.After) 78 if err != nil { 79 return err 80 } 81 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateContactFlow{}, middleware.After) 82 if err != nil { 83 return err 84 } 85 if err = addSetLoggerMiddleware(stack, options); err != nil { 86 return err 87 } 88 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 89 return err 90 } 91 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 92 return err 93 } 94 if err = addResolveEndpointMiddleware(stack, options); err != nil { 95 return err 96 } 97 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 98 return err 99 } 100 if err = addRetryMiddlewares(stack, options); err != nil { 101 return err 102 } 103 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 104 return err 105 } 106 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 107 return err 108 } 109 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 110 return err 111 } 112 if err = addClientUserAgent(stack); err != nil { 113 return err 114 } 115 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 116 return err 117 } 118 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 119 return err 120 } 121 if err = addOpCreateContactFlowValidationMiddleware(stack); err != nil { 122 return err 123 } 124 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateContactFlow(options.Region), middleware.Before); err != nil { 125 return err 126 } 127 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 128 return err 129 } 130 if err = addResponseErrorMiddleware(stack); err != nil { 131 return err 132 } 133 if err = addRequestResponseLogging(stack, options); err != nil { 134 return err 135 } 136 return nil 137} 138 139func newServiceMetadataMiddleware_opCreateContactFlow(region string) *awsmiddleware.RegisterServiceMetadata { 140 return &awsmiddleware.RegisterServiceMetadata{ 141 Region: region, 142 ServiceID: ServiceID, 143 SigningName: "connect", 144 OperationName: "CreateContactFlow", 145 } 146} 147