Class RequestParameterAttribute (1.55.0)

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class RequestParameterAttribute : Attribute

An attribute which is used to specially mark a property for reflective purposes, assign a name to the property and indicate it's location in the request as either in the path or query portion of the request URL.

Inheritance

Object > Attribute > RequestParameterAttribute

Namespace

Google.Apis.Util

Assembly

Google.Apis.Core.dll

Constructors

RequestParameterAttribute(String)

public RequestParameterAttribute(string name)

Constructs a new property attribute to be a part of a REST URI. This constructor uses Query as the parameter's type.

Parameter
NameDescription
nameString

The name of the parameter. If the parameter is a path parameter this name will be used to substitute the string value into the path, replacing {name}. If the parameter is a query parameter, this parameter will be added to the query string, in the format "name=value".

RequestParameterAttribute(String, RequestParameterType)

public RequestParameterAttribute(string name, RequestParameterType type)

Constructs a new property attribute to be a part of a REST URI.

Parameters
NameDescription
nameString

The name of the parameter. If the parameter is a path parameter this name will be used to substitute the string value into the path, replacing {name}. If the parameter is a query parameter, this parameter will be added to the query string, in the format "name=value".

typeRequestParameterType

The type of the parameter, either Path, Query or UserDefinedQueries.

Properties

Name

public string Name { get; }

Gets the name of the parameter.

Property Value
TypeDescription
String

Type

public RequestParameterType Type { get; }

Gets the type of the parameter, Path or Query.

Property Value
TypeDescription
RequestParameterType

Extension Method