public DesignAutomationClient(ForgeService service = null, IOptions <Configuration> configuration = null, IActivitiesApi activities = null, IAppBundlesApi appBundles = null, IEnginesApi engines = null, IForgeAppsApi forgeApps = null, IHealthApi health = null, IServiceLimitsApi serviceLimits = null, ISharesApi shares = null, IWorkItemsApi workItems = null) { this.Configuration = configuration?.Value ?? new Configuration(); this.Service = service ?? ForgeService.CreateDefault(); // set BaseAddress from configuration this.Service.Client.BaseAddress = Configuration.BaseAddress; this.ActivitiesApi = activities ?? new ActivitiesApi(service, configuration); this.AppBundlesApi = appBundles ?? new AppBundlesApi(service, configuration); this.EnginesApi = engines ?? new EnginesApi(service, configuration); this.ForgeAppsApi = forgeApps ?? new ForgeAppsApi(service, configuration); this.HealthApi = health ?? new HealthApi(service, configuration); this.ServiceLimitsApi = serviceLimits ?? new ServiceLimitsApi(service, configuration); this.SharesApi = shares ?? new SharesApi(service, configuration); this.WorkItemsApi = workItems ?? new WorkItemsApi(service, configuration); }
public DesignAutomationClient(ForgeService service = null, IOptions <Configuration> configuration = null, IActivitiesApi activitiesApi = null, IAppBundlesApi appBundlesApi = null, IEnginesApi enginesApi = null, IForgeAppsApi forgeAppsApi = null, IHealthApi healthApi = null, ISharesApi sharesApi = null, IWorkItemsApi workItemsApi = null) { this.Service = service ?? ForgeService.CreateDefault(); // set BaseAddress from configuration or default this.Service.Client.BaseAddress = configuration?.Value.BaseAddress ?? new Configuration().BaseAddress; if (this.ActivitiesApi == null) { this.ActivitiesApi = new ActivitiesApi(service, configuration); } else { this.ActivitiesApi = activitiesApi; } if (this.AppBundlesApi == null) { this.AppBundlesApi = new AppBundlesApi(service, configuration); } else { this.AppBundlesApi = appBundlesApi; } if (this.EnginesApi == null) { this.EnginesApi = new EnginesApi(service, configuration); } else { this.EnginesApi = enginesApi; } if (this.ForgeAppsApi == null) { this.ForgeAppsApi = new ForgeAppsApi(service, configuration); } else { this.ForgeAppsApi = forgeAppsApi; } if (this.HealthApi == null) { this.HealthApi = new HealthApi(service, configuration); } else { this.HealthApi = healthApi; } if (this.SharesApi == null) { this.SharesApi = new SharesApi(service, configuration); } else { this.SharesApi = sharesApi; } if (this.WorkItemsApi == null) { this.WorkItemsApi = new WorkItemsApi(service, configuration); } else { this.WorkItemsApi = workItemsApi; } }