-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corev2: client options types should extend CommonClientOptions
instead of ServiceClientOptions
#1135
Comments
The /**
* Options to be provided while creating the client.
*/
export declare interface ServiceClientOptions extends CommonClientOptions {
/**
* If specified, this is the base URI that requests will be made against for this ServiceClient.
* If it is not specified, then all OperationSpecs must contain a baseUrl property.
*/
baseUri?: string;
/**
* If specified, will be used to build the BearerTokenAuthenticationPolicy.
*/
credentialScopes?: string | string[];
/**
* The default request content type for the service.
* Used if no requestContentType is present on an OperationSpec.
*/
requestContentType?: string;
/**
* Credential used to authenticate the request.
*/
credential?: TokenCredential;
/**
* A customized pipeline to use, otherwise a default one will be created.
*/
pipeline?: Pipeline;
} As you can see, |
I have mixed feelings about this, right now Would there be an option to have this be a controllable behavior? e.g. we initially generate with only @jeremymeng @deyaaeldeen @joheredi @maorleger - any opinions here? |
I think it is a good idea to expose CommonClientOptions only, even for purely generated clients. Since CommonClientOptions is assignable to ServiceClientOptions we could use ServiceClientOptions internally in the generated client constructor. const commonOptions: ArtifactsClientOptionalParams & coreClient.ServiceClientOptions =
options ?? {}; Also in the convenience layer, we should be able to pass a ServiceClientOptions to the constructor if it takes declare const options: coreClient.ServiceClientOptions;
const foo = new ArtifactsClient({} as any, "", options); So maybe we could do the change without the need for a switch. I wonder if there are legit scenarios where properties of ServiceClientOptions would be needed by an SDK user. |
One notable thing in |
Small tweak to make sure we're extending the correct public interface.
The text was updated successfully, but these errors were encountered: