Coverage for ocp_resources/authorino.py: 0%

61 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-30 10:48 +0200

1# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md 

2 

3from typing import Any, Dict, Optional 

4from ocp_resources.resource import NamespacedResource, MissingRequiredArgumentError 

5 

6 

7class Authorino(NamespacedResource): 

8 """ 

9 Authorino is the Schema for the authorinos API 

10 """ 

11 

12 api_group: str = NamespacedResource.ApiGroup.OPERATOR_AUTHORINO_KUADRANT_IO 

13 

14 def __init__( 

15 self, 

16 auth_config_label_selectors: Optional[str] = "", 

17 cluster_wide: Optional[bool] = None, 

18 evaluator_cache_size: Optional[int] = None, 

19 healthz: Optional[Dict[str, Any]] = None, 

20 image: Optional[str] = "", 

21 image_pull_policy: Optional[str] = "", 

22 listener: Optional[Dict[str, Any]] = None, 

23 log_level: Optional[str] = "", 

24 log_mode: Optional[str] = "", 

25 metrics: Optional[Dict[str, Any]] = None, 

26 oidc_server: Optional[Dict[str, Any]] = None, 

27 replicas: Optional[int] = None, 

28 secret_label_selectors: Optional[str] = "", 

29 superseding_host_subsets: Optional[bool] = None, 

30 tracing: Optional[Dict[str, Any]] = None, 

31 volumes: Optional[Dict[str, Any]] = None, 

32 **kwargs: Any, 

33 ) -> None: 

34 """ 

35 Args: 

36 auth_config_label_selectors (str): No field description from API; please add description 

37 

38 cluster_wide (bool): No field description from API; please add description 

39 

40 evaluator_cache_size (int): No field description from API; please add description 

41 

42 healthz (Dict[str, Any]): No field description from API; please add description 

43 

44 image (str): No field description from API; please add description 

45 

46 image_pull_policy (str): PullPolicy describes a policy for if/when to pull a container image 

47 

48 listener (Dict[str, Any]): No field description from API; please add description 

49 

50 log_level (str): No field description from API; please add description 

51 

52 log_mode (str): No field description from API; please add description 

53 

54 metrics (Dict[str, Any]): No field description from API; please add description 

55 

56 oidc_server (Dict[str, Any]): No field description from API; please add description 

57 

58 replicas (int): No field description from API; please add description 

59 

60 secret_label_selectors (str): No field description from API; please add description 

61 

62 superseding_host_subsets (bool): No field description from API; please add description 

63 

64 tracing (Dict[str, Any]): No field description from API; please add description 

65 

66 volumes (Dict[str, Any]): No field description from API; please add description 

67 

68 """ 

69 super().__init__(**kwargs) 

70 

71 self.auth_config_label_selectors = auth_config_label_selectors 

72 self.cluster_wide = cluster_wide 

73 self.evaluator_cache_size = evaluator_cache_size 

74 self.healthz = healthz 

75 self.image = image 

76 self.image_pull_policy = image_pull_policy 

77 self.listener = listener 

78 self.log_level = log_level 

79 self.log_mode = log_mode 

80 self.metrics = metrics 

81 self.oidc_server = oidc_server 

82 self.replicas = replicas 

83 self.secret_label_selectors = secret_label_selectors 

84 self.superseding_host_subsets = superseding_host_subsets 

85 self.tracing = tracing 

86 self.volumes = volumes 

87 

88 def to_dict(self) -> None: 

89 super().to_dict() 

90 

91 if not self.kind_dict and not self.yaml_file: 

92 if not self.listener: 

93 raise MissingRequiredArgumentError(argument="self.listener") 

94 

95 if not self.oidc_server: 

96 raise MissingRequiredArgumentError(argument="self.oidc_server") 

97 

98 self.res["spec"] = {} 

99 _spec = self.res["spec"] 

100 

101 _spec["listener"] = self.listener 

102 _spec["oidcServer"] = self.oidc_server 

103 

104 if self.auth_config_label_selectors: 

105 _spec["authConfigLabelSelectors"] = self.auth_config_label_selectors 

106 

107 if self.cluster_wide is not None: 

108 _spec["clusterWide"] = self.cluster_wide 

109 

110 if self.evaluator_cache_size: 

111 _spec["evaluatorCacheSize"] = self.evaluator_cache_size 

112 

113 if self.healthz: 

114 _spec["healthz"] = self.healthz 

115 

116 if self.image: 

117 _spec["image"] = self.image 

118 

119 if self.image_pull_policy: 

120 _spec["imagePullPolicy"] = self.image_pull_policy 

121 

122 if self.log_level: 

123 _spec["logLevel"] = self.log_level 

124 

125 if self.log_mode: 

126 _spec["logMode"] = self.log_mode 

127 

128 if self.metrics: 

129 _spec["metrics"] = self.metrics 

130 

131 if self.replicas: 

132 _spec["replicas"] = self.replicas 

133 

134 if self.secret_label_selectors: 

135 _spec["secretLabelSelectors"] = self.secret_label_selectors 

136 

137 if self.superseding_host_subsets is not None: 

138 _spec["supersedingHostSubsets"] = self.superseding_host_subsets 

139 

140 if self.tracing: 

141 _spec["tracing"] = self.tracing 

142 

143 if self.volumes: 

144 _spec["volumes"] = self.volumes 

145 

146 # End of generated code