Coverage for ocp_resources/ssp.py: 0%

33 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 SSP(NamespacedResource): 

8 """ 

9 SSP is the Schema for the ssps API 

10 """ 

11 

12 api_group: str = NamespacedResource.ApiGroup.SSP_KUBEVIRT_IO 

13 

14 def __init__( 

15 self, 

16 common_instancetypes: Optional[Dict[str, Any]] = None, 

17 common_templates: Optional[Dict[str, Any]] = None, 

18 feature_gates: Optional[Dict[str, Any]] = None, 

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

20 tekton_tasks: Optional[Dict[str, Any]] = None, 

21 template_validator: Optional[Dict[str, Any]] = None, 

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

23 **kwargs: Any, 

24 ) -> None: 

25 """ 

26 Args: 

27 common_instancetypes (Dict[str, Any]): CommonInstancetypes is the configuration of the common-instancetypes 

28 operand Deprecated: This functionality will be removed in a 

29 future release. 

30 

31 common_templates (Dict[str, Any]): CommonTemplates is the configuration of the common templates operand 

32 

33 feature_gates (Dict[str, Any]): FeatureGates for SSP 

34 

35 tekton_pipelines (Dict[str, Any]): TektonPipelines is the configuration of the tekton-pipelines operand 

36 Deprecated: This field is ignored. 

37 

38 tekton_tasks (Dict[str, Any]): TektonTasks is the configuration of the tekton-tasks operand 

39 Deprecated: This field is ignored. 

40 

41 template_validator (Dict[str, Any]): TemplateValidator is configuration of the template validator operand 

42 

43 tls_security_profile (Dict[str, Any]): TLSSecurityProfile is a configuration for the TLS. 

44 

45 """ 

46 super().__init__(**kwargs) 

47 

48 self.common_instancetypes = common_instancetypes 

49 self.common_templates = common_templates 

50 self.feature_gates = feature_gates 

51 self.tekton_pipelines = tekton_pipelines 

52 self.tekton_tasks = tekton_tasks 

53 self.template_validator = template_validator 

54 self.tls_security_profile = tls_security_profile 

55 

56 def to_dict(self) -> None: 

57 super().to_dict() 

58 

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

60 if not self.common_templates: 

61 raise MissingRequiredArgumentError(argument="self.common_templates") 

62 

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

64 _spec = self.res["spec"] 

65 

66 _spec["commonTemplates"] = self.common_templates 

67 

68 if self.common_instancetypes: 

69 _spec["commonInstancetypes"] = self.common_instancetypes 

70 

71 if self.feature_gates: 

72 _spec["featureGates"] = self.feature_gates 

73 

74 if self.tekton_pipelines: 

75 _spec["tektonPipelines"] = self.tekton_pipelines 

76 

77 if self.tekton_tasks: 

78 _spec["tektonTasks"] = self.tekton_tasks 

79 

80 if self.template_validator: 

81 _spec["templateValidator"] = self.template_validator 

82 

83 if self.tls_security_profile: 

84 _spec["tlsSecurityProfile"] = self.tls_security_profile 

85 

86 # End of generated code