/// <summary> /// Initializes a new instance of <see cref="DocuSignClient"/> with default /// with default base path (https://www.docusign.net/restapi). /// </summary> public DocuSignClient() { Configuration = new Configuration(); SetBasePath(Production_REST_BasePath); RestClient = buildDefaultHttpClient(); SetOAuthBasePath(); RestClient.AddDefaultRequestHeader("User-Agent", Configuration.UserAgent); }
/// <summary> /// Initializes a new instance of <see cref="DocuSignClient"/> using /// the provided configuration with the default base path (https://www.docusign.net/restapi). /// </summary> /// <param name="configuration">Provided pre-populated <see cref="Configuration"/> object</param> public DocuSignClient(Configuration configuration) { Configuration = configuration ?? new Configuration(); SetBasePath(string.IsNullOrEmpty(configuration.BasePath) ? configuration.BasePath : Production_REST_BasePath); RestClient = buildDefaultHttpClient(configuration?.Timeout ?? Configuration.DefaultTimeoutValue); SetOAuthBasePath(); RestClient.AddDefaultRequestHeader("User-Agent", Configuration.UserAgent); }
/// <summary> /// Initializes a new instance of <see cref="DocuSignClient" /> configured with /// the provided API base path and optional <see cref="IWebProxy"/> object /// </summary> /// <param name="apiBase">The API base path</param> /// <param name="proxy">An optional IWebProxy instance</param> /// <exception cref="ArgumentException">Thwon when apiBase is null or empty</exception> public DocuSignClient(String apiBase, IWebProxy proxy = null) { if (String.IsNullOrEmpty(apiBase)) { throw new ArgumentException("apiBase cannot be empty"); } RestClient = buildDefaultHttpClient(Configuration.DefaultTimeoutValue, proxy); Configuration = new Configuration(apiBase); RestClient.AddDefaultRequestHeader("User-Agent", Configuration.UserAgent); this.SetBasePath(apiBase); this.SetOAuthBasePath(); }