Example #1
0
        /// <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 BulkServiceManager(AuthorizationData authorizationData, ApiEnvironment?apiEnvironment)
        {
            if (authorizationData == null)
            {
                throw new ArgumentNullException("authorizationData");
            }

            _authorizationData = authorizationData;

            HttpService = new HttpService();

            ZipExtractor = new ZipExtractor();

            FileSystem = new FileSystem();

            BulkFileReaderFactory = new BulkFileReaderFactory();

            StatusPollIntervalInMilliseconds = DefaultStatusPollIntervalInMilliseconds;

            UploadHttpTimeout = TimeSpan.FromMilliseconds(DefaultHttpTimeoutInMillseconds);

            DownloadHttpTimeout = TimeSpan.FromMilliseconds(DefaultHttpTimeoutInMillseconds);

            WorkingDirectory = Path.Combine(Path.GetTempPath(), "BingAdsSDK");

            if (apiEnvironment != null)
            {
                _apiEnvironment = apiEnvironment.Value;
            }
        }
Example #2
0
        /// <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>
        /// <param name="environment">Bing Ads API environment</param>
        public ServiceClient(AuthorizationData authorizationData, ApiEnvironment?environment)
        {
            if (authorizationData == null)
            {
                throw new ArgumentNullException("authorizationData");
            }

            _authorizationData = authorizationData;

            _serviceClientFactory = ServiceClientFactoryFactory.CreateServiceClientFactory();

            if (!_serviceClientFactory.SupportedServiceTypes.Contains(typeof(TService)))
            {
                throw new InvalidOperationException(ErrorMessages.ApiServiceTypeMustBeInterface);
            }
            if (environment == null)
            {
                var envSetting = HostingEnvironment.IsHosted ?
                                 WebConfigurationManager.AppSettings[EnvironmentAppSetting] :
                                 ConfigurationManager.AppSettings[EnvironmentAppSetting];

                if (!Enum.TryParse(envSetting, out _environment))
                {
                    _environment = ApiEnvironment.Production;
                }
            }
            else
            {
                _environment = environment.Value;
            }

            _channelFactory = _serviceClientFactory.CreateChannelFactory <TService>(_environment);

            RefreshOAuthTokensAutomatically = true;
        }
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileAuthCodeGrant class with the specified ClientId.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="oauthTokens">
 /// Contains information about OAuth access tokens received from the Microsoft Account authorization service.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileAuthCodeGrant(
     string clientId,
     OAuthTokens oauthTokens,
     ApiEnvironment?environment = ApiEnvironment.Production,
     bool requireLiveConnect    = false)
     : base(clientId, null, null, oauthTokens, environment, requireLiveConnect)
 {
 }
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileImplicitGrant class.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="oAuthTokens">
 /// Contains information about OAuth access tokens received from the Microsoft Account authorization service.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// /// <remarks>
 /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileImplicitGrant(
     string clientId,
     OAuthTokens oAuthTokens,
     ApiEnvironment?environment = ApiEnvironment.Production,
     bool requireLiveConnect    = false)
     : base(clientId, environment, requireLiveConnect)
 {
     OAuthTokens = oAuthTokens;
 }
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileImplicitGrant class with the specified ClientId.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// For more information about using a client identifier for authentication, see
 /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileImplicitGrant(
     string clientId,
     ApiEnvironment?environment = ApiEnvironment.Production,
     bool requireLiveConnect    = false)
     : base(clientId, environment, requireLiveConnect)
 {
     _oauthService   = new UriOAuthService(Environment);
     _redirectionUri = _oauthService.RedirectionUri(requireLiveConnect);
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileAuthCodeGrant class with the specified ClientId.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="refreshToken">
 /// The refresh token that should be used to request an access token.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">
 /// Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileAuthCodeGrant(
     string clientId,
     string refreshToken,
     ApiEnvironment?environment = ApiEnvironment.Production,
     bool requireLiveConnect    = false,
     string tenant = "common")
     : base(clientId, null, null, refreshToken, environment, requireLiveConnect, tenant)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the OAuthWithAuthorizationCode class.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="optionalClientSecret">
 /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app.
 /// </param>
 /// <param name="redirectionUri">
 /// The URI to which the user of the app will be redirected after receiving user consent.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// <para>
 /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>
 /// </para>
 /// <para>
 /// For web applications, redirectionUri must be within the same domain of your registered application.
 /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>.
 /// </para>
 /// </remarks>
 protected OAuthWithAuthorizationCode(
     string clientId,
     string optionalClientSecret,
     Uri redirectionUri,
     ApiEnvironment?environment,
     bool requireLiveConnect)
     :  base(clientId, environment, requireLiveConnect)
 {
     _optionalClientSecret = optionalClientSecret;
     _oauthService         = new UriOAuthService(Environment);
     _redirectionUri       = redirectionUri ?? _oauthService.RedirectionUri(requireLiveConnect);
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the OAuthWebAuthCodeGrant class.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="clientSecret">
 /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app.
 /// </param>
 /// <param name="redirectionUri">
 /// The URI to which the user of the app will be redirected after receiving user consent.
 /// </param>
 /// <param name="oAuthTokens">
 /// Contains information about OAuth access tokens received from the Microsoft Account authorization service.
 /// </param>
 /// <param name="environment">
 /// The environment the application runs in. Value should be either <see cref="ApiEnvironment.Production"/> or <see cref="ApiEnvironment.Sandbox"/>.
 /// If null is given, application will detect the application environment from configuration.
 /// </param>
 /// <remarks>
 /// <para>
 /// For more information about using a client identifier for authentication, see
 /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </para>
 /// <para>
 /// For web applications, redirectionUri must be within the same domain of your registered application.
 /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>.
 /// </para>
 /// </remarks>
 public OAuthWebAuthCodeGrant(
     string clientId,
     string clientSecret,
     Uri redirectionUri,
     OAuthTokens oAuthTokens,
     ApiEnvironment?environment = ApiEnvironment.Production,
     bool requireLiveConnect    = false)
     : base(clientId, clientSecret, redirectionUri, oAuthTokens, environment, requireLiveConnect)
 {
     if (clientSecret == null)
     {
         throw new ArgumentNullException("clientSecret");
     }
 }
 /// <summary>
 /// Initializes a new instance of the OAuthWebAuthCodeGrant class.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="clientSecret">
 /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app.
 /// </param>
 /// <param name="redirectionUri">
 /// The URI to which the user of the app will be redirected after receiving user consent.
 /// </param>
 /// <param name="refreshToken">
 /// The refresh token that should be used to request an access token.
 /// </param>
 /// <param name="environment">
 /// The environment the application runs in. Value should be either <see cref="ApiEnvironment.Production"/> or <see cref="ApiEnvironment.Sandbox"/>.
 /// If null is given, application will detect the application environment from configuration.
 /// </param>
 /// <remarks>
 /// <para>
 /// For more information about using a client identifier for authentication, see
 /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </para>
 /// <para>
 /// For web applications, redirectionUri must be within the same domain of your registered application.
 /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>.
 /// </para>
 /// </remarks>
 public OAuthWebAuthCodeGrant(
     string clientId,
     string clientSecret,
     Uri redirectionUri,
     string refreshToken,
     ApiEnvironment?environment = ApiEnvironment.Production,
     bool requireLiveConnect    = false,
     string tenant = "common")
     : base(clientId, clientSecret, redirectionUri, refreshToken, environment, requireLiveConnect, tenant)
 {
     if (clientSecret == null)
     {
         throw new ArgumentNullException("clientSecret");
     }
 }
Example #10
0
        /// <summary>
        /// Initializes a new instance of the OAuthWithAuthorizationCode class.
        /// </summary>
        /// <param name="clientId">
        /// The client identifier corresponding to your registered application.
        /// </param>
        /// <param name="optionalClientSecret">
        /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app.
        /// </param>
        /// <param name="redirectionUri">
        /// The URI to which the user of the app will be redirected after receiving user consent.
        /// </param>
        /// <param name="refreshToken">
        /// The refresh token that should be used to request an access token.
        /// </param>
        /// <param name="environment">Bing Ads API environment</param>
        /// <remarks>
        /// <para>
        /// For more information about using a client identifier for authentication, see
        /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>
        /// </para>
        /// <para>
        /// For web applications, redirectionUri must be within the same domain of your registered application.
        /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>.
        /// </para>
        /// </remarks>
        protected OAuthWithAuthorizationCode(
            string clientId,
            string optionalClientSecret,
            Uri redirectionUri,
            string refreshToken,
            ApiEnvironment?environment,
            bool requireLiveConnect)
            : this(clientId, optionalClientSecret, redirectionUri, environment, requireLiveConnect)
        {
            if (refreshToken == null)
            {
                throw new ArgumentNullException("refreshToken");
            }

            OAuthTokens = new OAuthTokens(null, 0, refreshToken);
        }
Example #11
0
        /// <summary>
        /// Initializes a new instance of the OAuthWebAuthCodeGrant class.
        /// </summary>
        /// <param name="clientId">
        /// The client identifier corresponding to your registered application.
        /// </param>
        /// <param name="optionalClientSecret">
        /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app.
        /// </param>
        /// <param name="redirectionUri">
        /// The URI to which the user of the app will be redirected after receiving user consent.
        /// </param>
        /// <param name="oauthTokens">
        /// Contains information about OAuth access tokens received from the Microsoft Account authorization service.
        /// </param>
        /// <param name="environment">Bing Ads API environment</param>
        /// <remarks>
        /// <para>
        /// For more information about using a client identifier for authentication, see
        /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
        /// </para>
        /// <para>
        /// For web applications, redirectionUri must be within the same domain of your registered application.
        /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>.
        /// </para>
        /// </remarks>
        protected OAuthWithAuthorizationCode(
            string clientId,
            string optionalClientSecret,
            Uri redirectionUri,
            OAuthTokens oauthTokens,
            ApiEnvironment?environment,
            bool requireLiveConnect)
            : this(clientId, optionalClientSecret, redirectionUri, environment, requireLiveConnect)
        {
            if (oauthTokens == null || oauthTokens.RefreshToken == null)
            {
                throw new ArgumentNullException("oAuthTokens");
            }

            OAuthTokens = new OAuthTokens(null, 0, oauthTokens.RefreshToken, oauthTokens.ResponseFragments);
        }
Example #12
0
        private void DetectApiEnvironment(AuthorizationData authorizationData, ApiEnvironment?environment)
        {
            var oauth = authorizationData.Authentication as OAuthAuthorization;

            if (oauth != null)
            {
                environment = oauth.Environment;
            }

            if (environment == null)
            {
                _environment = ApiEnvironment.Production;
            }
            else
            {
                _environment = environment.Value;
            }
        }
        /// <summary>
        /// Initializes a new instance of the OAuthAuthorization class with the specified <paramref name="clientId"/>.
        /// </summary>
        /// <param name="clientId">
        /// The client identifier corresponding to your registered application.
        /// </param>
        /// <param name="environment">Bing Ads API environment</param>
        /// <remarks>
        /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
        /// </remarks>
        protected OAuthAuthorization(string clientId, ApiEnvironment?environment)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException("clientId");
            }

            ClientId = clientId;

            if (environment == null)
            {
                _environment = ApiEnvironment.Production;
            }
            else
            {
                _environment = environment.Value;
            }
        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the OAuthAuthorization class with the specified <paramref name="clientId"/>.
        /// </summary>
        /// <param name="clientId">
        /// The client identifier corresponding to your registered application.
        /// </param>
        /// <param name="environment">Bing Ads API environment</param>
        /// <remarks>
        /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
        /// </remarks>
        protected OAuthAuthorization(string clientId, ApiEnvironment?environment, bool requireLiveConnect)
        {
            if (clientId == null)
            {
                throw new ArgumentNullException("clientId");
            }

            ClientId = clientId;

            if (environment == null)
            {
                Environment = ApiEnvironment.Production;
            }
            else
            {
                Environment = environment.Value;
            }

            RequireLiveConnect = requireLiveConnect;
        }
Example #15
0
        /// <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>
        /// <param name="environment">Bing Ads API environment</param>
        public ServiceClient(AuthorizationData authorizationData, ApiEnvironment?environment)
        {
            if (authorizationData == null)
            {
                throw new ArgumentNullException("authorizationData");
            }

            _authorizationData = authorizationData;

            _serviceClientFactory = ServiceClientFactoryFactory.CreateServiceClientFactory();

            if (!_serviceClientFactory.SupportedServiceTypes.Contains(typeof(TService)))
            {
                throw new InvalidOperationException(ErrorMessages.ApiServiceTypeMustBeInterface);
            }

            DetectApiEnvironment(authorizationData, environment);

            _channelFactory = _serviceClientFactory.CreateChannelFactory <TService>(_environment);

            RefreshOAuthTokensAutomatically = true;
        }
        /// <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;

            WorkingDirectory = Path.Combine(Path.GetTempPath(), "BingAdsSDK", "Reporting");

            if (apiEnvironment != null)
            {
                _apiEnvironment = apiEnvironment.Value;
            }
        }
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileAuthCodeGrant class with the specified ClientId.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="refreshToken">
 /// The refresh token that should be used to request an access token.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">
 /// Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileAuthCodeGrant(string clientId, string refreshToken, ApiEnvironment?environment = ApiEnvironment.Production)
     : base(clientId, null, null, refreshToken, environment)
 {
 }
        /// <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;

            WorkingDirectory = Path.Combine(Path.GetTempPath(), "BingAdsSDK", "Reporting");

            if (apiEnvironment != null) _apiEnvironment = apiEnvironment.Value;
        }
