C# Class gdapi.Client

Represents the Client which handles all communication to the API.
Afficher le fichier Open project: godaddy/gdapi-csharp Class Usage Examples

Méthodes publiques

Méthode Description
Client ( string base_url, string access_key, string secret_key ) : System.Collections.Generic

Creates a new Client.

create ( string collectionType, Resource resource ) : Resource

Creates a new Resource.

delete ( string collectionType, Resource resource ) : Resource

Deletes a Resource

doAction ( string actionUrl ) : Resource

Performs an action from a Resource and returns the resulting Resource.

doAction ( string actionUrl, Resource inputResource ) : Resource

Performs an action from an action url and an input resource and returns the resulting Resource

fetchLinkAsCollection ( Resource resource, string linkName ) : Collection

Fetches a link from the API as a Collection.

fetchLinkAsResource ( Resource resource, string linkName ) : Resource

Fetches a link from the API as a Resource.

getBaseUrl ( ) : string

Gets the base url of the Client

getCollection ( string resourceType ) : Collection

Returns an unfiltered Collection from the API

getCollection ( string resourceType, CollectionFilter collectionFilter ) : Collection

Returns a filtered Collection from the API

getNetworkCredential ( ) : NetworkCredential

Returns the current NetworkCredentials used by the Client

getResourceById ( string collectionType, string resourceId ) : Resource

Returns a Resource by an id.

save ( string collectionType, Resource resource ) : Resource

Saves a Resource

Private Methods

Méthode Description
getCollectionByRequest ( gdapi webRequest ) : Collection

Returns a Collection from a WebRequest.

getResourceByRequest ( gdapi webRequest ) : Resource

Returns a Resource from a WebRequest

Method Details

Client() public méthode

Creates a new Client.
public Client ( string base_url, string access_key, string secret_key ) : System.Collections.Generic
base_url string Base Url of the API
access_key string Access Key to the API
secret_key string Secret Key to the API
Résultat System.Collections.Generic

create() public méthode

Creates a new Resource.
public create ( string collectionType, Resource resource ) : Resource
collectionType string Collection type to add the resource to
resource Resource Resource to add to the Collection
Résultat Resource

delete() public méthode

Deletes a Resource
public delete ( string collectionType, Resource resource ) : Resource
collectionType string Collection type to delete the resource from
resource Resource Resource to delete
Résultat Resource

doAction() public méthode

Performs an action from a Resource and returns the resulting Resource.
public doAction ( string actionUrl ) : Resource
actionUrl string Action URL to perform.
Résultat Resource

doAction() public méthode

Performs an action from an action url and an input resource and returns the resulting Resource
public doAction ( string actionUrl, Resource inputResource ) : Resource
actionUrl string Action URL to perform.
inputResource Resource Input Resource to use send with the action URL.
Résultat Resource

fetchLinkAsCollection() public méthode

Fetches a link from the API as a Collection.
public fetchLinkAsCollection ( Resource resource, string linkName ) : Collection
resource Resource Resource object which contains links.
linkName string Link name to return.
Résultat Collection

fetchLinkAsResource() public méthode

Fetches a link from the API as a Resource.
public fetchLinkAsResource ( Resource resource, string linkName ) : Resource
resource Resource Resource object which contains links.
linkName string Link name to return.
Résultat Resource

getBaseUrl() public méthode

Gets the base url of the Client
public getBaseUrl ( ) : string
Résultat string

getCollection() public méthode

Returns an unfiltered Collection from the API
public getCollection ( string resourceType ) : Collection
resourceType string Type of the Collection to return.
Résultat Collection

getCollection() public méthode

Returns a filtered Collection from the API
public getCollection ( string resourceType, CollectionFilter collectionFilter ) : Collection
resourceType string Type of the Collection to return.
collectionFilter CollectionFilter
Résultat Collection

getNetworkCredential() public méthode

Returns the current NetworkCredentials used by the Client
public getNetworkCredential ( ) : NetworkCredential
Résultat System.Net.NetworkCredential

getResourceById() public méthode

Returns a Resource by an id.
public getResourceById ( string collectionType, string resourceId ) : Resource
collectionType string Collection to pull the Resource from
resourceId string Id of the Resource to pull
Résultat Resource

save() public méthode

Saves a Resource
public save ( string collectionType, Resource resource ) : Resource
collectionType string Collection type to save the resource to
resource Resource Resource to save
Résultat Resource