Table of Contents

Class SmartsheetBuilder

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

A convenience class to help create a SmartsheetClient instance with the appropriate fields.

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 SmartsheetBuilder
Inheritance
SmartsheetBuilder
Inherited Members

Constructors

SmartsheetBuilder()

Constructor.

public SmartsheetBuilder()

Fields

DEFAULT_BASE_URI

Represents the default base URI of the Smartsheet REST API.

It is a constant with Value "https://api.smartsheet.com/2.0".

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

Field Value

string

GOV_BASE_URI

Represents the base URI of the Smartsheetgov REST API.

It is a constant with Value "https://api.smartsheetgov.com/2.0".

public const string GOV_BASE_URI = "https://api.smartsheetgov.com/2.0/"

Field Value

string

SMARTSHEET_ACCESS_TOKEN

Represents the environment variable for locating the Smartsheet API access token.

It is a constant with Value "SMARTSHEET_ACCESS_TOKEN".

public const string SMARTSHEET_ACCESS_TOKEN = "SMARTSHEET_ACCESS_TOKEN"

Field Value

string

Properties

AccessToken

Gets the access token.

public string AccessToken { get; }

Property Value

string

the access token

AssumedUser

Gets the assumed user.

public string AssumedUser { get; }

Property Value

string

the assumed user

BaseURI

Gets the base uri.

public string BaseURI { get; }

Property Value

string

the base uri

DefaultBaseUri

Gets the default base uri.

public static string DefaultBaseUri { get; }

Property Value

string

the default base uri

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

Methods

Build()

Build the SmartsheetClient instance.

public SmartsheetClient Build()

Returns

SmartsheetClient

the SmartsheetClient instance

SetAccessToken(string)

Set the access token.

public SmartsheetBuilder SetAccessToken(string accessToken)

Parameters

accessToken string

the access token

Returns

SmartsheetBuilder

the SmartsheetClient builder

SetAssumedUser(string)

Set the assumed user.

public SmartsheetBuilder SetAssumedUser(string assumedUser)

Parameters

assumedUser string

the assumed user

Returns

SmartsheetBuilder

the SmartsheetClient builder

SetBaseURI(string)

Set the base URI.

public SmartsheetBuilder SetBaseURI(string baseURI)

Parameters

baseURI string

the base uri

Returns

SmartsheetBuilder

the SmartsheetClient builder

SetChangeAgent(string)

Set the Smartsheet change agent.

public SmartsheetBuilder SetChangeAgent(string changeAgent)

Parameters

changeAgent string

the change agent

Returns

SmartsheetBuilder

the SmartsheetClient builder

SetDateTimeFixOptOut(bool)

Set optional flag to re-enable JSON deserializers conversion from string to C# DateTime

public SmartsheetBuilder SetDateTimeFixOptOut(bool dateTimeFixOptOut)

Parameters

dateTimeFixOptOut bool

Returns

SmartsheetBuilder

SetHttpClient(HttpClient)

Set the HttpClient.

public SmartsheetBuilder SetHttpClient(HttpClient httpClient)

Parameters

httpClient HttpClient

the http client

Returns

SmartsheetBuilder

the SmartsheetClient builder

SetJsonSerializer(JsonSerializer)

Set the JsonSerializer.

public SmartsheetBuilder SetJsonSerializer(JsonSerializer jsonSerializer)

Parameters

jsonSerializer JsonSerializer

the JsonSerializer

Returns

SmartsheetBuilder

the SmartsheetBuilder

SetMaxRetryTimeout(long)

Create a DefaultCalcBackoff with a max elapsed timeout specified by the user. This interface is only valid when the DefaultHttpClient is used.

public SmartsheetBuilder SetMaxRetryTimeout(long maxRetryTimeout)

Parameters

maxRetryTimeout long

Returns

SmartsheetBuilder