Debian Codegraph @

ansible_collections/community/dns/tests/unit/plugins/module_utils/helper.py

raw
1 # Copyright (c) 2021, Felix Fontein <[email protected]>
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 from __future__ import annotations
6
7 from ansible_collections.community.dns.plugins.module_utils._provider import (
8 ProviderInformation,
9 )
10
11
12 class CustomProviderInformation(ProviderInformation):
13 def __init__(self, txt_record_handling="decoded", txt_character_encoding="decimal"):
14 super().__init__()
15 self._txt_record_handling = txt_record_handling
16 self._txt_character_encoding = txt_character_encoding
17
18 def get_supported_record_types(self):
19 return ["A"]
20
21 def get_zone_id_type(self):
22 return "str" # pragma: no cover
23
24 def get_record_id_type(self):
25 return "str" # pragma: no cover
26
27 def get_record_default_ttl(self):
28 return 300 # pragma: no cover
29
30 def txt_record_handling(self):
31 return self._txt_record_handling
32
33 def txt_character_encoding(self):
34 return self._txt_character_encoding
35
36
37 class CustomProvideOptions:
38 def __init__(self, option_dict):
39 self._option_dict = option_dict
40
41 def get_option(self, name):
42 return self._option_dict.get(name)