AutoRest generates a client type based on command-line inputs and the specification (see Defining Clients with Swagger. The generated client inherits from the [ServiceClient]( base type which is in the *Microsoft.Rest.ClientRuntime* nuget package.

The client type has several constructors:

Default Constructor

The default constructor sets the Base URL of the client to the value provided in the specification. The client is configured to use anonymous authentication.

var myClient = new SwaggerPetstore();

Constructor with Base URL

The default Base URL from the specification can be overridden by passing a new URL when instantiating the client.

var myClient = new SwaggerPetstore(new Uri(""));

Constructor with Credentials