Example #19
0
        internal BulkOperation(string requestId, AuthorizationData authorizationData, IBulkOperationStatusProvider <TStatus> statusProvider, string trackingId, ApiEnvironment?apiEnvironment)
        {
            RequestId = requestId;

            AuthorizationData = authorizationData;

            _statusProvider = statusProvider;

            TrackingId = trackingId;

            StatusPollIntervalInMilliseconds = BulkServiceManager.DefaultStatusPollIntervalInMilliseconds;

            DownloadHttpTimeout = TimeSpan.FromMilliseconds(BulkServiceManager.DefaultHttpTimeoutInMillseconds);

            _bulkServiceClient = new ServiceClient <IBulkService>(authorizationData, apiEnvironment);

            ZipExtractor = new ZipExtractor();

            HttpService = new HttpService();

            FileSystem = new FileSystem();
        }
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileImplicitGrant class with the specified ClientId.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// For more information about using a client identifier for authentication, see
 /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileImplicitGrant(string clientId, ApiEnvironment?environment = ApiEnvironment.Production)
     : base(clientId, environment)
 {
 }
 internal ReportingDownloadOperation(string requestId, AuthorizationData authorizationData, string trackingId, ApiEnvironment?apiEnvironment)
     : this(requestId, authorizationData, new ReportingStatusProvider(requestId), trackingId, apiEnvironment)
 {
 }
