code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_RegisterClient.go (4192B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package ssooidc
      4 
      5 import (
      6 	"context"
      7 	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
      8 	"github.com/aws/smithy-go/middleware"
      9 	smithyhttp "github.com/aws/smithy-go/transport/http"
     10 )
     11 
     12 // Registers a client with IAM Identity Center. This allows clients to initiate
     13 // device authorization. The output should be persisted for reuse through many
     14 // authentication requests.
     15 func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) {
     16 	if params == nil {
     17 		params = &RegisterClientInput{}
     18 	}
     19 
     20 	result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares)
     21 	if err != nil {
     22 		return nil, err
     23 	}
     24 
     25 	out := result.(*RegisterClientOutput)
     26 	out.ResultMetadata = metadata
     27 	return out, nil
     28 }
     29 
     30 type RegisterClientInput struct {
     31 
     32 	// The friendly name of the client.
     33 	//
     34 	// This member is required.
     35 	ClientName *string
     36 
     37 	// The type of client. The service supports only public as a client type. Anything
     38 	// other than public will be rejected by the service.
     39 	//
     40 	// This member is required.
     41 	ClientType *string
     42 
     43 	// The list of scopes that are defined by the client. Upon authorization, this list
     44 	// is used to restrict permissions when granting an access token.
     45 	Scopes []string
     46 
     47 	noSmithyDocumentSerde
     48 }
     49 
     50 type RegisterClientOutput struct {
     51 
     52 	// The endpoint where the client can request authorization.
     53 	AuthorizationEndpoint *string
     54 
     55 	// The unique identifier string for each client. This client uses this identifier
     56 	// to get authenticated by the service in subsequent calls.
     57 	ClientId *string
     58 
     59 	// Indicates the time at which the clientId and clientSecret were issued.
     60 	ClientIdIssuedAt int64
     61 
     62 	// A secret string generated for the client. The client will use this string to get
     63 	// authenticated by the service in subsequent calls.
     64 	ClientSecret *string
     65 
     66 	// Indicates the time at which the clientId and clientSecret will become invalid.
     67 	ClientSecretExpiresAt int64
     68 
     69 	// The endpoint where the client can get an access token.
     70 	TokenEndpoint *string
     71 
     72 	// Metadata pertaining to the operation's result.
     73 	ResultMetadata middleware.Metadata
     74 
     75 	noSmithyDocumentSerde
     76 }
     77 
     78 func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) {
     79 	err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After)
     80 	if err != nil {
     81 		return err
     82 	}
     83 	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After)
     84 	if err != nil {
     85 		return err
     86 	}
     87 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     88 		return err
     89 	}
     90 	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
     91 		return err
     92 	}
     93 	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
     94 		return err
     95 	}
     96 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
     97 		return err
     98 	}
     99 	if err = addRetryMiddlewares(stack, options); err != nil {
    100 		return err
    101 	}
    102 	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
    103 		return err
    104 	}
    105 	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
    106 		return err
    107 	}
    108 	if err = addClientUserAgent(stack); err != nil {
    109 		return err
    110 	}
    111 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    112 		return err
    113 	}
    114 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    115 		return err
    116 	}
    117 	if err = addOpRegisterClientValidationMiddleware(stack); err != nil {
    118 		return err
    119 	}
    120 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil {
    121 		return err
    122 	}
    123 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    124 		return err
    125 	}
    126 	if err = addResponseErrorMiddleware(stack); err != nil {
    127 		return err
    128 	}
    129 	if err = addRequestResponseLogging(stack, options); err != nil {
    130 		return err
    131 	}
    132 	return nil
    133 }
    134 
    135 func newServiceMetadataMiddleware_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata {
    136 	return &awsmiddleware.RegisterServiceMetadata{
    137 		Region:        region,
    138 		ServiceID:     ServiceID,
    139 		OperationName: "RegisterClient",
    140 	}
    141 }