api_op_GetLoadBalancerTlsPolicies.go raw
1 // Code generated by smithy-go-codegen DO NOT EDIT.
2
3 package lightsail
4
5 import (
6 "context"
7 "fmt"
8 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
9 "github.com/aws/aws-sdk-go-v2/service/lightsail/types"
10 "github.com/aws/smithy-go/middleware"
11 smithyhttp "github.com/aws/smithy-go/transport/http"
12 )
13
14 // Returns a list of TLS security policies that you can apply to Lightsail load
15 // balancers.
16 //
17 // For more information about load balancer TLS security policies, see [Configuring TLS security policies on your Amazon Lightsail load balancers] in the
18 // Amazon Lightsail Developer Guide.
19 //
20 // [Configuring TLS security policies on your Amazon Lightsail load balancers]: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-configure-load-balancer-tls-security-policy
21 func (c *Client) GetLoadBalancerTlsPolicies(ctx context.Context, params *GetLoadBalancerTlsPoliciesInput, optFns ...func(*Options)) (*GetLoadBalancerTlsPoliciesOutput, error) {
22 if params == nil {
23 params = &GetLoadBalancerTlsPoliciesInput{}
24 }
25
26 result, metadata, err := c.invokeOperation(ctx, "GetLoadBalancerTlsPolicies", params, optFns, c.addOperationGetLoadBalancerTlsPoliciesMiddlewares)
27 if err != nil {
28 return nil, err
29 }
30
31 out := result.(*GetLoadBalancerTlsPoliciesOutput)
32 out.ResultMetadata = metadata
33 return out, nil
34 }
35
36 type GetLoadBalancerTlsPoliciesInput struct {
37
38 // The token to advance to the next page of results from your request.
39 //
40 // To get a page token, perform an initial GetLoadBalancerTlsPolicies request. If
41 // your results are paginated, the response will return a next page token that you
42 // can specify as the page token in a subsequent request.
43 PageToken *string
44
45 noSmithyDocumentSerde
46 }
47
48 type GetLoadBalancerTlsPoliciesOutput struct {
49
50 // The token to advance to the next page of results from your request.
51 //
52 // A next page token is not returned if there are no more results to display.
53 //
54 // To get the next page of results, perform another GetLoadBalancerTlsPolicies
55 // request and specify the next page token using the pageToken parameter.
56 NextPageToken *string
57
58 // An array of objects that describe the TLS security policies that are available.
59 TlsPolicies []types.LoadBalancerTlsPolicy
60
61 // Metadata pertaining to the operation's result.
62 ResultMetadata middleware.Metadata
63
64 noSmithyDocumentSerde
65 }
66
67 func (c *Client) addOperationGetLoadBalancerTlsPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
68 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
69 return err
70 }
71 err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLoadBalancerTlsPolicies{}, middleware.After)
72 if err != nil {
73 return err
74 }
75 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLoadBalancerTlsPolicies{}, middleware.After)
76 if err != nil {
77 return err
78 }
79 if err := addProtocolFinalizerMiddlewares(stack, options, "GetLoadBalancerTlsPolicies"); err != nil {
80 return fmt.Errorf("add protocol finalizers: %v", err)
81 }
82
83 if err = addlegacyEndpointContextSetter(stack, options); err != nil {
84 return err
85 }
86 if err = addSetLoggerMiddleware(stack, options); err != nil {
87 return err
88 }
89 if err = addClientRequestID(stack); err != nil {
90 return err
91 }
92 if err = addComputeContentLength(stack); err != nil {
93 return err
94 }
95 if err = addResolveEndpointMiddleware(stack, options); err != nil {
96 return err
97 }
98 if err = addComputePayloadSHA256(stack); err != nil {
99 return err
100 }
101 if err = addRetry(stack, options); err != nil {
102 return err
103 }
104 if err = addRawResponseToMetadata(stack); err != nil {
105 return err
106 }
107 if err = addRecordResponseTiming(stack); err != nil {
108 return err
109 }
110 if err = addSpanRetryLoop(stack, options); err != nil {
111 return err
112 }
113 if err = addClientUserAgent(stack, options); err != nil {
114 return err
115 }
116 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
117 return err
118 }
119 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
120 return err
121 }
122 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
123 return err
124 }
125 if err = addTimeOffsetBuild(stack, c); err != nil {
126 return err
127 }
128 if err = addUserAgentRetryMode(stack, options); err != nil {
129 return err
130 }
131 if err = addCredentialSource(stack, options); err != nil {
132 return err
133 }
134 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLoadBalancerTlsPolicies(options.Region), middleware.Before); err != nil {
135 return err
136 }
137 if err = addRecursionDetection(stack); err != nil {
138 return err
139 }
140 if err = addRequestIDRetrieverMiddleware(stack); err != nil {
141 return err
142 }
143 if err = addResponseErrorMiddleware(stack); err != nil {
144 return err
145 }
146 if err = addRequestResponseLogging(stack, options); err != nil {
147 return err
148 }
149 if err = addDisableHTTPSMiddleware(stack, options); err != nil {
150 return err
151 }
152 if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
153 return err
154 }
155 if err = addInterceptAttempt(stack, options); err != nil {
156 return err
157 }
158 if err = addInterceptors(stack, options); err != nil {
159 return err
160 }
161 return nil
162 }
163
164 func newServiceMetadataMiddleware_opGetLoadBalancerTlsPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
165 return &awsmiddleware.RegisterServiceMetadata{
166 Region: region,
167 ServiceID: ServiceID,
168 OperationName: "GetLoadBalancerTlsPolicies",
169 }
170 }
171