Table of Contents

Class OAuthFlowBuilder

Namespace
Smartsheet.Api.OAuth
Assembly
smartsheet-csharp-sdk.dll

This is the builder that is used to build OAuthFlow instances.

Thread Safety: This class is not thread safe since it's mutable, one builder instance is NOT expected to be used in multiple threads.

public class OAuthFlowBuilder
Inheritance
OAuthFlowBuilder
Inherited Members

Constructors

OAuthFlowBuilder()

Constructor.

public OAuthFlowBuilder()

Fields

DEFAULT_AUTHORIZATION_URL

Represents the default OAuth authorization URL

It is a constant with Value "https://www.Smartsheet.com/b/authorize".

public const string DEFAULT_AUTHORIZATION_URL = "https://www.smartsheet.com/b/authorize"

Field Value

string

DEFAULT_TOKEN_URL

Represents the default token URL

It is a constant with Value "https://Api.Smartsheet.com/2.0/token".

public const string DEFAULT_TOKEN_URL = "https://api.smartsheet.com/2.0/token"

Field Value

string

Properties

AuthorizationURL

Gets the authorization Url.

public string AuthorizationURL { get; }

Property Value

string

the authorization Url

ClientId

Gets the client Id.

public string ClientId { get; }

Property Value

string

the client Id

ClientSecret

Gets the client secret.

public string ClientSecret { get; }

Property Value

string

the client secret

DefaultAuthorizationUrl

Gets the default authorization Url.

public static string DefaultAuthorizationUrl { get; }

Property Value

string

the default authorization Url

DefaultTokenUrl

Gets the default token Url.

public static string DefaultTokenUrl { get; }

Property Value

string

the default token Url

HttpClient

Gets the http client.

public HttpClient HttpClient { get; }

Property Value

HttpClient

the http client

JsonSerializer

Gets the Json serializer.

public JsonSerializer JsonSerializer { get; }

Property Value

JsonSerializer

the Json serializer

RedirectURL

Gets the redirect Url.

public string RedirectURL { get; }

Property Value

string

the redirect Url

TokenURL

Gets the token Url.

public string TokenURL { get; }

Property Value

string

the token Url

Methods

Build()

Build the OAuthFlow instance.

public OAuthFlow Build()

Returns

OAuthFlow

the OAuthFlow instance

Exceptions

InvalidOperationException

if ClientId, ClientSecret or RedirectURL isn't set yet.

SetAuthorizationURL(string)

Set the authorization URL.

public OAuthFlowBuilder SetAuthorizationURL(string authorizationURL)

Parameters

authorizationURL string

the authorization URL

Returns

OAuthFlowBuilder

the OAuthFlowBuilder

Exceptions

InvalidOperationException

if any argument is null/empty string

SetClientId(string)

Set the client ID

public OAuthFlowBuilder SetClientId(string clientId)

Parameters

clientId string

the Value to set

Returns

OAuthFlowBuilder

the OAuthFlowBuilder

Exceptions

InvalidOperationException

if any argument is null/empty string

SetClientSecret(string)

Set the client secret.

public OAuthFlowBuilder SetClientSecret(string clientSecret)

Parameters

clientSecret string

the client secret

Returns

OAuthFlowBuilder

the OAuthFlowBuilder

Exceptions

InvalidOperationException

if any argument is null/empty string

SetHttpClient(HttpClient)

Set the HttpClient.

public OAuthFlowBuilder SetHttpClient(HttpClient httpClient)

Parameters

httpClient HttpClient

the HttpClient

Returns

OAuthFlowBuilder

the OAuthFlowBuilder

SetJsonSerializer(JsonSerializer)

Set the JsonSerializer.

public OAuthFlowBuilder SetJsonSerializer(JsonSerializer jsonSerializer)

Parameters

jsonSerializer JsonSerializer

the JsonSerializer

Returns

OAuthFlowBuilder

the oAuthFlowBuilder

Exceptions

InvalidOperationException

if any argument is null/empty string

SetRedirectURL(string)

Set the redirect URL

public OAuthFlowBuilder SetRedirectURL(string redirectURL)

Parameters

redirectURL string

the redirect Url

Returns

OAuthFlowBuilder

the OAuthFlowBuilder

Exceptions

InvalidOperationException

if any argument is null/empty string

SetTokenURL(string)

Set the token URL.

public OAuthFlowBuilder SetTokenURL(string tokenURL)

Parameters

tokenURL string

the token Url

Returns

OAuthFlowBuilder

the OAuthFlowBuilder

Exceptions

InvalidOperationException

if any argument is null/empty string