// Code generated by smithy-go-codegen DO NOT EDIT.

package bedrockagentcorecontrol

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
	"time"
)

// Retrieves information about a specific gateway target.
func (c *Client) GetGatewayTarget(ctx context.Context, params *GetGatewayTargetInput, optFns ...func(*Options)) (*GetGatewayTargetOutput, error) {
	if params == nil {
		params = &GetGatewayTargetInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "GetGatewayTarget", params, optFns, c.addOperationGetGatewayTargetMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*GetGatewayTargetOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type GetGatewayTargetInput struct {

	// The identifier of the gateway that contains the target.
	//
	// This member is required.
	GatewayIdentifier *string

	// The unique identifier of the target to retrieve.
	//
	// This member is required.
	TargetId *string

	noSmithyDocumentSerde
}

type GetGatewayTargetOutput struct {

	// The timestamp when the gateway target was created.
	//
	// This member is required.
	CreatedAt *time.Time

	// The credential provider configurations for the gateway target.
	//
	// This member is required.
	CredentialProviderConfigurations []types.CredentialProviderConfiguration

	// The Amazon Resource Name (ARN) of the gateway.
	//
	// This member is required.
	GatewayArn *string

	// The name of the gateway target.
	//
	// This member is required.
	Name *string

	// The current status of the gateway target.
	//
	// This member is required.
	Status types.TargetStatus

	// The configuration for a gateway target. This structure defines how the gateway
	// connects to and interacts with the target endpoint.
	//
	// This member is required.
	TargetConfiguration types.TargetConfiguration

	// The unique identifier of the gateway target.
	//
	// This member is required.
	TargetId *string

	// The timestamp when the gateway target was last updated.
	//
	// This member is required.
	UpdatedAt *time.Time

	// OAuth2 authorization data for the gateway target. This data is returned when a
	// target is configured with a credential provider with authorization code grant
	// type and requires user federation.
	AuthorizationData types.AuthorizationData

	// The description of the gateway target.
	Description *string

	// The last synchronization of the target.
	LastSynchronizedAt *time.Time

	// The metadata configuration for HTTP header and query parameter propagation for
	// the retrieved gateway target.
	MetadataConfiguration *types.MetadataConfiguration

	// The private endpoint configuration for the gateway target.
	PrivateEndpoint types.PrivateEndpoint

	// The managed resources created by the gateway for private endpoint connectivity.
	PrivateEndpointManagedResources []types.ManagedResourceDetails

	// The protocol type of the gateway target.
	ProtocolType types.TargetProtocolType

	// The reasons for the current status of the gateway target.
	StatusReasons []string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationGetGatewayTargetMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetGatewayTarget{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetGatewayTarget{}, middleware.After)
	if err != nil {
		return err
	}

	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
		return err
	}
	if err = addComputeContentLength(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpGetGatewayTargetValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetGatewayTarget"), middleware.Before); 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
	}
	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
		return err
	}
	if err = addInterceptors(stack, options); err != nil {
		return err
	}
	return nil
}
