<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="grpc_robot.Collections" type="LIBRARY" format="ROBOT" scope="TEST" namedargs="true" generated="2021-07-14T07:45:58Z" specversion="2" source="../grpc_robot/tools/robot_tools.py" lineno="16">
<version>2.9.1</version>
<scope>test case</scope>
<namedargs>yes</namedargs>
<doc>Tools for collections (list, dict) related functionality.</doc>
<kw name="Dict Get Key By Value" lineno="27">
<arguments>
<arg>input_dict</arg>
<arg>search_value</arg>
</arguments>
<doc>Gets the first key from _input_dict_ which has the value of _search_value_.

If _search_value_ is not found in _input_dict_, an empty string is returned.

*Parameters*:
- _input_dict_: &lt;dictionary&gt; to be browsed.
- _search_value_: &lt;string&gt;, value to be searched for.

*Return*: key of dictionary if search value is in input_dict else empty string</doc>
</kw>
<kw name="Dict Get Value" lineno="48">
<arguments>
<arg>values_dict</arg>
<arg>key</arg>
<arg>strict=False</arg>
</arguments>
<doc>Returns the value for given _key_ in _values_dict_.

If _strict_ is set to False (default) it will return given _key_ if its is not in the dictionary.
If set to True, an AssertionError is raised.

*Parameters*:
- _key_: &lt;string&gt;, key to be searched in dictionary.
- _values_dict_: &lt;dictionary&gt; in which the key is searched.
- _strict_: Optional: &lt;boolean&gt; switch to indicate if an exception shall be raised if key is not in values_dict.
        Default: False

*Return*:
- if key is in values_dict: Value from _values_dict_ for _key_.
- else: _key_.
- raises AssertionError in case _key_ is not in _values_dict_ and _strict_ is True.</doc>
</kw>
<kw name="List Get Dict By Value" lineno="77">
<arguments>
<arg>input_list</arg>
<arg>key_name</arg>
<arg>value</arg>
<arg>match=first</arg>
</arguments>
<doc>Retrieves a dictionary from a list of dictionaries where _key_name_ has the _value, if _match_ is
"first". Else it returns all matching dictionaries.

*Parameters*:
- _input_list_: &lt;list&gt; ; List of dictionaries.
- _key_name_: &lt;dictionary&gt; or &lt;list&gt; ; Name of the key to be searched for.
- _value_: &lt;string&gt; or &lt;number&gt; ; Any value of key _key_name_ to be searched for.

*Example*:
| ${dict1}    | Create Dictionary      | key_key=master1 | key1=value11 | key2=value12 |          |
| ${dict2}    | Create Dictionary      | key_key=master2 | key1=value21 | key2=value22 |          |
| ${dict3}    | Create Dictionary      | key_key=master3 | key1=value31 | key2=value32 |          |
| ${dict4}    | Create Dictionary      | key_key=master4 | key5=value41 | key6=value42 |          |
| ${the_list} | Create List            | ${dict1}        | ${dict2}     | ${dict3}     | ${dict4} |
| ${result}   | List Get Dict By Value | ${the_list}     | key_key      | master4      |          |

Variable ${result} has following structure:
| ${result} = {
|   'key_key': 'master4',
|   'key5': 'value41',
|   'key6': 'value42'
| }</doc>
</kw>
<kw name="To Camel Case" lineno="111">
<arguments>
<arg>snake_str</arg>
<arg>first_uppercase=False</arg>
</arguments>
<doc></doc>
</kw>
</keywordspec>
