From 0fd2d77d46d68661e36b3e1663f83f0e684fe85f Mon Sep 17 00:00:00 2001 From: Jason Del Ponte Date: Thu, 23 Apr 2020 16:29:51 -0700 Subject: [PATCH] move client private members to be private --- .../lexruntimeservice/api_client.go | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/service/smithyprototype/lexruntimeservice/api_client.go b/service/smithyprototype/lexruntimeservice/api_client.go index 29056b1dabe..3d47eca7a18 100644 --- a/service/smithyprototype/lexruntimeservice/api_client.go +++ b/service/smithyprototype/lexruntimeservice/api_client.go @@ -15,18 +15,18 @@ import ( // Client provides the client for interacting with the Amazon Lex Runtime Service. type Client struct { - options ClientOptions + serviceName string + serviceID string + endpointID string + options ClientOptions } // ClientOptions provides the set of configurations that can be applied to the // Client. Use functional options to modify this set when creating the client, // or when invoking API operations. type ClientOptions struct { - ServiceName string - ServiceID string - EndpointID string + RegionID string - RegionID string EndpointResolver aws.EndpointResolver HTTPClient HTTPClient @@ -57,14 +57,14 @@ type HTTPClient interface { // specify the behavior of the client. func NewClient(cfg aws.Config, opts ...func(*ClientOptions)) *Client { client := &Client{ - options: ClientOptions{ - ServiceName: "Amazon Lex Runtime Service", - ServiceID: "LexRuntimeService", - EndpointID: "runtime.lex", + serviceName: "Amazon Lex Runtime Service", + serviceID: "LexRuntimeService", + endpointID: "runtime.lex", + options: ClientOptions{ RegionID: cfg.Region, - Signer: v4.NewSigner(cfg.Credentials), EndpointResolver: cfg.EndpointResolver, + Signer: v4.NewSigner(cfg.Credentials), HTTPClient: cfg.HTTPClient, }, } @@ -76,6 +76,12 @@ func NewClient(cfg aws.Config, opts ...func(*ClientOptions)) *Client { return client } +// ServiceID returns the name of the identifier for the service API. +func (c *Client) ServiceID() string { return c.serviceID } + +// ServiceName returns the full service name. +func (c *Client) ServiceName() string { return c.serviceName } + // APIOptionFunc provides the type for overriding options for API operation // calls. Allows modifying the middleware stack, and client options per API // operation call. @@ -84,7 +90,6 @@ type APIOptionFunc func(*ClientOptions, *middleware.Stack) error func (c *Client) invoke(ctx context.Context, stack *middleware.Stack, input interface{}, opts ...APIOptionFunc) ( result interface{}, metadata middleware.Metadata, err error, ) { - clientOptions := c.options for _, fn := range c.options.APIOptions { if err := fn(&clientOptions, stack); err != nil {