Show / Hide Table of Contents

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()
Namespace: Google.Apis.Services
Assembly: Google.Apis.dll
Syntax
public interface IClientService : IDisposable

Properties

ApiKey

Gets the API-Key (DeveloperKey) which this service uses for all requests.

Declaration
string ApiKey { get; }
Property Value
Type Description
string

ApplicationName

Gets the application name to be used in the User-Agent header.

Declaration
string ApplicationName { get; }
Property Value
Type Description
string

BasePath

Gets the BasePath of the service.

Declaration
string BasePath { get; }
Property Value
Type Description
string

BaseUri

Gets the BaseUri of the service. All request paths should be relative to this URI.

Declaration
string BaseUri { get; }
Property Value
Type Description
string

Features

Gets the supported features by this service.

Declaration
IList<string> Features { get; }
Property Value
Type Description
System.Collections.Generic.IList<T><string>

GZipEnabled

Gets or sets whether this service supports GZip.

Declaration
bool GZipEnabled { get; }
Property Value
Type Description
bool

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

Gets the service name.

Declaration
string Name { get; }
Property Value
Type Description
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<TResult><Google.Apis.Requests.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
Type Name Description
System.Net.Http.HttpResponseMessage response
Returns
Type Description
System.Threading.Tasks.Task<TResult><T>
Type Parameters
Name Description
T

SerializeObject(object)

Serializes an object into a string representation.

Declaration
string SerializeObject(object data)
Parameters
Type Name Description
object data
Returns
Type Description
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
object body
In This Article
Back to top Generated by DocFX