1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package codestar
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/smithy-go/middleware"
10	smithyhttp "github.com/aws/smithy-go/transport/http"
11	"time"
12)
13
14// Describes a user in AWS CodeStar and the user attributes across all projects.
15func (c *Client) DescribeUserProfile(ctx context.Context, params *DescribeUserProfileInput, optFns ...func(*Options)) (*DescribeUserProfileOutput, error) {
16	if params == nil {
17		params = &DescribeUserProfileInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "DescribeUserProfile", params, optFns, addOperationDescribeUserProfileMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*DescribeUserProfileOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type DescribeUserProfileInput struct {
31
32	// The Amazon Resource Name (ARN) of the user.
33	//
34	// This member is required.
35	UserArn *string
36}
37
38type DescribeUserProfileOutput struct {
39
40	// The date and time when the user profile was created in AWS CodeStar, in
41	// timestamp format.
42	//
43	// This member is required.
44	CreatedTimestamp *time.Time
45
46	// The date and time when the user profile was last modified, in timestamp format.
47	//
48	// This member is required.
49	LastModifiedTimestamp *time.Time
50
51	// The Amazon Resource Name (ARN) of the user.
52	//
53	// This member is required.
54	UserArn *string
55
56	// The display name shown for the user in AWS CodeStar projects. For example, this
57	// could be set to both first and last name ("Mary Major") or a single name
58	// ("Mary"). The display name is also used to generate the initial icon associated
59	// with the user in AWS CodeStar projects. If spaces are included in the display
60	// name, the first character that appears after the space will be used as the
61	// second character in the user initial icon. The initial icon displays a maximum
62	// of two characters, so a display name with more than one space (for example "Mary
63	// Jane Major") would generate an initial icon using the first character and the
64	// first character after the space ("MJ", not "MM").
65	DisplayName *string
66
67	// The email address for the user. Optional.
68	EmailAddress *string
69
70	// The SSH public key associated with the user. This SSH public key is associated
71	// with the user profile, and can be used in conjunction with the associated
72	// private key for access to project resources, such as Amazon EC2 instances, if a
73	// project owner grants remote access to those resources.
74	SshPublicKey *string
75
76	// Metadata pertaining to the operation's result.
77	ResultMetadata middleware.Metadata
78}
79
80func addOperationDescribeUserProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
81	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeUserProfile{}, middleware.After)
82	if err != nil {
83		return err
84	}
85	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeUserProfile{}, middleware.After)
86	if err != nil {
87		return err
88	}
89	if err = addSetLoggerMiddleware(stack, options); err != nil {
90		return err
91	}
92	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
93		return err
94	}
95	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
96		return err
97	}
98	if err = addResolveEndpointMiddleware(stack, options); err != nil {
99		return err
100	}
101	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
102		return err
103	}
104	if err = addRetryMiddlewares(stack, options); err != nil {
105		return err
106	}
107	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
108		return err
109	}
110	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
111		return err
112	}
113	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
114		return err
115	}
116	if err = addClientUserAgent(stack); err != nil {
117		return err
118	}
119	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
120		return err
121	}
122	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
123		return err
124	}
125	if err = addOpDescribeUserProfileValidationMiddleware(stack); err != nil {
126		return err
127	}
128	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeUserProfile(options.Region), middleware.Before); err != nil {
129		return err
130	}
131	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
132		return err
133	}
134	if err = addResponseErrorMiddleware(stack); err != nil {
135		return err
136	}
137	if err = addRequestResponseLogging(stack, options); err != nil {
138		return err
139	}
140	return nil
141}
142
143func newServiceMetadataMiddleware_opDescribeUserProfile(region string) *awsmiddleware.RegisterServiceMetadata {
144	return &awsmiddleware.RegisterServiceMetadata{
145		Region:        region,
146		ServiceID:     ServiceID,
147		SigningName:   "codestar",
148		OperationName: "DescribeUserProfile",
149	}
150}
151