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

package ssm

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

// Get information about one or more parameters by specifying multiple parameter
// names.
//
// To get information about a single parameter, you can use the GetParameter operation instead.
//
// Parameter names can't contain spaces. The service removes any spaces specified
// for the beginning or end of a parameter name. If the specified name for a
// parameter contains spaces between characters, the request fails with a
// ValidationException error.
//
// Parameter Store throughput defines the number of API transactions per second
// (TPS) that Systems Manager can process. This applies to GetParameter ,
// GetParameters , and PutParameter API calls for your Amazon Web Services account
// and Amazon Web Services Region. By default, Parameter Store is configured with a
// standard throughput quota suitable for low- to moderate-volume workloads.
// Applications that retrieve configuration data infrequently or operate at smaller
// scale can use this default setting without additional cost.
//
// For higher-volume workloads, you can enable higher throughput. This increases
// the maximum number of supported transactions per second for your account and
// Region. Increased throughput supports applications and workloads that need
// concurrent access to multiple parameters. If you experience
// ThrottlingException: Rate exceeded errors, enable higher throughput. For more
// information, see [Changing Parameter Store throughput].
//
// [Changing Parameter Store throughput]: https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-throughput.html
func (c *Client) GetParameters(ctx context.Context, params *GetParametersInput, optFns ...func(*Options)) (*GetParametersOutput, error) {
	if params == nil {
		params = &GetParametersInput{}
	}

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

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

type GetParametersInput struct {

	// The names or Amazon Resource Names (ARNs) of the parameters that you want to
	// query. For parameters shared with you from another account, you must use the
	// full ARNs.
	//
	// To query by parameter label, use "Name": "name:label" . To query by parameter
	// version, use "Name": "name:version" .
	//
	// The results for GetParameters requests are listed in alphabetical order in
	// query responses.
	//
	// For information about shared parameters, see [Working with shared parameters] in the Amazon Web Services
	// Systems Manager User Guide.
	//
	// [Working with shared parameters]: https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-shared-parameters.html
	//
	// This member is required.
	Names []string

	// Return decrypted secure string value. Return decrypted values for secure string
	// parameters. This flag is ignored for String and StringList parameter types.
	WithDecryption *bool

	noSmithyDocumentSerde
}

type GetParametersOutput struct {

	// A list of parameters that aren't formatted correctly or don't run during an
	// execution.
	InvalidParameters []string

	// A list of details for a parameter.
	Parameters []types.Parameter

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

	noSmithyDocumentSerde
}

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