KiiCloudStorageSDK : KiiCorp.Cloud.Storage Namespace

Kii Class

Provides APIs for KiiCloud application features.

Syntax

public class Kii

Remarks

Please call Kii.Initialize(string, string, Kii.Site) at the top of your application.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Members

See Also: Inherited members from object.

Public Properties

static
AccessTokenExpiration long . Gets or set the access token lifetime in seconds.
[read-only]
static
AppId string . Gets the application ID.
[read-only]
static
AppKey string . Gets the application key.
[read-only]
static
BaseUrl string . Gets the server URL.
[read-only]
static
KiiAppsBaseUrl string . URL for KiiApps server.
static
Logger IKiiLogger . Sets the logger.

Public Methods

static
Bucket (string) : KiiBucket
Gets new Kiibucket whose scope is app scope.
static
Group (string) : KiiGroup
Create a group own by current user.
static
Group (string, IList<KiiUser>) : KiiGroup
Create a group with the specified groupName and groupMembers.
static
Initialize (string, string, Kii.Site)
Initialize KiiSDK appId, appKey and Site.
static
Initialize (string, string, string)
Initialize KiiSDK appId, appKey and serverUrl.
static
Initialize (string, string, Kii.Site, KiiHttpClientFactory, KiiHttpClientFactory)
This method is intended for use in internal purposes. Do not use it to initialize your application.
static
Initialize (string, string, string, KiiHttpClientFactory, KiiHttpClientFactory)
Initialize KiiSDK appID, appKey, deviceID, serverUrl and KiiHttpClientFactory.
static
ListTopics () : KiiListResult<KiiTopic>
Gets the list of topics in app scope.
static
ListTopics (KiiGenericsCallback<KiiListResult<KiiTopic>>)
Asynchronous call for Kii.ListTopics.
static
ListTopics (string) : KiiListResult<KiiTopic>
Gets the list of next page of topics in app scope.
static
ListTopics (string, KiiGenericsCallback<KiiListResult<KiiTopic>>)
Asynchronous call for Kii.ListTopics(string).
static
ServerCodeEntry (string) : KiiServerCodeEntry
Instantiate KiiServerCodeEntry with specified entry name.
static
ServerCodeEntry (string, Nullable<KiiServerCodeEnvironmentVersion>) : KiiServerCodeEntry
Instantiate KiiServerCodeEntry with specified entry name and environment version.
static
ServerCodeEntry (string, string) : KiiServerCodeEntry
Instantiate KiiServerCodeEntry with specified entry name and version.
static
ServerCodeEntry (string, string, Nullable<KiiServerCodeEnvironmentVersion>) : KiiServerCodeEntry
Instantiate KiiServerCodeEntry with specified entry name and version and environment version.
static
Topic (string) : KiiTopic
Get instance of app scope topic. The topic bound to the application.

Member Details

AccessTokenExpiration Property

Gets or set the access token lifetime in seconds.

Syntax

public static long AccessTokenExpiration { get; set; }

Value

The life time of access token in seconds.

Exceptions

Type Reason
InvalidOperationException Thrown if SDK has not initialized yet.

Remarks

If you don't set this or set with 0, token won't be expired. Set this if you like the access token to be expired after a certain period. Once set, token retrieved by each future authentication will have the specified lifetime. Note that, it will not update the lifetime of token received prior calling this method. Once expired, you have to login again to renew the token.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

AppId Property

Gets the application ID.

Syntax

public static string AppId { get; }

Value

Application ID found in your Kii developer console

Remarks

If Kii.Initialize(string, string, Kii.Site) is not called, return null.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

AppKey Property

Gets the application key.

Syntax

public static string AppKey { get; }

Value

Application key found in your Kii developer console

Remarks

If Kii.Initialize(string,string,Kii.Site) is not called, return null.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

BaseUrl Property

Gets the server URL.

Syntax

public static string BaseUrl { get; }

Value

The server URL.

Remarks

If Kii.Initialize(string,string,string) is not called, return null.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Bucket Method

Gets new Kiibucket whose scope is app scope.

Syntax

public static KiiBucket Bucket (string bucketName)

Parameters

bucketName
Bucket name

Returns

KiiBucket instance.

Exceptions

Type Reason
ArgumentException Is thrown when bucket name is invalid.

