Class RequestParameterAttribute (1.68.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
Name Description
name string

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
Name Description
name string

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".

type RequestParameterType

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

Properties

Name

public string Name { get; }

Gets the name of the parameter.

Property Value
Type Description
string

Type

public RequestParameterType Type { get; }

Gets the type of the parameter, Path or Query.

Property Value
Type Description
RequestParameterType

Extension Method