Show / Hide Table of Contents

Class ParameterUtils

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

Inheritance
System.Object
ParameterUtils
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Requests.Parameters
Assembly: Google.Apis.Core.dll
Syntax
public static class ParameterUtils

Methods

CreateFormUrlEncodedContent(Object)

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

Declaration
public static FormUrlEncodedContent CreateFormUrlEncodedContent(object request)
Parameters
Type Name Description
System.Object request

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

Returns
Type Description
System.Net.Http.FormUrlEncodedContent

A System.Net.Http.FormUrlEncodedContent which contains the all the given object required values.

CreateParameterDictionary(Object)

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

Declaration
public static IDictionary<string, object> CreateParameterDictionary(object request)
Parameters
Type Name Description
System.Object request

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

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Object>

InitParameters(RequestBuilder, Object)

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

Declaration
public static void InitParameters(RequestBuilder builder, object request)
Parameters
Type Name Description
RequestBuilder builder

The request builder

System.Object request

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

Back to top