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

package connect

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

// Describes a predefined attribute for the specified Connect Customer instance. A
// predefined attribute is made up of a name and a value. You can use predefined
// attributes for:
//
//   - Routing proficiency (for example, agent certification) that has predefined
//     values (for example, a list of possible certifications). For more information,
//     see [Create predefined attributes for routing contacts to agents].
//
//   - Contact information that varies between transfers or conferences, such as
//     the name of the business unit handling the contact. For more information, see [Use contact segment attributes]
//     .
//
// For the predefined attributes per instance quota, see [Connect Customer quotas].
//
// Endpoints: See [Connect Customer endpoints and quotas].
//
// [Use contact segment attributes]: https://docs.aws.amazon.com/connect/latest/adminguide/use-contact-segment-attributes.html
// [Connect Customer quotas]: https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#connect-quotas
// [Create predefined attributes for routing contacts to agents]: https://docs.aws.amazon.com/connect/latest/adminguide/predefined-attributes.html
// [Connect Customer endpoints and quotas]: https://docs.aws.amazon.com/general/latest/gr/connect_region.html
func (c *Client) DescribePredefinedAttribute(ctx context.Context, params *DescribePredefinedAttributeInput, optFns ...func(*Options)) (*DescribePredefinedAttributeOutput, error) {
	if params == nil {
		params = &DescribePredefinedAttributeInput{}
	}

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

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

type DescribePredefinedAttributeInput struct {

	// The identifier of the Connect Customer instance. You can find the instance ID
	// in the Amazon Resource Name (ARN) of the instance.
	//
	// This member is required.
	InstanceId *string

	// The name of the predefined attribute.
	//
	// This member is required.
	Name *string

	noSmithyDocumentSerde
}

type DescribePredefinedAttributeOutput struct {

	// Information about the predefined attribute.
	PredefinedAttribute *types.PredefinedAttribute

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationDescribePredefinedAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePredefinedAttribute{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePredefinedAttribute{}, 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, 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 = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpDescribePredefinedAttributeValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DescribePredefinedAttribute"), 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
}