Example #22
0
 /// <summary>
 /// Initializes a new instance of this class with the specified <paramref name="requestId"/>, <see cref="AuthorizationData"/> and <paramref name="apiEnvironment"/>.
 /// </summary>
 /// <param name="requestId">The identifier of an upload request that has previously been submitted.</param>
 /// <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 BulkUploadOperation(string requestId, AuthorizationData authorizationData, ApiEnvironment?apiEnvironment)
     : this(requestId, authorizationData, null, apiEnvironment)
 {
 }
Example #23
0
        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 the OAuthWebAuthCodeGrant class.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="clientSecret">
 /// The client secret corresponding to your registered application, or null if your app is a desktop or mobile app.
 /// </param>
 /// <param name="redirectionUri">
 /// The URI to which the user of the app will be redirected after receiving user consent.
 /// </param>
 /// <param name="refreshToken">
 /// The refresh token that should be used to request an access token.
 /// </param>
 /// <param name="environment">
 /// The environment the application runs in. Value should be either <see cref="ApiEnvironment.Production"/> or <see cref="ApiEnvironment.Sandbox"/>.
 /// If null is given, application will detect the application environment from configuration.
 /// </param>
 /// <remarks>
 /// <para>
 /// For more information about using a client identifier for authentication, see
 /// <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </para>
 /// <para>
 /// For web applications, redirectionUri must be within the same domain of your registered application.
 /// For more information, see <see href="https://tools.ietf.org/html/rfc6749#section-2.1.1">Redirection Uri section of the OAuth 2.0 spec</see>.
 /// </para>
 /// </remarks>
 public OAuthWebAuthCodeGrant(string clientId, string clientSecret, Uri redirectionUri, string refreshToken, ApiEnvironment?environment = ApiEnvironment.Production)
     : base(clientId, clientSecret, redirectionUri, refreshToken, environment)
 {
     if (clientSecret == null)
     {
         throw new ArgumentNullException("clientSecret");
     }
 }
Example #25
0
 internal BulkUploadOperation(string requestId, AuthorizationData authorizationData, string trackingId, ApiEnvironment?apiEnvironment)
     : base(requestId, authorizationData, new UploadStatusProvider(requestId), trackingId, apiEnvironment)
 {
 }
 /// <summary>
 /// Initializes a new instance of the OAuthDesktopMobileAuthCodeGrant class with the specified ClientId.
 /// </summary>
 /// <param name="clientId">
 /// The client identifier corresponding to your registered application.
 /// </param>
 /// <param name="oauthTokens">
 /// Contains information about OAuth access tokens received from the Microsoft Account authorization service.
 /// </param>
 /// <param name="environment">Bing Ads API environment</param>
 /// <remarks>
 /// For more information about using a client identifier for authentication, see <see href="https://tools.ietf.org/html/rfc6749#section-3.1">Client Password Authentication section of the OAuth 2.0 spec</see>.
 /// </remarks>
 public OAuthDesktopMobileAuthCodeGrant(string clientId, OAuthTokens oauthTokens, ApiEnvironment?environment = ApiEnvironment.Production)
     : base(clientId, null, null, oauthTokens, environment)
 {
 }