| 123 | |
| 124 | class CustomCloud(BaseCloud): |
| 125 | def __init__(self, *, project_id, cloud_host, **kwargs): |
| 126 | super().__init__() |
| 127 | |
| 128 | self.project_id = project_id |
| 129 | self.cloud_host = cloud_host |
| 130 | |
| 131 | # Configure this object's attributes specifically for the cloud that the developer wants to connect to: |
| 132 | # -> For this purpose, all additional keyword arguments (kwargs) will be set as attributes of the CustomCloud object |
| 133 | # This allows the maximum amount of attribute customization |
| 134 | # See the docstring for the cloud._base.BaseCloud class to find out what attributes can be set / specified as keyword args |
| 135 | self.__dict__.update(kwargs) |
| 136 | |
| 137 | # If even more customization is needed, the developer can create a class inheriting from cloud._base.BaseCloud to override functions like .set_var etc. |
| 138 | |
| 139 | |
| 140 | def get_cloud(project_id, *, CloudClass: type[BaseCloud] = ScratchCloud) -> BaseCloud: |