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.
Inherited Members
System.IDisposable.Dispose()
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
Type |
Description |
System.String |
|
ApplicationName
Gets the application name to be used in the User-Agent header.
Declaration
string ApplicationName { get; }
Property Value
Type |
Description |
System.String |
|
BasePath
Gets the BasePath of the service.
Declaration
Property Value
Type |
Description |
System.String |
|
BaseUri
Gets the BaseUri of the service. All request paths should be relative to this URI.
Declaration
Property Value
Type |
Description |
System.String |
|
Features
Gets the supported features by this service.
Declaration
IList<string> Features { get; }
Property Value
Type |
Description |
System.Collections.Generic.IList<System.String> |
|
GZipEnabled
Gets or sets whether this service supports GZip.
Declaration
bool GZipEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
HttpClient
Gets the HTTP client which is used to create requests.
Declaration
ConfigurableHttpClient HttpClient { get; }
Property Value
Type |
Description |
Google.Apis.Http.ConfigurableHttpClient |
|
HttpClientInitializer
Gets a HTTP client initializer which is able to custom properties on
Google.Apis.Http.ConfigurableHttpClient and
ConfigurableMessageHandler.
Declaration
IConfigurableHttpClientInitializer HttpClientInitializer { get; }
Property Value
Type |
Description |
Google.Apis.Http.IConfigurableHttpClientInitializer |
|
Name
Declaration
Property Value
Type |
Description |
System.String |
|
Serializer
Gets the Serializer used by this service.
Declaration
ISerializer Serializer { get; }
Property Value
Type |
Description |
Google.Apis.ISerializer |
|
Methods
DeserializeError(HttpResponseMessage)
Deserializes an error response into a Google.Apis.Requests.RequestError object.
Declaration
Task<RequestError> DeserializeError(HttpResponseMessage response)
Parameters
Type |
Name |
Description |
System.Net.Http.HttpResponseMessage |
response |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<Google.Apis.Requests.RequestError> |
|
Exceptions
DeserializeResponse<T>(HttpResponseMessage)
Deserializes a response into the specified object.
Declaration
Task<T> DeserializeResponse<T>(HttpResponseMessage response)
Parameters
Type |
Name |
Description |
System.Net.Http.HttpResponseMessage |
response |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
SerializeObject(Object)
Serializes an object into a string representation.
Declaration
string SerializeObject(object data)
Parameters
Type |
Name |
Description |
System.Object |
data |
|
Returns
Type |
Description |
System.String |
|
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
Type |
Name |
Description |
System.Net.Http.HttpRequestMessage |
request |
|
System.Object |
body |
|