Show / Hide Table of Contents

Class EthosProxyClient

An EthosClient used to retrieve data from the Ethos Integration Proxy API.

Supports( but not limited to ) the following functionality:

  • Getting data for a given Ethos resource
  • Getting an Ethos resource by ID (GUID)
  • Getting the page size and/or total count for a resource

Supports paging for data in the following formats:

  • List<EthosResponse> a list of EthosResponse objects
  • List<> a list of strings
  • List<> a list of Newtonsoft JArray objects
Each item in the list represents one page of data.Each page of data can contain many rows according to the page size.

NOTE: None of the methods in this class should be used to bulk load Ethos data. Such is NOT the intent of this SDK. It is possible that long running process times could result and/or s could occur if trying to get a large quantity of data. Instead, the Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Inheritance
System.Object
EthosClient
EthosProxyClient
EthosFilterQueryClient
Inherited Members
EthosClient.ApiKey
EthosClient.expirationMinutes
EthosClient.ExpirationMinutes
EthosClient.AutoRefresh
EthosClient.Token
EthosClient.Region
EthosClient.HttpProtocolClientBuilder
EthosClient.EthosResponseBuilder
EthosClient.ResponseHandlerAsync(HttpResponseMessage)
EthosClient.AttachHeaders(HttpClient, Dictionary<String, String>)
EthosClient.GetAccessTokenAsync()
EthosClient.GetNewTokenAsync()
EthosClient.GetHttpClient()
EthosClient.GetStringAsync(Dictionary<String, String>, String)
EthosClient.GetAsync(Dictionary<String, String>, String)
EthosClient.HeadAsync(String)
EthosClient.PostAsync(Dictionary<String, String>, String, String)
EthosClient.PutAsync(Dictionary<String, String>, String, String)
EthosClient.DeleteAsync(Dictionary<String, String>, String)
EthosClient.AddAccessTokenAuthHeaderAsync(Dictionary<String, String>)
Namespace: Ellucian.Ethos.Integration.Client.Proxy
Assembly: Ellucian.Ethos.Integration.dll
Syntax
public class EthosProxyClient : EthosClient

Constructors

EthosProxyClient(String, HttpClient)

Constructs an EthosProxyClient using the given API key. Note that the preferred way to get an instance of this class is through the EthosClientBuilder.

Declaration
public EthosProxyClient(string apiKey, HttpClient client)
Parameters
Type Name Description
System.String apiKey

A valid API key from Ethos Integration. This is required to be a valid 36 character GUID string. If it is null, empty, will be thrown or not in a valid GUID format, then a will be thrown.

HttpClient client

A HttpClient. If it is null/empty, then an will be thrown.

Fields

DATE_FORMAT

Date format.

Declaration
public const string DATE_FORMAT = null
Field Value
Type Description
System.String

DEFAULT_MAX_PAGE_SIZE

Default value for max-page-size header.

Declaration
protected readonly int DEFAULT_MAX_PAGE_SIZE
Field Value
Type Description
System.Int32

DEFAULT_PAGE_SIZE

Default value for page size (limit).

Declaration
protected readonly int DEFAULT_PAGE_SIZE
Field Value
Type Description
System.Int32

DEFAULT_VERSION

Default value for the accept and content-type header.

Declaration
protected readonly string DEFAULT_VERSION
Field Value
Type Description
System.String

ethosResponseConverter

Converts EthosResponse to string or .

Declaration
readonly EthosResponseConverter ethosResponseConverter
Field Value
Type Description
EthosResponseConverter

HDR_APPLICATION_CONTEXT

Response header for the application designation in Ethos Integration.

Declaration
public const string HDR_APPLICATION_CONTEXT = null
Field Value
Type Description
System.String

HDR_CONTENT_TYPE

Response header for the content-type.

Declaration
public const string HDR_CONTENT_TYPE = null
Field Value
Type Description
System.String

HDR_DATE

Response header for the current date of the response.

Declaration
public const string HDR_DATE = null
Field Value
Type Description
System.String

HDR_HEDTECH_ETHOS_INTEGRATION_APPLICATION_ID

Response header for the application ID of the application used in Ethos Integration.

Declaration
public const string HDR_HEDTECH_ETHOS_INTEGRATION_APPLICATION_ID = null
Field Value
Type Description
System.String

HDR_HEDTECH_ETHOS_INTEGRATION_APPLICATION_NAME

Response header for the application name of the application used in Ethos Integration.

Declaration
public const string HDR_HEDTECH_ETHOS_INTEGRATION_APPLICATION_NAME = null
Field Value
Type Description
System.String

HDR_X_CONTENT_RESTRICTED

Response header for content restricted.

