|
16 | 16 | from .base_model import UNSET, UnsetType |
17 | 17 | from .create_connection import CreateConnection, CreateConnectionCreateConnection |
18 | 18 | from .create_dataset import CreateDataset, CreateDatasetCreateDataset |
| 19 | +from .create_organization import ( |
| 20 | + CreateOrganization, |
| 21 | + CreateOrganizationCreateOrganization, |
| 22 | +) |
19 | 23 | from .create_pipeline import CreatePipeline, CreatePipelineCreatePipeline |
20 | 24 | from .create_pipeline_from_template_version import ( |
21 | 25 | CreatePipelineFromTemplateVersion, |
|
50 | 54 | ArchiveWorkspaceInput, |
51 | 55 | CreateConnectionInput, |
52 | 56 | CreateDatasetInput, |
| 57 | + CreateOrganizationInput, |
53 | 58 | CreatePipelineFromTemplateVersionInput, |
54 | 59 | CreatePipelineInput, |
55 | 60 | CreatePipelineRecipientInput, |
|
67 | 72 | StopPipelineInput, |
68 | 73 | UpdateConnectionInput, |
69 | 74 | UpdateDatasetInput, |
| 75 | + UpdateOrganizationInput, |
70 | 76 | UpdateWebappInput, |
71 | 77 | UpdateWorkspaceInput, |
72 | 78 | UpgradePipelineVersionFromTemplateInput, |
|
76 | 82 | InviteWorkspaceMember, |
77 | 83 | InviteWorkspaceMemberInviteWorkspaceMember, |
78 | 84 | ) |
| 85 | +from .organization import Organization, OrganizationOrganization |
| 86 | +from .organizations import Organizations, OrganizationsOrganizations |
79 | 87 | from .pipeline import Pipeline, PipelinePipelineByCode |
80 | 88 | from .pipelines import Pipelines, PipelinesPipelines |
81 | 89 | from .remove_webapp_from_favorites import ( |
|
85 | 93 | from .stop_pipeline import StopPipeline, StopPipelineStopPipeline |
86 | 94 | from .update_connection import UpdateConnection, UpdateConnectionUpdateConnection |
87 | 95 | from .update_dataset import UpdateDataset, UpdateDatasetUpdateDataset |
| 96 | +from .update_organization import ( |
| 97 | + UpdateOrganization, |
| 98 | + UpdateOrganizationUpdateOrganization, |
| 99 | +) |
88 | 100 | from .update_pipeline_heartbeat import ( |
89 | 101 | UpdatePipelineHeartbeat, |
90 | 102 | UpdatePipelineHeartbeatUpdatePipelineHeartbeat, |
@@ -860,6 +872,126 @@ def delete_connection( |
860 | 872 | data = self.get_data(response) |
861 | 873 | return DeleteConnection.model_validate(data).delete_connection |
862 | 874 |
|
| 875 | + def organization( |
| 876 | + self, id: Any, **kwargs: Any |
| 877 | + ) -> Optional[OrganizationOrganization]: |
| 878 | + query = gql( |
| 879 | + """ |
| 880 | + query Organization($id: UUID!) { |
| 881 | + organization(id: $id) { |
| 882 | + id |
| 883 | + name |
| 884 | + shortName |
| 885 | + workspaces { |
| 886 | + items { |
| 887 | + slug |
| 888 | + name |
| 889 | + countries { |
| 890 | + code |
| 891 | + } |
| 892 | + } |
| 893 | + } |
| 894 | + permissions { |
| 895 | + createWorkspace |
| 896 | + archiveWorkspace |
| 897 | + } |
| 898 | + } |
| 899 | + } |
| 900 | + """ |
| 901 | + ) |
| 902 | + variables: Dict[str, object] = {"id": id} |
| 903 | + response = self.execute( |
| 904 | + query=query, operation_name="Organization", variables=variables, **kwargs |
| 905 | + ) |
| 906 | + data = self.get_data(response) |
| 907 | + return Organization.model_validate(data).organization |
| 908 | + |
| 909 | + def organizations(self, **kwargs: Any) -> List[OrganizationsOrganizations]: |
| 910 | + query = gql( |
| 911 | + """ |
| 912 | + query Organizations { |
| 913 | + organizations { |
| 914 | + id |
| 915 | + name |
| 916 | + workspaces { |
| 917 | + items { |
| 918 | + slug |
| 919 | + name |
| 920 | + } |
| 921 | + } |
| 922 | + } |
| 923 | + } |
| 924 | + """ |
| 925 | + ) |
| 926 | + variables: Dict[str, object] = {} |
| 927 | + response = self.execute( |
| 928 | + query=query, operation_name="Organizations", variables=variables, **kwargs |
| 929 | + ) |
| 930 | + data = self.get_data(response) |
| 931 | + return Organizations.model_validate(data).organizations |
| 932 | + |
| 933 | + def create_organization( |
| 934 | + self, input: CreateOrganizationInput, **kwargs: Any |
| 935 | + ) -> CreateOrganizationCreateOrganization: |
| 936 | + query = gql( |
| 937 | + """ |
| 938 | + mutation CreateOrganization($input: CreateOrganizationInput!) { |
| 939 | + createOrganization(input: $input) { |
| 940 | + success |
| 941 | + errors |
| 942 | + organization { |
| 943 | + id |
| 944 | + name |
| 945 | + shortName |
| 946 | + } |
| 947 | + user { |
| 948 | + id |
| 949 | + email |
| 950 | + displayName |
| 951 | + } |
| 952 | + } |
| 953 | + } |
| 954 | + """ |
| 955 | + ) |
| 956 | + variables: Dict[str, object] = {"input": input} |
| 957 | + response = self.execute( |
| 958 | + query=query, |
| 959 | + operation_name="CreateOrganization", |
| 960 | + variables=variables, |
| 961 | + **kwargs |
| 962 | + ) |
| 963 | + data = self.get_data(response) |
| 964 | + return CreateOrganization.model_validate(data).create_organization |
| 965 | + |
| 966 | + def update_organization( |
| 967 | + self, input: UpdateOrganizationInput, **kwargs: Any |
| 968 | + ) -> UpdateOrganizationUpdateOrganization: |
| 969 | + query = gql( |
| 970 | + """ |
| 971 | + mutation UpdateOrganization($input: UpdateOrganizationInput!) { |
| 972 | + updateOrganization(input: $input) { |
| 973 | + success |
| 974 | + errors |
| 975 | + organization { |
| 976 | + id |
| 977 | + name |
| 978 | + shortName |
| 979 | + logo |
| 980 | + } |
| 981 | + } |
| 982 | + } |
| 983 | + """ |
| 984 | + ) |
| 985 | + variables: Dict[str, object] = {"input": input} |
| 986 | + response = self.execute( |
| 987 | + query=query, |
| 988 | + operation_name="UpdateOrganization", |
| 989 | + variables=variables, |
| 990 | + **kwargs |
| 991 | + ) |
| 992 | + data = self.get_data(response) |
| 993 | + return UpdateOrganization.model_validate(data).update_organization |
| 994 | + |
863 | 995 | def get_users( |
864 | 996 | self, query: str, workspace_slug: str, **kwargs: Any |
865 | 997 | ) -> List[GetUsersUsers]: |
|
0 commit comments