1.73.0 (latest) 1.69.0 1.68.0 1.60.0 1.59.0 1.55.0 1.50.0

    public class ParameterCollection : List<KeyValuePair<string, string>>, IList<KeyValuePair<string, string>>, ICollection<KeyValuePair<string, string>>, IReadOnlyList<KeyValuePair<string, string>>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IList, ICollection, IEnumerable

A collection of parameters (key value pairs). May contain duplicate keys.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)System.Collections.Generic.KeyValuePair\`2[string](https://learn.microsoft.com/dotnet/api/system.string)[string](https://learn.microsoft.com/dotnet/api/system.string) \> ParameterCollection

## Implements

[IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)System.Collections.Generic.KeyValuePair\`2[string](https://learn.microsoft.com/dotnet/api/system.string)[string](https://learn.microsoft.com/dotnet/api/system.string), [ICollection](https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1)System.Collections.Generic.KeyValuePair\`2[string](https://learn.microsoft.com/dotnet/api/system.string)[string](https://learn.microsoft.com/dotnet/api/system.string), [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)System.Collections.Generic.KeyValuePair\`2[string](https://learn.microsoft.com/dotnet/api/system.string)[string](https://learn.microsoft.com/dotnet/api/system.string), [IReadOnlyCollection](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1)System.Collections.Generic.KeyValuePair\`2[string](https://learn.microsoft.com/dotnet/api/system.string)[string](https://learn.microsoft.com/dotnet/api/system.string), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)System.Collections.Generic.KeyValuePair\`2[string](https://learn.microsoft.com/dotnet/api/system.string)[string](https://learn.microsoft.com/dotnet/api/system.string), [IList](https://learn.microsoft.com/dotnet/api/system.collections.ilist), [ICollection](https://learn.microsoft.com/dotnet/api/system.collections.icollection), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

## Inherited Members

[List\<KeyValuePair\<string, string\>\>.Add(KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.add) [List\<KeyValuePair\<string, string\>\>.AddRange(IEnumerable\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.addrange) [List\<KeyValuePair\<string, string\>\>.AsReadOnly()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.asreadonly) [List\<KeyValuePair\<string, string\>\>.BinarySearch(KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.binarysearch#system-collections-generic-list-1-binarysearch(-0)) [List\<KeyValuePair\<string, string\>\>.BinarySearch(KeyValuePair\<string, string\>, IComparer\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.binarysearch#system-collections-generic-list-1-binarysearch(-0-system-collections-generic-icomparer((-0)))) [List\<KeyValuePair\<string, string\>\>.BinarySearch(int, int, KeyValuePair\<string, string\>, IComparer\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.binarysearch#system-collections-generic-list-1-binarysearch(system-int32-system-int32-0-system-collections-generic-icomparer((-0)))) [List\<KeyValuePair\<string, string\>\>.Clear()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.clear) [List\<KeyValuePair\<string, string\>\>.Contains(KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.contains) [List\<KeyValuePair\<string, string\>\>.ConvertAll\<TOutput\>(Converter\<KeyValuePair\<string, string\>, TOutput\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.convertall) [List\<KeyValuePair\<string, string\>\>.CopyTo(KeyValuePair\<string, string\>\[\])](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.copyto#system-collections-generic-list-1-copyto(-0())) [List\<KeyValuePair\<string, string\>\>.CopyTo(KeyValuePair\<string, string\>\[\], int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.copyto#system-collections-generic-list-1-copyto(-0()-system-int32)) [List\<KeyValuePair\<string, string\>\>.CopyTo(int, KeyValuePair\<string, string\>\[\], int, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.copyto#system-collections-generic-list-1-copyto(system-int32-0()-system-int32-system-int32)) [List\<KeyValuePair\<string, string\>\>.Exists(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.exists) [List\<KeyValuePair\<string, string\>\>.Find(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.find) [List\<KeyValuePair\<string, string\>\>.FindAll(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findall) [List\<KeyValuePair\<string, string\>\>.FindIndex(int, int, Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findindex#system-collections-generic-list-1-findindex(system-int32-system-int32-system-predicate((-0)))) [List\<KeyValuePair\<string, string\>\>.FindIndex(int, Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findindex#system-collections-generic-list-1-findindex(system-int32-system-predicate((-0)))) [List\<KeyValuePair\<string, string\>\>.FindIndex(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findindex#system-collections-generic-list-1-findindex(system-predicate((-0)))) [List\<KeyValuePair\<string, string\>\>.FindLast(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findlast) [List\<KeyValuePair\<string, string\>\>.FindLastIndex(int, int, Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findlastindex#system-collections-generic-list-1-findlastindex(system-int32-system-int32-system-predicate((-0)))) [List\<KeyValuePair\<string, string\>\>.FindLastIndex(int, Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findlastindex#system-collections-generic-list-1-findlastindex(system-int32-system-predicate((-0)))) [List\<KeyValuePair\<string, string\>\>.FindLastIndex(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.findlastindex#system-collections-generic-list-1-findlastindex(system-predicate((-0)))) [List\<KeyValuePair\<string, string\>\>.ForEach(Action\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.foreach) [List\<KeyValuePair\<string, string\>\>.GetEnumerator()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.getenumerator) [List\<KeyValuePair\<string, string\>\>.GetRange(int, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.getrange) [List\<KeyValuePair\<string, string\>\>.IndexOf(KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.indexof#system-collections-generic-list-1-indexof(-0)) [List\<KeyValuePair\<string, string\>\>.IndexOf(KeyValuePair\<string, string\>, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.indexof#system-collections-generic-list-1-indexof(-0-system-int32)) [List\<KeyValuePair\<string, string\>\>.IndexOf(KeyValuePair\<string, string\>, int, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.indexof#system-collections-generic-list-1-indexof(-0-system-int32-system-int32)) [List\<KeyValuePair\<string, string\>\>.Insert(int, KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.insert) [List\<KeyValuePair\<string, string\>\>.InsertRange(int, IEnumerable\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.insertrange) [List\<KeyValuePair\<string, string\>\>.LastIndexOf(KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.lastindexof#system-collections-generic-list-1-lastindexof(-0)) [List\<KeyValuePair\<string, string\>\>.LastIndexOf(KeyValuePair\<string, string\>, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.lastindexof#system-collections-generic-list-1-lastindexof(-0-system-int32)) [List\<KeyValuePair\<string, string\>\>.LastIndexOf(KeyValuePair\<string, string\>, int, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.lastindexof#system-collections-generic-list-1-lastindexof(-0-system-int32-system-int32)) [List\<KeyValuePair\<string, string\>\>.Remove(KeyValuePair\<string, string\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.remove) [List\<KeyValuePair\<string, string\>\>.RemoveAll(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.removeall) [List\<KeyValuePair\<string, string\>\>.RemoveAt(int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.removeat) [List\<KeyValuePair\<string, string\>\>.RemoveRange(int, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.removerange) [List\<KeyValuePair\<string, string\>\>.Reverse()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.reverse#system-collections-generic-list-1-reverse) [List\<KeyValuePair\<string, string\>\>.Reverse(int, int)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.reverse#system-collections-generic-list-1-reverse(system-int32-system-int32)) [List\<KeyValuePair\<string, string\>\>.Sort()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.sort#system-collections-generic-list-1-sort) [List\<KeyValuePair\<string, string\>\>.Sort(IComparer\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.sort#system-collections-generic-list-1-sort(system-collections-generic-icomparer((-0)))) [List\<KeyValuePair\<string, string\>\>.Sort(Comparison\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.sort#system-collections-generic-list-1-sort(system-comparison((-0)))) [List\<KeyValuePair\<string, string\>\>.Sort(int, int, IComparer\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.sort#system-collections-generic-list-1-sort(system-int32-system-int32-system-collections-generic-icomparer((-0)))) [List\<KeyValuePair\<string, string\>\>.ToArray()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.toarray) [List\<KeyValuePair\<string, string\>\>.TrimExcess()](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.trimexcess) [List\<KeyValuePair\<string, string\>\>.TrueForAll(Predicate\<KeyValuePair\<string, string\>\>)](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.trueforall) [List\<KeyValuePair\<string, string\>\>.Capacity](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.capacity) [List\<KeyValuePair\<string, string\>\>.Count](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1.count) [List\<KeyValuePair\<string, string\>\>.this\[int\]](https://learn.microsoft.com/dotnet/api/system.int32) [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Apis.Requests.Parameters](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Requests.Parameters.md.txt)

## Assembly

Google.Apis.Core.dll

## Constructors

### ParameterCollection()

    public ParameterCollection()

Constructs a new parameter collection.

### ParameterCollection(IEnumerable\<KeyValuePair\<string, string\>\>)

    public ParameterCollection(IEnumerable<KeyValuePair<string, string>> collection)

Constructs a new parameter collection from the given collection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `collection` | ``IEnumerableSystem.Collections.Generic.KeyValuePair`2stringstring`` |

