/// <summary> /// Build the OAuthFlow instance. /// </summary> /// <returns> the OAuthFlow instance </returns> /// <exception cref="System.InvalidOperationException"> if ClientId, ClientSecret or RedirectURL isn't set yet. </exception> public virtual OAuthFlow Build() { if (httpClient == null) { httpClient = new DefaultHttpClient(); } if (tokenURL == null) { tokenURL = DEFAULT_TOKEN_URL; } if (authorizationURL == null) { authorizationURL = DEFAULT_AUTHORIZATION_URL; } if (jsonSerializer == null) { jsonSerializer = new JsonNetSerializer(); } if (clientId == null || clientSecret == null || redirectURL == null) { throw new InvalidOperationException(); } return(new OAuthFlowImpl(clientId, clientSecret, redirectURL, authorizationURL, tokenURL, httpClient, jsonSerializer)); }
/// <summary> /// Set the HttpClient. /// </summary> /// <param name="httpClient"> the HttpClient </param> /// <returns> the OAuthFlowBuilder </returns> public virtual OAuthFlowBuilder SetHttpClient(HttpClient httpClient) { Util.ThrowIfNull(httpClient); this.httpClient = httpClient; return(this); }
/// <summary> /// Set the HttpClient. /// </summary> /// <param name="httpClient"> the HttpClient </param> /// <returns> the OAuthFlowBuilder </returns> public virtual OAuthFlowBuilder SetHttpClient(HttpClient httpClient) { Util.ThrowIfNull(httpClient); this.httpClient = httpClient; return this; }
/// <summary> /// Build the OAuthFlow instance. /// </summary> /// <returns> the OAuthFlow instance </returns> /// <exception cref="System.InvalidOperationException"> if ClientId, ClientSecret or RedirectURL isn't set yet. </exception> public virtual OAuthFlow Build() { if (httpClient == null) { httpClient = new DefaultHttpClient(); } if (tokenURL == null) { tokenURL = DEFAULT_TOKEN_URL; } if (authorizationURL == null) { authorizationURL = DEFAULT_AUTHORIZATION_URL; } if (jsonSerializer == null) { jsonSerializer = new JsonNetSerializer(); } if (clientId == null || clientSecret == null || redirectURL == null) { throw new InvalidOperationException(); } return new OAuthFlowImpl(clientId, clientSecret, redirectURL, authorizationURL, tokenURL, httpClient, jsonSerializer); }