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

package applicationsignals

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

// Returns the details of a single instrumentation configuration identified by
// service, environment, signal type, and location. Use this to audit or display
// configuration details.
func (c *Client) GetInstrumentationConfiguration(ctx context.Context, params *GetInstrumentationConfigurationInput, optFns ...func(*Options)) (*GetInstrumentationConfigurationOutput, error) {
	if params == nil {
		params = &GetInstrumentationConfigurationInput{}
	}

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

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

type GetInstrumentationConfigurationInput struct {

	// Environment name for the instrumentation configuration.
	//
	// This member is required.
	Environment *string

	// Type of instrumentation configuration (BREAKPOINT or PROBE). Required to
	// identify the configuration to retrieve.
	//
	// This member is required.
	InstrumentationType types.InstrumentationType

	// Location identifier - either full code location or a pre-computed hash.
	//
	// This member is required.
	LocationIdentifier types.LocationIdentifier

	// Service name for the instrumentation configuration.
	//
	// This member is required.
	Service *string

	// Signal type for the instrumentation configuration.
	//
	// This member is required.
	SignalType types.DynamicInstrumentationSignalType

	noSmithyDocumentSerde
}

type GetInstrumentationConfigurationOutput struct {

	// The complete instrumentation configuration, including its location hash,
	// capture settings, filters, expiration, and creation time.
	//
	// This member is required.
	Configuration *types.InstrumentationConfiguration

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationGetInstrumentationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInstrumentationConfiguration{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInstrumentationConfiguration{}, 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 = addOpGetInstrumentationConfigurationValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetInstrumentationConfiguration"), 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
}
