Show / Hide Table of Contents

Class RequestParameterAttribute

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
System.Object
RequestParameterAttribute
Namespace: Google.Apis.Util
Assembly: Google.Apis.Core.dll
Syntax
public class RequestParameterAttribute : Attribute

Constructors

RequestParameterAttribute(String)

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

Declaration
public RequestParameterAttribute(string name)
Parameters
Type Name Description
System.String name

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)

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

Declaration
public RequestParameterAttribute(string name, RequestParameterType type)
Parameters
Type Name Description
System.String name

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

RequestParameterType type

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

Properties

Name

Gets the name of the parameter.

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Type

Gets the type of the parameter, Path or Query.

Declaration
public RequestParameterType Type { get; }
Property Value
Type Description
RequestParameterType

Extension Methods

Utilities.ThrowIfNull<T>(T, String)
Back to top