Class ParameterUtils

public static class ParameterUtils

Utility class for iterating on RequestParameterAttribute properties in a request object.

Inheritance

Object > ParameterUtils

Namespace

Google.Apis.Requests.Parameters

Assembly

Google.Apis.Core.dll

Methods

CreateFormUrlEncodedContent(Object)

public static FormUrlEncodedContent CreateFormUrlEncodedContent(object request)

Creates a FormUrlEncodedContent with all the specified parameters in the input request. It uses reflection to iterate over all properties with RequestParameterAttribute attribute.

Parameter
NameDescription
requestObject

A request object which contains properties with RequestParameterAttribute attribute. Those properties will be serialized to the returned FormUrlEncodedContent.

Returns
TypeDescription
FormUrlEncodedContent

A FormUrlEncodedContent which contains the all the given object required values.

CreateParameterDictionary(Object)

public static IDictionary<string, object> CreateParameterDictionary(object request)

Creates a parameter dictionary by using reflection to iterate over all properties with RequestParameterAttribute attribute.

Parameter
NameDescription
requestObject

A request object which contains properties with RequestParameterAttribute attribute. Those properties will be set in the output dictionary.

Returns
TypeDescription
IDictionary<String, Object>

InitParameters(RequestBuilder, Object)

public static void InitParameters(RequestBuilder builder, object request)

Sets query parameters in the given builder with all all properties with the RequestParameterAttribute attribute.

Parameters
NameDescription
builderRequestBuilder

The request builder

requestObject

A request object which contains properties with RequestParameterAttribute attribute. Those properties will be set in the given request builder object