Declaration
public const string HDR_X_CONTENT_RESTRICTED = null
Field Value
Type Description
System.String

HDR_X_MAX_PAGE_SIZE

Response header for the max page size. Specifies the maximum number of resources returned in a response.

Declaration
public const string HDR_X_MAX_PAGE_SIZE = null
Field Value
Type Description
System.String

HDR_X_MEDIA_TYPE

Response header for the version of the Ethos resource (data-model).

Declaration
public const string HDR_X_MEDIA_TYPE = null
Field Value
Type Description
System.String

HDR_X_TOTAL_COUNT

Response header for the total count (total number of rows) for the given resource.

Declaration
public const string HDR_X_TOTAL_COUNT = null
Field Value
Type Description
System.String

Methods

BuildHeadersMap(String)

Builds a map of headers with the given version. If the version is null or empty, uses the default version.

Declaration
Dictionary<string, string> BuildHeadersMap(string version)
Parameters
Type Name Description
System.String version

The version to use for the Accept and Content-Type headers, as supplied in the returned map.

Returns
Type Description
Dictionary<System.String, System.String>

a of header values including Accept and Content-Type (both set to the given version.

ConvertEthosResponseContentListToType<T>(IEnumerable<EthosResponse>)

Converts EthosResponse content in the list to a strongly typed object of type T.

Declaration
IEnumerable<EthosResponse> ConvertEthosResponseContentListToType<T>(IEnumerable<EthosResponse> ethosResponseList)
    where T : class
Parameters
Type Name Description
IEnumerable<EthosResponse> ethosResponseList
Returns
Type Description
IEnumerable<EthosResponse>

Collection of Ethos responses with content converted to type specified by 'T' and stored in Dto property and setting Content property to empty string.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

ConvertEthosResponseContentToType<T>(EthosResponse)

Converts EthosResponse content to a strongly typed object of type T.

Declaration
EthosResponse ConvertEthosResponseContentToType<T>(EthosResponse response)
    where T : class
Parameters
Type Name Description
EthosResponse response
Returns
Type Description
EthosResponse

Ethos response with content converted to type specified by 'T' and stored in Dto property and setting Content property to empty string.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

DeleteAsync(String, String)

Deletes an instance of the given resource by the given id.

Declaration
public async Task DeleteAsync(string resourceName, string id)
Parameters
Type Name Description
System.String resourceName

The name of the resource to delete an instance of identified by the given id.

System.String id

The unique ID (GUID) of the resource to delete.

Returns
Type Description
Task

DoPagingForAllAsync(String, String, Int32, Int32)

Intended to be used internally within the SDK.

Used within the SDK to page for all pages for a given resource by using an offset of 0.
Declaration
async Task<List<EthosResponse>> DoPagingForAllAsync(string resourceName, string version, int totalCount, int pageSize)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 totalCount

The total count of rows for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list represents a page.

DoPagingForNumPagesAsync(String, String, Int32, Int32, Int32)

Intended to be used internally within the SDK.

Used within the SDK to page for some number of pages for a given resource by using an offset of 0.
Declaration
async Task<List<EthosResponse>> DoPagingForNumPagesAsync(string resourceName, string version, int totalCount, int pageSize, int numPages)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 totalCount

The total count of rows for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numPages

The number of pages to page for.

Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list represents a page, up to some number of pages.

DoPagingForNumRowsAsync(String, String, Int32, Int32, Int32)

Intended to be used internally within the SDK.

Used within the SDK to page for some number of rows for a given resource, using an offset of 0.
Declaration
async Task<List<EthosResponse>> DoPagingForNumRowsAsync(string resourceName, string version, int totalCount, int pageSize, int numRows)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 totalCount

The total count of rows for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numRows
Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list represents a page, up to the number of rows specified or the total count of the resource( whichever is less).

DoPagingFromOffsetAsync(String, String, String, Int32, Int32, Int32)

Intended to be used internally within the SDK.

Declaration
protected async Task<List<EthosResponse>> DoPagingFromOffsetAsync(string resourceName, string version, string filter, int totalCount, int pageSize, int offset)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.String filter

The string resource filter in JSON format contained in the URL, e.g:

?criteria={"names":[{"firstName":"John"}]}

System.Int32 totalCount

The total count of rows for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to begin paging for the given resource.

Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list represents a page, beginning from the given offset index.

DoPagingFromOffsetForNumPagesAsync(String, String, Int32, Int32, Int32, Int32)

Intended to be used internally within the SDK.

Used within the SDK to page for some number of pages for a given resource from the given offset.
Declaration
async Task<List<EthosResponse>> DoPagingFromOffsetForNumPagesAsync(string resourceName, string version, int totalCount, int pageSize, int numPages, int offset)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 totalCount

The total count of rows for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numPages

The number of pages to page for.

System.Int32 offset

The 0 based index from which to begin paging for the given resource.

Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list represents a page, from the given offset( inclusive) and up to some number of pages( exclusive).

DoPagingFromOffsetForNumRowsAsync(String, String, Int32, Int32, Int32, Int32)

Intended to be used internally within the SDK.

Used within the SDK to page for some number of rows for a given resource, using an offset of 0.
Declaration
async Task<List<EthosResponse>> DoPagingFromOffsetForNumRowsAsync(string resourceName, string version, int totalCount, int pageSize, int offset, int numRows)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 totalCount

The total count of rows for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to begin paging for the given resource.

System.Int32 numRows

The overall number of rows to page for.

Returns
Type Description
Task<List<EthosResponse>>

Returns collection of EthosResponses.

GetAllPagesAsJArraysAsync(String, String, Int32)

Gets all pages for the given resource, version, and page size.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<JArray>> GetAllPagesAsJArraysAsync(string resourceName, string version = "", int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<JArray>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesAsStringsAsync(String, String, Int32)

Gets all pages for the given resource, version, and page size.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<string>> GetAllPagesAsStringsAsync(string resourceName, string version = "", int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<System.String>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesAsync(String)

Gets all pages for the given resource and version. Uses the default page size of the response body content length.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<EthosResponse>> GetAllPagesAsync(string resourceName)
Parameters
Type Name Description
System.String resourceName

Name of the resource

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesAsync(String, String)

Gets all pages for the given resource and version. Uses the default page size of the response body content length.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<EthosResponse>> GetAllPagesAsync(string resourceName, string version = "")
Parameters
Type Name Description
System.String resourceName

Name of the resource

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesAsync(String, String, Int32)

Gets all pages for the given resource, version, and page size.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<EthosResponse>> GetAllPagesAsync(string resourceName, string version = "", int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesAsync<T>(String, String, Int32)

Gets all pages for the given resource, version, and page size.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<EthosResponse>> GetAllPagesAsync<T>(string resourceName, string version = "", int pageSize = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

Returns collection of EthosResponses with each including strongly typed obect collection.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetAllPagesFromOffsetAsJArraysAsync(String, String, Int32, Int32)

Gets all pages for the given resource, version, and page size, from the given offset.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<JArray>> GetAllPagesFromOffsetAsJArraysAsync(string resourceName, string version = "", int offset = 0, int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<JArray>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesFromOffsetAsStringsAsync(String, String, Int32, Int32)

Gets all pages for the given resource, version, and page size from the given offset.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<string>> GetAllPagesFromOffsetAsStringsAsync(string resourceName, string version = "", int offset = 0, int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<System.String>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesFromOffsetAsync(String, String, Int32, Int32)

Gets all pages for the given resource, version, and page size, from the offset. If the offset is negative, all pages will be returned.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<EthosResponse>> GetAllPagesFromOffsetAsync(string resourceName, string version = "", int offset = 0, int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetAllPagesFromOffsetAsync<T>(String, String, Int32, Int32)

Gets all pages for the given resource, version, and page size, from the offset. If the offset is negative, all pages will be returned.

NOTE: This method could result in a long running process and return a large volume of data. It is possible that an could occur if trying to get a large quantity of data. This is NOT intended to be used for any kind of resource bulk loading of data. The Ethos bulk loading solution should be used for loading data in Ethos data model format in bulk.

Declaration
public async Task<IEnumerable<EthosResponse>> GetAllPagesFromOffsetAsync<T>(string resourceName, string version = "", int offset = 0, int pageSize = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetAsJArrayAsync(String, String)

Gets a page of data for the given resource by name and version.

Declaration
public async Task<JArray> GetAsJArrayAsync(string resourceName, string version = "")
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<JArray>

A containing an initial page (EthosResponse content) of resource data according

GetAsJArrayAsync(String, String, Int32, Int32)

Gets a page of data for the given resource by name, version, offset, and pageSize. A page of data is returned from the given offset index containing the number of rows( pageSize) specified.If the given offset is negative, it will not be used.If the given pageSize is 0 or negative, it will not be used.

Declaration
public async Task<JArray> GetAsJArrayAsync(string resourceName, string version = "", int offset = 0, int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<JArray>

A page of data for the given resource from the given offset with the given page size.

GetAsJObjectByIdAsync(String, String, String)

Gets a resource by ID (GUID) for the given resource name and version.

Declaration
public async Task<JObject> GetAsJObjectByIdAsync(string resourceName, string id, string version = "")
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String id

The unique ID (GUID) of the resource to get.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<JObject>

The data for a given resource as a according to the requested version of the resource. Only returns the content body of the EthosResponse. Does not return header information or the Http status code.

GetAsStringAsync(String, String)

Gets a page of data for the given resource by name and version.

Declaration
public async Task<string> GetAsStringAsync(string resourceName, string version = "")
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<System.String>

A page of data for the given resource from the given offset with the given page size.

GetAsStringAsync(String, String, Int32, Int32)

Gets a page of data for the given resource by name, version, offset, and pageSize. A page of data is returned from the given offset index containing the number of rows( pageSize) specified. If the given offset is negative, it will not be used. If the given pageSize is 0 or negative, it will not be used.

Declaration
public async Task<string> GetAsStringAsync(string resourceName, string version = "", int offset = 0, int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<System.String>

A page of data for the given resource from the given offset with the given page size.

GetAsStringByIdAsync(String, String, String)

Gets a resource by ID (GUID) for the given resource name and version.

Declaration
public async Task<string> GetAsStringByIdAsync(string resourceName, string id, string version = "")
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String id

The unique ID (GUID) of the resource to get.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<System.String>

The data for a given resource as a according to the requested version of the resource. Only returns the content body of the EthosResponse. Does not return header information or the Http status code.

GetAsync(String)

Gets a page of data for the given resource by name.

Declaration
public async Task<EthosResponse> GetAsync(string resourceName)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing an initial page (EthosResponse content) of resource data according to the requested version of the resource.

GetAsync(String, String)

Gets a page of data for the given resource by name and version.

Declaration
public async Task<EthosResponse> GetAsync(string resourceName, string version = "")
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing an initial page (EthosResponse content) of resource data according to the requested version of the resource.

GetAsync(String, String, Int32, Int32)

Gets a page of data for the given resource by name, version, offset, and pageSize. A page of data is returned from the given offset index containing the number of rows( pageSize) specified.If the given offset is negative, it will not be used.If the given pageSize is 0 or negative, it will not be used.

Declaration
public async Task<EthosResponse> GetAsync(string resourceName, string version = "", int offset = 0, int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<EthosResponse>

A page of data for the given resource from the given offset with the given page size.

GetAsync<T>(String, String, Int32, Int32)

Return a strongly typed object of type T in EthosResponse.

Declaration
public async Task<EthosResponse> GetAsync<T>(string resourceName, string version = "", int offset = 0, int pageSize = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<EthosResponse>

A strongly typed object.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetByIdAsync(String, String, String)

Gets a resource by ID (GUID) for the given resource name and version.

Declaration
public async Task<EthosResponse> GetByIdAsync(string resourceName, string id, string version = "")
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String id

The unique ID (GUID) of the resource to get.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<EthosResponse>

The data for a given resource in an EthosResponse according to the requested version of the resource. The EthosResponse contains the content body of the resource data as well as headers and the Http status code.

GetByIdAsync<T>(String, String, String)

Gets a resource by ID (GUID) for the given resource name and version.

Declaration
public async Task<EthosResponse> GetByIdAsync<T>(string resourceName, string id, string version = "")
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String id

The unique ID (GUID) of the resource to get.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

Returns
Type Description
Task<EthosResponse>

The data for a given resource in an EthosResponse according to the requested version of the resource. The EthosResponse contains the content body of the resource data as well as headers and the Http status code.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetDataFromInitialContent(Pager)

Intended to be used internally within the SDK.

Gets resource data from the initial content obtained when preparing for paging.This method does not page for data. Supports trimming the data content according to the given PagingType( howToPage attribute ).
Declaration
List<EthosResponse> GetDataFromInitialContent(Pager pager)
Parameters
Type Name Description
Pager pager

A pager previously prepared for paging.

Returns
Type Description
List<EthosResponse>

A list of EthosResponses containing a single page of data, which may be trimmed according to the howToPage PagingType specified in the pager.

GetDataFromPagingAsync(Pager)

Intended to be used internally within the SDK.

Determines how to page given the "howToPage" attribute of the pager. The howToPage attribute must be one of the defined PagingTypes.
Declaration
async Task<List<EthosResponse>> GetDataFromPagingAsync(Pager pager)
Parameters
Type Name Description
Pager pager

A previously prepared pager with the howToPage attribute set appropriately.

Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list contains a page of data.

GetFromOffsetAsJArrayAsync(String, String, Int32)

Gets a page of data for the given resource by name and version, from the given offset index. The default page size is used.

Declaration
public async Task<JArray> GetFromOffsetAsJArrayAsync(string resourceName, string version = "", int offset = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

Returns
Type Description
Task<JArray>

A page of data for the given resource from the given offset with the given page size.

GetFromOffsetAsStringAsync(String, String, Int32)

Gets a page of data for the given resource by name and version, from the given offset index. The default page size is used.

Declaration
public async Task<string> GetFromOffsetAsStringAsync(string resourceName, string version = "", int offset = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

Returns
Type Description
Task<System.String>

A page of data for the given resource from the given offset with the given page size.

GetFromOffsetAsync(String, String, Int32)

Gets a page of data for the given resource by name and from the given offset index. The default version and page size are used.

Declaration
public async Task<EthosResponse> GetFromOffsetAsync(string resourceName, string version = "", int offset = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

Returns
Type Description
Task<EthosResponse>

A page of data for the given resource from the given offset with the given page size.

GetHeaderValue(EthosResponse, String)

Intended to be used internally within the SDK.

Returns the header value from the given ethosResponse.
Declaration
protected static string GetHeaderValue(EthosResponse ethosResponse, string primaryHeaderName)
Parameters
Type Name Description
EthosResponse ethosResponse

The EthosResponse to get a header value from.

System.String primaryHeaderName

A header name following Ethos standards (such as "x-media-type").

Returns
Type Description
System.String

The value of the given header. Returns null if the given ethosResponse is null or the header is not found.

GetMaxPageSizeAsync(String, String, EthosResponse)

Intended to be used internally within the SDK.

Gets the max page size for the given resourceName, version, and ethosResponse.If the ethosResponse is null, it will make a call to get the data for the given resource to then calculate the page size from the response body content.
Declaration
public async Task<int> GetMaxPageSizeAsync(string resourceName, string version = "", EthosResponse ethosResponse = null)
Parameters
Type Name Description
System.String resourceName

The name of the Ethos resource to get the page size for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

EthosResponse ethosResponse

An EthosResponse from which to calculate the page size using it's content body length, or null.

Returns
Type Description
Task<System.Int32>

The max page size for the resource as found using the x-max-page-size header.

GetPagesAsJArraysAsync(String, String, Int32, Int32)

Gets some number of pages for the given resource, version, and page size.

Declaration
public async Task<IEnumerable<JArray>> GetPagesAsJArraysAsync(string resourceName, string version = "", int pageSize = 0, int numPages = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<JArray>>

A page of data for the given resource from the given offset with the given page size.

GetPagesAsStringsAsync(String, String, Int32, Int32)

Gets some number of pages for the given resource, version, and page size.

Declaration
public async Task<IEnumerable<string>> GetPagesAsStringsAsync(string resourceName, string version = "", int pageSize = 0, int numPages = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<System.String>>

A page of data for the given resource from the given offset with the given page size.

GetPagesAsync(String, String, Int32, Int32)

Gets some number of pages for the given resource, version, and page size. If numPages is negative, all pages will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetPagesAsync(string resourceName, string version = "", int pageSize = 0, int numPages = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetPagesAsync<T>(String, String, Int32, Int32)

Gets some number of pages for the given resource, version, and page size. If numPages is negative, all pages will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetPagesAsync<T>(string resourceName, string version = "", int pageSize = 0, int numPages = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetPagesFromOffsetAsJArraysAsync(String, String, Int32, Int32, Int32)

Gets some number of pages for the given resource, version, and page size, from the given offset.

Declaration
public async Task<IEnumerable<JArray>> GetPagesFromOffsetAsJArraysAsync(string resourceName, string version = "", int pageSize = 0, int offset = 0, int numPages = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<JArray>>

A page of data for the given resource from the given offset with the given page size.

GetPagesFromOffsetAsStringsAsync(String, String, Int32, Int32, Int32)

Gets some number of pages for the given resource, version, and page size, from the given offset.

Declaration
public async Task<IEnumerable<string>> GetPagesFromOffsetAsStringsAsync(string resourceName, string version = "", int pageSize = 0, int offset = 0, int numPages = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<System.String>>

A page of data for the given resource from the given offset with the given page size.

GetPagesFromOffsetAsync(String, String, Int32, Int32, Int32)

Gets some number of pages for the given resource, version, and page size, from the given offset. If both the offset and numPages are negative, all pages will be returned.If the offset is negative, pages up to the numPages will be returned. If numPages is negative, all pages from the offset will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetPagesFromOffsetAsync(string resourceName, string version = "", int pageSize = 0, int offset = 0, int numPages = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetPagesFromOffsetAsync<T>(String, String, Int32, Int32, Int32)

Gets some number of pages for the given resource, version, and page size, from the given offset. If both the offset and numPages are negative, all pages will be returned.If the offset is negative, pages up to the numPages will be returned. If numPages is negative, all pages from the offset will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetPagesFromOffsetAsync<T>(string resourceName, string version = "", int pageSize = 0, int offset = 0, int numPages = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numPages

The number of pages of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetPageSizeAsync(String, String, EthosResponse)

Intended to be used internally within the SDK.

Gets the page size for the given resourceName, version, and ethosResponse.If the ethosResponse is null, it will make a call to get the data for the given resource to then calculate the page size from the response body content.
Declaration
public async Task<int> GetPageSizeAsync(string resourceName, string version = "", EthosResponse ethosResponse = null)
Parameters
Type Name Description
System.String resourceName

The name of the Ethos resource to get the page size for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

EthosResponse ethosResponse

An EthosResponse from which to calculate the page size using it's content body length, or null.

Returns
Type Description
Task<System.Int32>

The page size of the given resource.

GetRowsAsJArrayAsync(String, String, Int32)

Gets some number of rows for the given resource and version. The rows are returned as a with each child representing a resource. The length of the returned JArray will be the length of the number of rows requested, if there were that many available in the source system.

Declaration
public async Task<JArray> GetRowsAsJArrayAsync(string resourceName, string version = "", int numRows = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<JArray>

A JSON array of data for the given resource.

GetRowsAsStringsAsync(String, String, Int32)

Gets some number of rows for the given resource and version. The rows are returned as a list of strings with each string representing a resource. The length of the returned list will be the length of the number of rows requested, if there were that many available in the source system.

Declaration
public async Task<IEnumerable<string>> GetRowsAsStringsAsync(string resourceName, string version = "", int numRows = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<IEnumerable<System.String>>

A string list of data for the given resource from the given offset.

GetRowsAsync(String, String, Int32, Int32)

Gets some number of rows for the given resource, version, and page size. The number of rows is returned in a list of pages altogether containing the number of rows.If numRows is negative, all pages will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetRowsAsync(string resourceName, string version = "", int pageSize = 0, int numRows = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetRowsAsync<T>(String, String, Int32, Int32)

Gets some number of rows for the given resource, version, and page size. The number of rows is returned in a list of pages altogether containing the number of rows.If numRows is negative, all pages will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetRowsAsync<T>(string resourceName, string version = "", int pageSize = 0, int numRows = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetRowsFromOffsetAsJArrayAsync(String, String, Int32, Int32)

Gets some number of rows for the given resource and version, from the given offset. The rows are returned as a with each child representing a resource. The length of the returned JArray will be the length of the number of rows requested, if there were that many available in the source system.

Declaration
public async Task<JArray> GetRowsFromOffsetAsJArrayAsync(string resourceName, string version = "", int offset = 0, int numRows = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<JArray>

A JSON array of data for the given resource from the given offset.

GetRowsFromOffsetAsStringsAsync(String, String, Int32, Int32)

Gets some number of rows for the given resource and version, from the given offset. The rows are returned as a list of strings with each string representing a resource. The length of the returned list will be the length of the number of rows requested, if there were that many available in the source system.

Declaration
public async Task<IEnumerable<string>> GetRowsFromOffsetAsStringsAsync(string resourceName, string version = "", int offset = 0, int numRows = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<IEnumerable<System.String>>

A string list of data for the given resource from the given offset.

GetRowsFromOffsetAsync(String, String, Int32, Int32, Int32)

Gets some number of rows for the given resource, version, and page size, from the given offset. The number of rows is returned in a list of pages altogether containing the number of rows. If both the offset and numRows are negative, all pages will be returned. If the offset is negative, pages up to the numRows will be returned. If numRows is negative, all pages from the offset will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetRowsFromOffsetAsync(string resourceName, string version = "", int pageSize = 0, int offset = 0, int numRows = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

GetRowsFromOffsetAsync<T>(String, String, Int32, Int32, Int32)

Gets some number of rows for the given resource, version, and page size, from the given offset. The number of rows is returned in a list of pages altogether containing the number of rows. If both the offset and numRows are negative, all pages will be returned. If the offset is negative, pages up to the numRows will be returned. If numRows is negative, all pages from the offset will be returned.

Declaration
public async Task<IEnumerable<EthosResponse>> GetRowsFromOffsetAsync<T>(string resourceName, string version = "", int pageSize = 0, int offset = 0, int numRows = 0)
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in each page (EthosResponse) of the list returned.

System.Int32 offset

The 0 based index from which to get a page of data for the given resource.

System.Int32 numRows

The number of rows of the given resource to return.

Returns
Type Description
Task<IEnumerable<EthosResponse>>

A page of data for the given resource from the given offset with the given page size.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

GetTotalCountAsync(String, String, EthosResponse)

Intended to be used internally within the SDK.

Gets the total count of rows for the given Ethos resource, version, and ethosResponse.If the ethosResponse is null, a call will be made to get the resource data to then get the total count from the x-total-count header.
Declaration
public async Task<int> GetTotalCountAsync(string resourceName, string version = "", EthosResponse ethosResponse = null)
Parameters
Type Name Description
System.String resourceName

The name of the Ethos resource to get the total count for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

EthosResponse ethosResponse

An EthosResponse from which to get the total count, or null.

Returns
Type Description
Task<System.Int32>

The total count for the given resource, or 0 if the resourceName is null or empty.

GetWithPageSizeAsJArrayAsync(String, String, Int32)

Gets a page of data for the given resource by name and version, using the given page size. Offset index 0 is used.

Declaration
public async Task<JArray> GetWithPageSizeAsJArrayAsync(string resourceName, string version = "", int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<JArray>

A page of data for the given resource from the given offset with the given page size.

GetWithPageSizeAsStringAsync(String, String, Int32)

Gets a page of data for the given resource by name and version, using the given page size. Offset index 0 is used.

Declaration
public async Task<string> GetWithPageSizeAsStringAsync(string resourceName, string version = "", int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<System.String>

A page of data for the given resource from the given offset with the given page size.

GetWithPageSizeAsync(String, String, Int32)

Gets a page of data for the given resource by name and version, using the given page size. Offset index 0 is used.

Declaration
public async Task<EthosResponse> GetWithPageSizeAsync(string resourceName, string version = "", int pageSize = 0)
Parameters
Type Name Description
System.String resourceName

The name of the resource to get data for.

System.String version

The desired resource version to use, as provided in the HTTP Accept Header of the request.

System.Int32 pageSize

The number of rows to include in the returned page (EthosResponse).

Returns
Type Description
Task<EthosResponse>

A page of data for the given resource from the given offset with the given page size.

HandlePagingAsync(Pager)

Intended to be used internally within the SDK.

For some resource defined within the given pager, determines whether to page for data, or to use the data obtained during paging preparation.
Declaration
async Task<List<EthosResponse>> HandlePagingAsync(Pager pager)
Parameters
Type Name Description
Pager pager

A pager previously prepared for paging (see PrepareForPagingAsync(Pager) and ShouldDoPaging(Pager, Boolean).

Returns
Type Description
Task<List<EthosResponse>>

A list of EthosResponses where each EthosResponse in the list contains a page of data.

NeedToPage(Int32, Int32)

Intended to be used internally within the SDK.

A simple comparison which is used by the other NeedToPage(Int32, Int32) method, comparing the given page size to the total count. If the page size is less than the total count, then paging is needed. If not, paging is not needed.
Declaration
bool NeedToPage(int pageSize, int totalCount)
Parameters
Type Name Description
System.Int32 pageSize

The page size for some resource.

System.Int32 totalCount

The total count of rows for some resource.

Returns
Type Description
System.Boolean

True if paging is needed, false otherwise.

PostAsync(String, JObject)

Submits a POST request for the given resourceName with the given requestBodyNode. Uses the default version. This is a convenience method equivalent to

Post(resourceName, requestBodyNode.toString())
.

Declaration
public async Task<EthosResponse> PostAsync(string resourceName, JObject requestBodyNode)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

JObject requestBodyNode

The body of the request to POST for the given resource as a JsonNode.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this POST operation.

PostAsync(String, String)

Submits a POST request for the given resourceName with the given requestBody. Uses the default version. The requestBody should be a string in JSON format.

Declaration
public async Task<EthosResponse> PostAsync(string resourceName, string requestBody)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String requestBody

The body of the request to POST for the given resource.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this POST operation.

PostAsync(String, String, JObject)

Submits a POST request for the given resourceName with the given requestBodyNode. Uses the default version. This is a convenience method equivalent to

Post(resourceName, requestBodyNode.toString())
.

Declaration
public async Task<EthosResponse> PostAsync(string resourceName, string version, JObject requestBodyNode)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String version

The full version header value of the resource used for this POST request.

JObject requestBodyNode

The body of the request to POST for the given resource as a JsonNode.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this POST operation.

PostAsync(String, String, String)

Submits a POST request for the given resourceName with the given requestBody. The requestBody should be a string in JSON format.

Declaration
public async Task<EthosResponse> PostAsync(string resourceName, string version, string requestBody)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String version

The full version header value of the resource used for this POST request.

System.String requestBody

The body of the request to POST for the given resource.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this POST operation.

PostAsync<T>(String, T, String)

Submits a POST request for the given resourceName with the given requestBody of strongly typed object. The requestBody should be a strstrongly typed object.

Declaration
public async Task<EthosResponse> PostAsync<T>(string resourceName, T requestBody, string version = "")
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

T requestBody

The body of the request to POST for the given resource.

System.String version

The full version header value of the resource used for this PUT/update request.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this POST operation including type specified by the caller.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

PrepareForPagingAsync(Pager)

Intended to be used internally within the SDK.

Uses the given pager object to prepare for paging operations.The pager object is used to contain various fields required for paging.If the given pager is null, returns the same pager. Sets default values for the version and offset within the pager as needed and makes an initial call for the pager resource to get metadata about the resource used for paging. Also sets the page size and the total count within the pager.
Declaration
protected async Task<Pager> PrepareForPagingAsync(Pager pager)
Parameters
Type Name Description
Pager pager

The Pager object used holding the required fields for paging.

Returns
Type Description
Task<Pager>

The same pager object with the version and offset validated, and the page size and total count set.

PutAsync(String, String, JObject)

Submits a PUT request for the given resourceName to update a resource with the given requestBodyNode. Uses the default version. This is a convenience method equivalent to

put(resourceName, requestBodyNode.toString())
.

Declaration
public async Task<EthosResponse> PutAsync(string resourceName, string resourceId, JObject requestBodyNode)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String resourceId

The unique id (GUID) for the given resource, as required when making a PUT/update request.

JObject requestBodyNode

The body of the request to PUT/update for the given resource as a JsonNode.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this PUT operation.

PutAsync(String, String, String)

Submits a PUT request for the given resourceName to update a resource with the given requestBody. Uses the default version. The requestBody should be a string in JSON format.

Declaration
public async Task<EthosResponse> PutAsync(string resourceName, string resourceId, string requestBody)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String resourceId

The unique id (GUID) for the given resource, as required when making a PUT/update request.

System.String requestBody

The body of the request to PUT/update for the given resource.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this PUT operation.

PutAsync(String, String, String, JObject)

Submits a PUT request for the given resourceName to update a resource with the given requestBodyNode. Uses the default version. This is a convenience method equivalent to

put(resourceName, requestBodyNode.toString())
.

Declaration
public async Task<EthosResponse> PutAsync(string resourceName, string resourceId, string version, JObject requestBodyNode)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String resourceId

The unique id (GUID) for the given resource, as required when making a PUT/update request.

System.String version

The full version header value of the resource used for this PUT/update request.

JObject requestBodyNode

The body of the request to PUT/update for the given resource as a JsonNode.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this PUT operation.

PutAsync(String, String, String, String)

Submits a PUT/update request for the given resourceName with the given requestBody. The requestBody should be a string in JSON format.

Declaration
public async Task<EthosResponse> PutAsync(string resourceName, string resourceId, string version, string requestBody)
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

System.String resourceId

The unique ID for the given resource, as required when making a PUT/update request.

System.String version

The full version header value of the resource used for this PUT/update request.

System.String requestBody

The body of the request to PUT/update for the given resource.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this PUT operation.

PutAsync<T>(String, T, String, String)

Submits a PUT/update request for the given resourceName with the given requestBody of strongly typed object. The requestBody should be a strstrongly typed object.

Declaration
public async Task<EthosResponse> PutAsync<T>(string resourceName, T requestBody, string resourceId = "", string version = "")
    where T : class
Parameters
Type Name Description
System.String resourceName

The name of the resource to add an instance of.

T requestBody

The body of the request to PUT/update for the given resource.

System.String resourceId

The unique ID for the given resource, as required when making a PUT/update request.

System.String version

The full version header value of the resource used for this PUT/update request.

Returns
Type Description
Task<EthosResponse>

An EthosResponse containing the instance of the resource that was added by this PUT operation including type specified by the caller.

Type Parameters
Name Description
T

Type to be included in the EthosResponse returned specified by caller.

ShouldDoPaging(Pager, Boolean)

Intended to be used internally within the SDK.

Determines whether paging should be done for the resource within the given pager. Supports normal paging (by total count ) or paging for number of rows. If normal paging, then the need to page is determined by comparing the total count with the page size. If paging for number of rows, the need to page is determined by comparing the number of rows with the page size.
Declaration
protected Pager ShouldDoPaging(Pager pager, bool forNumRows)
Parameters
Type Name Description
Pager pager

The Pager object containing the total count or numRows, and page size to determine the need to page.

System.Boolean forNumRows

If true, then paging is by numRows. If false, then paging is by total count.

Returns
Type Description
Pager

The given pager object with the shouldDoPaging flag set to true when paging is needed, or false when not.

In This Article
Back to top Generated by DocFX