1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package workmail
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/workmail/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Returns the data available for the group.
16func (c *Client) DescribeGroup(ctx context.Context, params *DescribeGroupInput, optFns ...func(*Options)) (*DescribeGroupOutput, error) {
17	if params == nil {
18		params = &DescribeGroupInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "DescribeGroup", params, optFns, addOperationDescribeGroupMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*DescribeGroupOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type DescribeGroupInput struct {
32
33	// The identifier for the group to be described.
34	//
35	// This member is required.
36	GroupId *string
37
38	// The identifier for the organization under which the group exists.
39	//
40	// This member is required.
41	OrganizationId *string
42}
43
44type DescribeGroupOutput struct {
45
46	// The date and time when a user was deregistered from WorkMail, in UNIX epoch time
47	// format.
48	DisabledDate *time.Time
49
50	// The email of the described group.
51	Email *string
52
53	// The date and time when a user was registered to WorkMail, in UNIX epoch time
54	// format.
55	EnabledDate *time.Time
56
57	// The identifier of the described group.
58	GroupId *string
59
60	// The name of the described group.
61	Name *string
62
63	// The state of the user: enabled (registered to Amazon WorkMail) or disabled
64	// (deregistered or never registered to WorkMail).
65	State types.EntityState
66
67	// Metadata pertaining to the operation's result.
68	ResultMetadata middleware.Metadata
69}
70
71func addOperationDescribeGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
72	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeGroup{}, middleware.After)
73	if err != nil {
74		return err
75	}
76	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeGroup{}, middleware.After)
77	if err != nil {
78		return err
79	}
80	if err = addSetLoggerMiddleware(stack, options); err != nil {
81		return err
82	}
83	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
84		return err
85	}
86	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
87		return err
88	}
89	if err = addResolveEndpointMiddleware(stack, options); err != nil {
90		return err
91	}
92	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
93		return err
94	}
95	if err = addRetryMiddlewares(stack, options); err != nil {
96		return err
97	}
98	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
99		return err
100	}
101	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
102		return err
103	}
104	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
105		return err
106	}
107	if err = addClientUserAgent(stack); err != nil {
108		return err
109	}
110	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
111		return err
112	}
113	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
114		return err
115	}
116	if err = addOpDescribeGroupValidationMiddleware(stack); err != nil {
117		return err
118	}
119	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGroup(options.Region), middleware.Before); err != nil {
120		return err
121	}
122	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
123		return err
124	}
125	if err = addResponseErrorMiddleware(stack); err != nil {
126		return err
127	}
128	if err = addRequestResponseLogging(stack, options); err != nil {
129		return err
130	}
131	return nil
132}
133
134func newServiceMetadataMiddleware_opDescribeGroup(region string) *awsmiddleware.RegisterServiceMetadata {
135	return &awsmiddleware.RegisterServiceMetadata{
136		Region:        region,
137		ServiceID:     ServiceID,
138		SigningName:   "workmail",
139		OperationName: "DescribeGroup",
140	}
141}
142