// Code generated by smithy-go-codegen DO NOT EDIT. package timestreamwrite import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" internalEndpointDiscovery "github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery" "github.com/aws/aws-sdk-go-v2/service/timestreamwrite/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about the batch load task, including configurations, // mappings, progress, and other details. Service quotas apply (https://docs.aws.amazon.com/timestream/latest/developerguide/ts-limits.html) // . See code sample (https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.describe-batch-load.html) // for details. func (c *Client) DescribeBatchLoadTask(ctx context.Context, params *DescribeBatchLoadTaskInput, optFns ...func(*Options)) (*DescribeBatchLoadTaskOutput, error) { if params == nil { params = &DescribeBatchLoadTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBatchLoadTask", params, optFns, c.addOperationDescribeBatchLoadTaskMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBatchLoadTaskOutput) out.ResultMetadata = metadata return out, nil } type DescribeBatchLoadTaskInput struct { // The ID of the batch load task. // // This member is required. TaskId *string noSmithyDocumentSerde } type DescribeBatchLoadTaskOutput struct { // Description of the batch load task. // // This member is required. BatchLoadTaskDescription *types.BatchLoadTaskDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBatchLoadTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeBatchLoadTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeBatchLoadTask{}, 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 = addOpDescribeBatchLoadTaskDiscoverEndpointMiddleware(stack, options, c); err != nil { return err } if err = addOpDescribeBatchLoadTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeBatchLoadTask(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 addOpDescribeBatchLoadTaskDiscoverEndpointMiddleware(stack *middleware.Stack, o Options, c *Client) error { return stack.Serialize.Insert(&internalEndpointDiscovery.DiscoverEndpoint{ Options: []func(*internalEndpointDiscovery.DiscoverEndpointOptions){ func(opt *internalEndpointDiscovery.DiscoverEndpointOptions) { opt.DisableHTTPS = o.EndpointOptions.DisableHTTPS opt.Logger = o.Logger opt.EndpointResolverUsedForDiscovery = o.EndpointDiscovery.EndpointResolverUsedForDiscovery }, }, DiscoverOperation: c.fetchOpDescribeBatchLoadTaskDiscoverEndpoint, EndpointDiscoveryEnableState: o.EndpointDiscovery.EnableEndpointDiscovery, EndpointDiscoveryRequired: true, }, "ResolveEndpoint", middleware.After) } func (c *Client) fetchOpDescribeBatchLoadTaskDiscoverEndpoint(ctx context.Context, input interface{}, optFns ...func(*internalEndpointDiscovery.DiscoverEndpointOptions)) (internalEndpointDiscovery.WeightedAddress, error) { in, ok := input.(*DescribeBatchLoadTaskInput) if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("unknown input type %T", input) } _ = in identifierMap := make(map[string]string, 0) key := fmt.Sprintf("Timestream Write.%v", identifierMap) if v, ok := c.endpointCache.Get(key); ok { return v, nil } discoveryOperationInput := &DescribeEndpointsInput{} opt := internalEndpointDiscovery.DiscoverEndpointOptions{} for _, fn := range optFns { fn(&opt) } endpoint, err := c.handleEndpointDiscoveryFromService(ctx, discoveryOperationInput, key, opt) if err != nil { return internalEndpointDiscovery.WeightedAddress{}, err } weighted, ok := endpoint.GetValidAddress() if !ok { return internalEndpointDiscovery.WeightedAddress{}, fmt.Errorf("no valid endpoint address returned by the endpoint discovery api") } return weighted, nil } func newServiceMetadataMiddleware_opDescribeBatchLoadTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "timestream", OperationName: "DescribeBatchLoadTask", } }