1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package swf 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/swf/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 "time" 13) 14 15// Returns information about the specified workflow execution including its type 16// and some statistics. This operation is eventually consistent. The results are 17// best effort and may not exactly reflect recent updates and changes. Access 18// Control You can use IAM policies to control this action's access to Amazon SWF 19// resources as follows: 20// 21// * Use a Resource element with the domain name to limit 22// the action to only specified domains. 23// 24// * Use an Action element to allow or deny 25// permission to call this action. 26// 27// * You cannot use an IAM policy to constrain 28// this action's parameters. 29// 30// If the caller doesn't have sufficient permissions to 31// invoke the action, or the parameter values fall outside the specified 32// constraints, the action fails. The associated event attribute's cause parameter 33// is set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see 34// Using IAM to Manage Access to Amazon SWF Workflows 35// (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html) 36// in the Amazon SWF Developer Guide. 37func (c *Client) DescribeWorkflowExecution(ctx context.Context, params *DescribeWorkflowExecutionInput, optFns ...func(*Options)) (*DescribeWorkflowExecutionOutput, error) { 38 if params == nil { 39 params = &DescribeWorkflowExecutionInput{} 40 } 41 42 result, metadata, err := c.invokeOperation(ctx, "DescribeWorkflowExecution", params, optFns, addOperationDescribeWorkflowExecutionMiddlewares) 43 if err != nil { 44 return nil, err 45 } 46 47 out := result.(*DescribeWorkflowExecutionOutput) 48 out.ResultMetadata = metadata 49 return out, nil 50} 51 52type DescribeWorkflowExecutionInput struct { 53 54 // The name of the domain containing the workflow execution. 55 // 56 // This member is required. 57 Domain *string 58 59 // The workflow execution to describe. 60 // 61 // This member is required. 62 Execution *types.WorkflowExecution 63} 64 65// Contains details about a workflow execution. 66type DescribeWorkflowExecutionOutput struct { 67 68 // The configuration settings for this workflow execution including timeout values, 69 // tasklist etc. 70 // 71 // This member is required. 72 ExecutionConfiguration *types.WorkflowExecutionConfiguration 73 74 // Information about the workflow execution. 75 // 76 // This member is required. 77 ExecutionInfo *types.WorkflowExecutionInfo 78 79 // The number of tasks for this workflow execution. This includes open and closed 80 // tasks of all types. 81 // 82 // This member is required. 83 OpenCounts *types.WorkflowExecutionOpenCounts 84 85 // The time when the last activity task was scheduled for this workflow execution. 86 // You can use this information to determine if the workflow has not made progress 87 // for an unusually long period of time and might require a corrective action. 88 LatestActivityTaskTimestamp *time.Time 89 90 // The latest executionContext provided by the decider for this workflow execution. 91 // A decider can provide an executionContext (a free-form string) when closing a 92 // decision task using RespondDecisionTaskCompleted. 93 LatestExecutionContext *string 94 95 // Metadata pertaining to the operation's result. 96 ResultMetadata middleware.Metadata 97} 98 99func addOperationDescribeWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { 100 err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeWorkflowExecution{}, middleware.After) 101 if err != nil { 102 return err 103 } 104 err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeWorkflowExecution{}, middleware.After) 105 if err != nil { 106 return err 107 } 108 if err = addSetLoggerMiddleware(stack, options); err != nil { 109 return err 110 } 111 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 112 return err 113 } 114 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 115 return err 116 } 117 if err = addResolveEndpointMiddleware(stack, options); err != nil { 118 return err 119 } 120 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 121 return err 122 } 123 if err = addRetryMiddlewares(stack, options); err != nil { 124 return err 125 } 126 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 127 return err 128 } 129 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 130 return err 131 } 132 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 133 return err 134 } 135 if err = addClientUserAgent(stack); err != nil { 136 return err 137 } 138 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 139 return err 140 } 141 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 142 return err 143 } 144 if err = addOpDescribeWorkflowExecutionValidationMiddleware(stack); err != nil { 145 return err 146 } 147 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorkflowExecution(options.Region), middleware.Before); err != nil { 148 return err 149 } 150 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 151 return err 152 } 153 if err = addResponseErrorMiddleware(stack); err != nil { 154 return err 155 } 156 if err = addRequestResponseLogging(stack, options); err != nil { 157 return err 158 } 159 return nil 160} 161 162func newServiceMetadataMiddleware_opDescribeWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata { 163 return &awsmiddleware.RegisterServiceMetadata{ 164 Region: region, 165 ServiceID: ServiceID, 166 SigningName: "swf", 167 OperationName: "DescribeWorkflowExecution", 168 } 169} 170