internal ReportingDownloadOperation(string requestId, AuthorizationData authorizationData, ReportingStatusProvider statusProvider, string trackingId, ApiEnvironment? apiEnvironment) { RequestId = requestId; AuthorizationData = authorizationData; _statusProvider = statusProvider; TrackingId = trackingId; StatusPollIntervalInMilliseconds = ReportingServiceManager.DefaultStatusPollIntervalInMilliseconds; _reportingServiceClient = new ServiceClient<IReportingService>(authorizationData, apiEnvironment); ZipExtractor = new ZipExtractor(); HttpService = new HttpService(); FileSystem = new FileSystem(); }
/// <summary> /// Initializes a new instance of this class with the specified <see cref="AuthorizationData"/>. /// </summary> /// <param name="authorizationData">Represents a user who intends to access the corresponding customer and account. </param> public ReportingServiceManager(AuthorizationData authorizationData) { if (authorizationData == null) { throw new ArgumentNullException("authorizationData"); } _authorizationData = authorizationData; HttpService = new HttpService(); ZipExtractor = new ZipExtractor(); FileSystem = new FileSystem(); StatusPollIntervalInMilliseconds = DefaultStatusPollIntervalInMilliseconds; WorkingDirectory = Path.Combine(Path.GetTempPath(), "BingAdsSDK", "Reporting"); }
/// <summary> /// Initializes a new instance of this class with the specified <see cref="AuthorizationData"/> and <paramref name="apiEnvironment"/>. /// </summary> /// <param name="authorizationData">Represents a user who intends to access the corresponding customer and account. </param> /// <param name="apiEnvironment">Bing Ads API environment</param> public ReportingServiceManager(AuthorizationData authorizationData, ApiEnvironment? apiEnvironment) { if (authorizationData == null) { throw new ArgumentNullException("authorizationData"); } _authorizationData = authorizationData; HttpService = new HttpService(); ZipExtractor = new ZipExtractor(); FileSystem = new FileSystem(); StatusPollIntervalInMilliseconds = DefaultStatusPollIntervalInMilliseconds; DownloadHttpTimeout = TimeSpan.FromMilliseconds(DefaultHttpClientTimeoutInMillseconds); WorkingDirectory = Path.Combine(Path.GetTempPath(), "BingAdsSDK", "Reporting"); if (apiEnvironment != null) _apiEnvironment = apiEnvironment.Value; }