## Properties

### this\[string\]

    public IEnumerable<string> this[string key] { get; }

Returns all matches for the specified key. May return an empty enumeration if the key is not present.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `string` |

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `IEnumerablestring` |   |

## Methods

### Add(string, string)

    public void Add(string key, string value)

Adds a single parameter to this collection.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `string` |
| `value` | `string` |

### ContainsKey(string)

    public bool ContainsKey(string key)

Returns `true` if this parameter is set within the collection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### FromDictionary(IDictionary\<string, object\>)

    public static ParameterCollection FromDictionary(IDictionary<string, object> dictionary)

Creates a parameter collection from the specified dictionary.
If the value is an enumerable, a parameter pair will be added for each value.
Otherwise the value will be converted into a string using the .ToString() method.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `dictionary` | `IDictionarystringobject` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ParameterCollection` |   |

### FromQueryString(string)

    public static ParameterCollection FromQueryString(string qs)

Creates a parameter collection from the specified URL encoded query string.
Example:
The query string "foo=bar\&chocolate=cookie" would result in two parameters (foo and bar)
with the values "bar" and "cookie" set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `qs` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ParameterCollection` |   |

### GetAllMatches(string)

    public IEnumerable<string> GetAllMatches(string key)

Returns all matches for the specified key. May return an empty enumeration if the key is not present.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IEnumerablestring` |   |

### GetFirstMatch(string)

    public string GetFirstMatch(string key)

Returns the value of the first matching key, or throws a KeyNotFoundException if the parameter is not
present within the collection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### TryGetValue(string, out string)

    public bool TryGetValue(string key, out string value)

Tries to find the a key within the specified key value collection. Returns true if the key was found.
If a pair was found the out parameter value will contain the value of that pair.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `string` |
| `value` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

## Extension Method

[Utilities.ThrowIfNull\<T\>(T, string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities.md.txt#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)