Interface IClientService
Client service contains all the necessary information a Google service requires.
Each concrete IClientServiceRequest has a reference to a service for
important properties like API key, application name, base Uri, etc.
This service interface also contains serialization methods to serialize an object to stream and deserialize a
stream into an object.
Assembly: Google.Apis.dll
Syntax
public interface IClientService : IDisposable
Properties
ApiKey
Gets the API-Key (DeveloperKey) which this service uses for all requests.
Declaration
Property Value
ApplicationName
Gets the application name to be used in the User-Agent header.
Declaration
string ApplicationName { get; }
Property Value
BasePath
Gets the BasePath of the service.
Declaration
Property Value
BaseUri
Gets the BaseUri of the service. All request paths should be relative to this URI.
Declaration
Property Value
Features
Gets the supported features by this service.
Declaration
IList<string> Features { get; }
Property Value
GZipEnabled
Gets or sets whether this service supports GZip.
Declaration
bool GZipEnabled { get; }
Property Value
HttpClient
Gets the HTTP client which is used to create requests.
Declaration
ConfigurableHttpClient HttpClient { get; }
Property Value
Type |
Description |
ConfigurableHttpClient |
|
HttpClientInitializer
Gets a HTTP client initializer which is able to custom properties on
Google.Apis.Http.ConfigurableHttpClient and
Google.Apis.Http.ConfigurableMessageHandler.
Declaration
IConfigurableHttpClientInitializer HttpClientInitializer { get; }
Property Value
Type |
Description |
IConfigurableHttpClientInitializer |
|
Name
Declaration
Property Value
Serializer
Gets the Serializer used by this service.
Declaration
ISerializer Serializer { get; }
Property Value
Type |
Description |
ISerializer |
|
Methods
DeserializeError(HttpResponseMessage)
Deserializes an error response into a Google.Apis.Requests.RequestError object.
Declaration
Task<RequestError> DeserializeError(HttpResponseMessage response)
Parameters
Returns
Type |
Description |
Task<RequestError> |
|
Exceptions
Type |
Condition |
GoogleApiException |
If no error is found in the response.
|
DeserializeResponse<T>(HttpResponseMessage)
Deserializes a response into the specified object.
Declaration
Task<T> DeserializeResponse<T>(HttpResponseMessage response)
Parameters
Returns
Type Parameters
SerializeObject(object)
Serializes an object into a string representation.
Declaration
string SerializeObject(object data)
Parameters
Type |
Name |
Description |
object |
data |
|
Returns
SetRequestSerailizedContent(HttpRequestMessage, object)
Sets the content of the request by the given body and the this service's configuration.
First the body object is serialized by the Serializer and then, if GZip is enabled, the content will be
wrapped in a GZip stream, otherwise a regular string stream will be used.
Declaration
void SetRequestSerailizedContent(HttpRequestMessage request, object body)
Parameters