Remarks

This API doesn't call server API.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Group Method

Create a group own by current user.

Syntax

public static KiiGroup Group (string groupName)

Parameters

groupName
Group name.

Returns

New KiiGroup instance.

Exceptions

Type Reason
ArgumentException Is thrown when group name is empty.

Remarks

This API is equivalent to Kii.Group(groupName, null)

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Group Method

Create a group with the specified groupName and groupMembers.

Syntax

public static KiiGroup Group (string groupName, IList<KiiUser> groupMembers)

Parameters

groupName
Group name.
groupMembers
Group members.

Returns

New KiiGroup instance.

Exceptions

Type Reason
ArgumentException Is thrown when group name is empty.

Remarks

To create new group on KiiCloud, please call KiiGroup.Save() API of returned KiiGroup.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Initialize Method

Initialize KiiSDK appId, appKey and Site.

Syntax

public static void Initialize (string appId, string appKey, Kii.Site site)

Parameters

appId
Application ID found in your Kii developer console.
appKey
Application key found in your Kii developer console
site
Please set any one of Site.US, Site.JP, Site.CN, Site.CN3 or Site.SG you've chosen when you created application on Kii developer console.

Exceptions

Type Reason
ArgumentException Is thrown when an argument is invalid.

Remarks

Initialize KiiCloudStorage SDK and this must be call prior to all APIs call.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Initialize Method

Initialize KiiSDK appId, appKey and serverUrl.

Syntax

public static void Initialize (string appId, string appKey, string serverUrl)

Parameters

appId
Application ID found in your Kii developer console
appKey
Application key found in your Kii developer console
serverUrl
Server URL.

Exceptions

Type Reason
ArgumentException Is thrown when an argument passed to a method is invalid.

Remarks

Initialize KiiCloudStorage SDK and this must be call prior to all APIs call.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Initialize Method

This method is intended for use in internal purposes. Do not use it to initialize your application.

Syntax

public static void Initialize (string appId, string appKey, Kii.Site site, KiiHttpClientFactory syncFactory, KiiHttpClientFactory asyncFactory)

Parameters

appId
Application ID found in your Kii developer console
appKey
Application key found in your Kii developer console
site
Please set any one of Site.US, Site.JP, Site.CN, Site.CN3 or Site.SG you've chosen when you created application on Kii developer console.
syncFactory
Http client factory for blocking api.
asyncFactory
Http client factory for non-blocking api.

Exceptions

Type Reason
ArgumentException Is thrown when an argument passed to a method is invalid.

Remarks

Initialize KiiCloudStorage SDK and this must be call prior to all APIs call.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Initialize Method

Initialize KiiSDK appID, appKey, deviceID, serverUrl and KiiHttpClientFactory.

Syntax

public static void Initialize (string appId, string appKey, string serverUrl, KiiHttpClientFactory syncFactory, KiiHttpClientFactory asyncFactory)

Parameters

appId
Application ID found in your Kii developer console
appKey
Application key found in your Kii developer console
serverUrl
Server URL.
syncFactory
Http client factory for blocking api.
asyncFactory
Http client factory for non-blocking api.

Exceptions

Type Reason
ArgumentException Is thrown when an argument passed to a method is invalid.

Remarks

This method is intended for use in internal purposes. Do not use it to initialize your application.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

KiiAppsBaseUrl Property

URL for KiiApps server.

Syntax

public static string KiiAppsBaseUrl { get; }

Value

The KiiApps server URL.

Remarks

No need to serialize because this value is generated in initialize by appId and serverUrl.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ListTopics Method

Gets the list of topics in app scope.

Syntax

public static KiiListResult<KiiTopic> ListTopics ()

Returns

A list of the topics in app scope.

Exceptions

Type Reason
KiiCorp.Cloud.Storage.CloudException Is thrown when server sends error response.
KiiCorp.Cloud.Storage.UnauthorizedException Is thrown when this method called by anonymous user.

Remarks

This api sends a request to server.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ListTopics Method

Asynchronous call for Kii.ListTopics.

Syntax

public static void ListTopics (KiiGenericsCallback<KiiListResult<KiiTopic>> callback)

Parameters

callback
Callback.

Exceptions

