// 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"
	"time"
)

// Returns detailed information about a cloud connector.
func (c *Client) GetCloudConnector(ctx context.Context, params *GetCloudConnectorInput, optFns ...func(*Options)) (*GetCloudConnectorOutput, error) {
	if params == nil {
		params = &GetCloudConnectorInput{}
	}

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

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

type GetCloudConnectorInput struct {

	// The ID of the cloud connector to retrieve information about.
	//
	// This member is required.
	CloudConnectorId *string

	noSmithyDocumentSerde
}

type GetCloudConnectorOutput struct {

	// The ARN of the cloud connector.
	CloudConnectorArn *string

	// The ARN of the Amazon Web Services Config connector associated with this cloud
	// connector.
	ConfigConnectorArn *string

	// The configuration details for the third-party cloud environment connection.
	Configuration types.CloudConnectorConfiguration

	// The date and time the cloud connector was created.
	CreatedAt *time.Time

	// The description of the cloud connector.
	Description *string

	// The friendly name of the cloud connector.
	DisplayName *string

	// The ARN of the IAM role used by the cloud connector.
	RoleArn *string

	// The date and time the cloud connector was last updated.
	UpdatedAt *time.Time

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

	noSmithyDocumentSerde
}

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