|
| 1 | +"""Types package for TFE client.""" |
| 2 | + |
| 3 | +# Import all types from the main types module by using importlib to avoid circular imports |
| 4 | +import importlib.util |
| 5 | +import os |
| 6 | + |
| 7 | +# Re-export all registry module types |
| 8 | +from .registry_module_types import ( |
| 9 | + AgentExecutionMode, |
| 10 | + Commit, |
| 11 | + CommitList, |
| 12 | + Input, |
| 13 | + Output, |
| 14 | + ProviderDependency, |
| 15 | + PublishingMechanism, |
| 16 | + RegistryModule, |
| 17 | + RegistryModuleCreateOptions, |
| 18 | + RegistryModuleCreateVersionOptions, |
| 19 | + RegistryModuleCreateWithVCSConnectionOptions, |
| 20 | + RegistryModuleID, |
| 21 | + RegistryModuleList, |
| 22 | + RegistryModuleListIncludeOpt, |
| 23 | + RegistryModuleListOptions, |
| 24 | + RegistryModulePermissions, |
| 25 | + RegistryModuleStatus, |
| 26 | + RegistryModuleUpdateOptions, |
| 27 | + RegistryModuleVCSRepo, |
| 28 | + RegistryModuleVCSRepoOptions, |
| 29 | + RegistryModuleVCSRepoUpdateOptions, |
| 30 | + RegistryModuleVersion, |
| 31 | + RegistryModuleVersionStatus, |
| 32 | + RegistryModuleVersionStatuses, |
| 33 | + RegistryName, |
| 34 | + Resource, |
| 35 | + Root, |
| 36 | + TerraformRegistryModule, |
| 37 | + TestConfig, |
| 38 | +) |
| 39 | + |
| 40 | +# Define what should be available when importing with * |
| 41 | +__all__ = [ |
| 42 | + # Registry module types |
| 43 | + "AgentExecutionMode", |
| 44 | + "Commit", |
| 45 | + "CommitList", |
| 46 | + "Input", |
| 47 | + "Output", |
| 48 | + "ProviderDependency", |
| 49 | + "PublishingMechanism", |
| 50 | + "RegistryModule", |
| 51 | + "RegistryModuleCreateOptions", |
| 52 | + "RegistryModuleCreateVersionOptions", |
| 53 | + "RegistryModuleCreateWithVCSConnectionOptions", |
| 54 | + "RegistryModuleID", |
| 55 | + "RegistryModuleList", |
| 56 | + "RegistryModuleListIncludeOpt", |
| 57 | + "RegistryModuleListOptions", |
| 58 | + "RegistryModulePermissions", |
| 59 | + "RegistryModuleStatus", |
| 60 | + "RegistryModuleUpdateOptions", |
| 61 | + "RegistryModuleVCSRepo", |
| 62 | + "RegistryModuleVCSRepoOptions", |
| 63 | + "RegistryModuleVCSRepoUpdateOptions", |
| 64 | + "RegistryModuleVersion", |
| 65 | + "RegistryModuleVersionStatus", |
| 66 | + "RegistryModuleVersionStatuses", |
| 67 | + "RegistryName", |
| 68 | + "Resource", |
| 69 | + "Root", |
| 70 | + "TestConfig", |
| 71 | + "TerraformRegistryModule", |
| 72 | + # Main types from types.py (will be dynamically added below) |
| 73 | + "Capacity", |
| 74 | + "DataRetentionPolicy", |
| 75 | + "DataRetentionPolicyChoice", |
| 76 | + "DataRetentionPolicyDeleteOlder", |
| 77 | + "DataRetentionPolicyDeleteOlderSetOptions", |
| 78 | + "DataRetentionPolicyDontDelete", |
| 79 | + "DataRetentionPolicyDontDeleteSetOptions", |
| 80 | + "DataRetentionPolicySetOptions", |
| 81 | + "EffectiveTagBinding", |
| 82 | + "Entitlements", |
| 83 | + "ExecutionMode", |
| 84 | + "LockedByChoice", |
| 85 | + "Organization", |
| 86 | + "OrganizationCreateOptions", |
| 87 | + "OrganizationUpdateOptions", |
| 88 | + "Pagination", |
| 89 | + "Project", |
| 90 | + "ReadRunQueueOptions", |
| 91 | + "Run", |
| 92 | + "RunQueue", |
| 93 | + "RunStatus", |
| 94 | + "Tag", |
| 95 | + "TagBinding", |
| 96 | + "TagList", |
| 97 | + "Variable", |
| 98 | + "VariableCreateOptions", |
| 99 | + "VariableListOptions", |
| 100 | + "VariableUpdateOptions", |
| 101 | + "VCSRepo", |
| 102 | + "Workspace", |
| 103 | + "WorkspaceActions", |
| 104 | + "WorkspaceAddRemoteStateConsumersOptions", |
| 105 | + "WorkspaceAddTagBindingsOptions", |
| 106 | + "WorkspaceAddTagsOptions", |
| 107 | + "WorkspaceAssignSSHKeyOptions", |
| 108 | + "WorkspaceCreateOptions", |
| 109 | + "WorkspaceIncludeOpt", |
| 110 | + "WorkspaceList", |
| 111 | + "WorkspaceListOptions", |
| 112 | + "WorkspaceListRemoteStateConsumersOptions", |
| 113 | + "WorkspaceLockOptions", |
| 114 | + "WorkspaceOutputs", |
| 115 | + "WorkspacePermissions", |
| 116 | + "WorkspaceReadOptions", |
| 117 | + "WorkspaceRemoveRemoteStateConsumersOptions", |
| 118 | + "WorkspaceRemoveTagsOptions", |
| 119 | + "WorkspaceRemoveVCSConnectionOptions", |
| 120 | + "WorkspaceSettingOverwrites", |
| 121 | + "WorkspaceSource", |
| 122 | + "WorkspaceTagListOptions", |
| 123 | + "WorkspaceUpdateOptions", |
| 124 | + "WorkspaceUpdateRemoteStateConsumersOptions", |
| 125 | +] |
| 126 | + |
| 127 | +# Load the main types.py file that's at the same level as this types/ directory |
| 128 | +types_py_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "types.py") |
| 129 | +spec = importlib.util.spec_from_file_location("main_types", types_py_path) |
| 130 | +if spec is not None and spec.loader is not None: |
| 131 | + main_types = importlib.util.module_from_spec(spec) |
| 132 | + spec.loader.exec_module(main_types) |
| 133 | + |
| 134 | + # Re-export all main types |
| 135 | + for name in dir(main_types): |
| 136 | + if not name.startswith("_"): |
| 137 | + globals()[name] = getattr(main_types, name) |
0 commit comments