Type Reason
KiiCorp.Cloud.Storage.CloudException Is thrown when server sends error response.

Remarks

This api sends a request to server.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ListTopics Method

Gets the list of next page of topics in app scope.

Syntax

public static KiiListResult<KiiTopic> ListTopics (string paginationKey)

Parameters

paginationKey
Specifies the pagination key that is obtained by KiiListResult`1.PaginationKey. If specified null or empty, it's same as the Kii.ListTopics.

Returns

A list of the topics in app scope.

Exceptions

Type Reason
KiiCorp.Cloud.Storage.CloudException Is thrown when server sends error response.
KiiCorp.Cloud.Storage.UnauthorizedException Is thrown when this method called by anonymous user.

Remarks

This api sends a request to server.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ListTopics Method

Asynchronous call for Kii.ListTopics(string).

Syntax

public static void ListTopics (string paginationKey, KiiGenericsCallback<KiiListResult<KiiTopic>> callback)

Parameters

paginationKey
Specifies the pagination key that is obtained by KiiListResult`1.PaginationKey. If specified null or empty, it's same as the Kii.ListTopics(KiiGenericsCallback<KiiListResult<KiiTopic>>).
callback
Callback.

Exceptions

Type Reason
KiiCorp.Cloud.Storage.CloudException Is thrown when server sends error response.

Remarks

This api sends a request to server.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Logger Property

Sets the logger.

Syntax

public static IKiiLogger Logger { get; set; }

Value

The logger.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ServerCodeEntry Method

Instantiate KiiServerCodeEntry with specified entry name.

Syntax

public static KiiServerCodeEntry ServerCodeEntry (string entryName)

Parameters

entryName
Entry name.

Returns

KiiServerCodeEntry instance.

Exceptions

Type Reason
ArgumentNullException Is thrown when entryName is null or empty string.
ArgumentException Is thrown when entryName does not match ^[a-zA-Z][_a-zA-Z0-9]*$

Remarks

Name must be valid.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ServerCodeEntry Method

Instantiate KiiServerCodeEntry with specified entry name and environment version.

Syntax

public static KiiServerCodeEntry ServerCodeEntry (string entryName, Nullable<KiiServerCodeEnvironmentVersion> environmentVersion)

Parameters

entryName
Entry name.
environmentVersion
Environment Version.

Returns

KiiServerCodeEntry instance.

Exceptions

Type Reason
ArgumentNullException Is thrown when entryName / version is null or empty string.
ArgumentException Is thrown when entryName does not match ^[a-zA-Z][_a-zA-Z0-9]*$ or version is larger than 36 characters.

Remarks

Name must be valid.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ServerCodeEntry Method

Instantiate KiiServerCodeEntry with specified entry name and version.

Syntax

public static KiiServerCodeEntry ServerCodeEntry (string entryName, string version)

Parameters

entryName
Entry name.
version
Version.

Returns

KiiServerCodeEntry instance.

Exceptions

Type Reason
ArgumentNullException Is thrown when entryName / version is null or empty string.
ArgumentException Is thrown when entryName does not match ^[a-zA-Z][_a-zA-Z0-9]*$ or version is larger than 36 characters.

Remarks

Name must be valid.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

ServerCodeEntry Method

Instantiate KiiServerCodeEntry with specified entry name and version and environment version.

Syntax

public static KiiServerCodeEntry ServerCodeEntry (string entryName, string version, Nullable<KiiServerCodeEnvironmentVersion> environmentVersion)

Parameters

entryName
Entry name.
version
Version.
environmentVersion
Environment Version.

Returns

KiiServerCodeEntry instance.

Exceptions

Type Reason
ArgumentNullException Is thrown when entryName / version is null or empty string.
ArgumentException Is thrown when entryName does not match ^[a-zA-Z][_a-zA-Z0-9]*$ or version is larger than 36 characters.

Remarks

Name must be valid.

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0

Topic Method

Get instance of app scope topic. The topic bound to the application.

Syntax

public static KiiTopic Topic (string name)

Parameters

name
topic name.

Returns

KiiTopic bound to the application.

Remarks

Requirements

Namespace: KiiCorp.Cloud.Storage
Assembly: KiiCloudStorageSDK (in KiiCloudStorageSDK.dll)
Assembly Versions: 3.2.10.0