Table of Contents

Class FabricDataSharesClient

Namespace
Nfield.SDK
Assembly
Nfield.Public.SDK.dll
public class FabricDataSharesClient
Inheritance
FabricDataSharesClient
Inherited Members

Constructors

FabricDataSharesClient(string, HttpClient)

public FabricDataSharesClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl string
httpClient HttpClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

string

JsonSerializerSettings

protected JsonSerializerSettings JsonSerializerSettings { get; }

Property Value

JsonSerializerSettings

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

bool

Methods

DeleteAsync(long, CancellationToken)

Deletes the Fabric Data Share with the given id.

public virtual Task DeleteAsync(long fabricDataShareId, CancellationToken cancellationToken = default)

Parameters

fabricDataShareId long

The Fabric Data Share id.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

The delete External Data Share request was accepted.

Exceptions

NfieldSdkException

A server side error occurred.

DeleteSurveyForFabricDataShareAsync(long, string, CancellationToken)

Deletes the requested survey that belongs to the given Fabric Data Share.

public virtual Task DeleteSurveyForFabricDataShareAsync(long fabricDataShareId, string nfieldSurveyId, CancellationToken cancellationToken = default)

Parameters

fabricDataShareId long

The Fabric Data Share id.

nfieldSurveyId string

The Survey to be removed.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

The delete External Data Share request was accepted.

Exceptions

NfieldSdkException

A server side error occurred.

GetAllAsync(CancellationToken)

Gets a list of the existing Fabric Data Shares.

public virtual Task<ICollection<FabricDataShareListResponseModel>> GetAllAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<ICollection<FabricDataShareListResponseModel>>

Returns the list of the existing Fabric Data Shares

Exceptions

NfieldSdkException

A server side error occurred.

GetAsync(long, CancellationToken)

Gets the Fabric Data Share for the given id.

public virtual Task<FabricDataShareResponseModel> GetAsync(long fabricDataShareId, CancellationToken cancellationToken = default)

Parameters

fabricDataShareId long

The Fabric Data Share id.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<FabricDataShareResponseModel>

Returns the Fabric Data Share

Exceptions

NfieldSdkException

A server side error occurred.

GetSurveysForFabricDataShareAsync(long, CancellationToken)

Gets the surveys included in the Fabric Data Share.

public virtual Task<ICollection<FabricDataShareSurveyListResponseModel>> GetSurveysForFabricDataShareAsync(long fabricDataShareId, CancellationToken cancellationToken = default)

Parameters

fabricDataShareId long

The Fabric Data Share id.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<ICollection<FabricDataShareSurveyListResponseModel>>

Returns the surveys included in the Fabric Data Share

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(FabricDataShareCreateRequestModel, CancellationToken)

Creates a new Fabric Data Share based on the given data.

public virtual Task PostAsync(FabricDataShareCreateRequestModel model, CancellationToken cancellationToken = default)

Parameters

model FabricDataShareCreateRequestModel

The info which will be used in the creation process.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

Returns the Fabric Data Share Id and the invitation url

Exceptions

NfieldSdkException

A server side error occurred.

PostFabricDataSharesSurveysAsync(long, string, CancellationToken)

Adds the selected survey to the given Fabric Data Share.

public virtual Task PostFabricDataSharesSurveysAsync(long fabricDataShareId, string nfieldSurveyId = null, CancellationToken cancellationToken = default)

Parameters

fabricDataShareId long

The Fabric Data Share Id.

nfieldSurveyId string

The id of the survey to be added.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task

The selected survey has been added to the Fabric Data Share

Exceptions

NfieldSdkException

A server side error occurred.

ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)

protected virtual Task<FabricDataSharesClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)

Parameters

response HttpResponseMessage
headers IReadOnlyDictionary<string, IEnumerable<string>>
cancellationToken CancellationToken

Returns

Task<FabricDataSharesClient.ObjectResponseResult<T>>

Type Parameters

T