1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package configservice
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/configservice/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Provides organization config rule deployment status for an organization. Only a
15// master account and a delegated administrator account can call this API. When
16// calling this API with a delegated administrator, you must ensure AWS
17// Organizations ListDelegatedAdministrator permissions are added. The status is
18// not considered successful until organization config rule is successfully
19// deployed in all the member accounts with an exception of excluded accounts. When
20// you specify the limit and the next token, you receive a paginated response.
21// Limit and next token are not applicable if you specify organization config rule
22// names. It is only applicable, when you request all the organization config
23// rules.
24func (c *Client) DescribeOrganizationConfigRuleStatuses(ctx context.Context, params *DescribeOrganizationConfigRuleStatusesInput, optFns ...func(*Options)) (*DescribeOrganizationConfigRuleStatusesOutput, error) {
25	if params == nil {
26		params = &DescribeOrganizationConfigRuleStatusesInput{}
27	}
28
29	result, metadata, err := c.invokeOperation(ctx, "DescribeOrganizationConfigRuleStatuses", params, optFns, addOperationDescribeOrganizationConfigRuleStatusesMiddlewares)
30	if err != nil {
31		return nil, err
32	}
33
34	out := result.(*DescribeOrganizationConfigRuleStatusesOutput)
35	out.ResultMetadata = metadata
36	return out, nil
37}
38
39type DescribeOrganizationConfigRuleStatusesInput struct {
40
41	// The maximum number of OrganizationConfigRuleStatuses returned on each page. If
42	// you do no specify a number, AWS Config uses the default. The default is 100.
43	Limit int32
44
45	// The nextToken string returned on a previous page that you use to get the next
46	// page of results in a paginated response.
47	NextToken *string
48
49	// The names of organization config rules for which you want status details. If you
50	// do not specify any names, AWS Config returns details for all your organization
51	// AWS Confg rules.
52	OrganizationConfigRuleNames []string
53}
54
55type DescribeOrganizationConfigRuleStatusesOutput struct {
56
57	// The nextToken string returned on a previous page that you use to get the next
58	// page of results in a paginated response.
59	NextToken *string
60
61	// A list of OrganizationConfigRuleStatus objects.
62	OrganizationConfigRuleStatuses []types.OrganizationConfigRuleStatus
63
64	// Metadata pertaining to the operation's result.
65	ResultMetadata middleware.Metadata
66}
67
68func addOperationDescribeOrganizationConfigRuleStatusesMiddlewares(stack *middleware.Stack, options Options) (err error) {
69	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOrganizationConfigRuleStatuses{}, middleware.After)
70	if err != nil {
71		return err
72	}
73	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeOrganizationConfigRuleStatuses{}, middleware.After)
74	if err != nil {
75		return err
76	}
77	if err = addSetLoggerMiddleware(stack, options); err != nil {
78		return err
79	}
80	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
81		return err
82	}
83	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
84		return err
85	}
86	if err = addResolveEndpointMiddleware(stack, options); err != nil {
87		return err
88	}
89	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
90		return err
91	}
92	if err = addRetryMiddlewares(stack, options); err != nil {
93		return err
94	}
95	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
96		return err
97	}
98	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
99		return err
100	}
101	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
102		return err
103	}
104	if err = addClientUserAgent(stack); err != nil {
105		return err
106	}
107	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
108		return err
109	}
110	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
111		return err
112	}
113	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrganizationConfigRuleStatuses(options.Region), middleware.Before); err != nil {
114		return err
115	}
116	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
117		return err
118	}
119	if err = addResponseErrorMiddleware(stack); err != nil {
120		return err
121	}
122	if err = addRequestResponseLogging(stack, options); err != nil {
123		return err
124	}
125	return nil
126}
127
128func newServiceMetadataMiddleware_opDescribeOrganizationConfigRuleStatuses(region string) *awsmiddleware.RegisterServiceMetadata {
129	return &awsmiddleware.RegisterServiceMetadata{
130		Region:        region,
131		ServiceID:     ServiceID,
132		SigningName:   "config",
133		OperationName: "DescribeOrganizationConfigRuleStatuses",
134	}
135}
136