qontract-reconcile 0.10.2.dev485__py3-none-any.whl → 0.10.2.dev494__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qontract-reconcile
3
- Version: 0.10.2.dev485
3
+ Version: 0.10.2.dev494
4
4
  Summary: Collection of tools to reconcile services with their desired state as defined in the app-interface DB.
5
5
  Project-URL: homepage, https://github.com/app-sre/qontract-reconcile
6
6
  Project-URL: repository, https://github.com/app-sre/qontract-reconcile
@@ -43,9 +43,11 @@ Requires-Dist: pyjwt~=2.7
43
43
  Requires-Dist: pyopenssl~=23.0
44
44
  Requires-Dist: pypd<1.2.0,>=1.1.0
45
45
  Requires-Dist: python-gitlab==6.0.0
46
+ Requires-Dist: qontract-api-client
47
+ Requires-Dist: qontract-utils
46
48
  Requires-Dist: requests-oauthlib~=1.3
47
49
  Requires-Dist: requests~=2.32
48
- Requires-Dist: rich<14.0.0,>=13.3.0
50
+ Requires-Dist: rich==14.3.1
49
51
  Requires-Dist: ruamel-yaml<0.18.0,>=0.17.22
50
52
  Requires-Dist: semver~=3.0
51
53
  Requires-Dist: sendgrid<6.5.0,>=6.4.8
@@ -8,7 +8,7 @@ reconcile/aws_iam_password_reset.py,sha256=5oajSspJVAvpGd445hKsxtEGYb75dM4l1_PJT
8
8
  reconcile/aws_support_cases_sos.py,sha256=G9g0oM6ohvuJ5N592ePjiPeaDug4_vapAy58RyG-S3Y,3478
9
9
  reconcile/blackbox_exporter_endpoint_monitoring.py,sha256=O1wFp52EyF538c6txaWBs8eMtUIy19gyHZ6VzJ6QXS8,3512
10
10
  reconcile/checkpoint.py,sha256=Q5Ru36ZEwWw95ZkUXBf4VfvCmqDS9TcAF7QVroOf9Vk,5375
11
- reconcile/cli.py,sha256=ZHOM3LPTUyKJy-N7p9OSyrJsb8pWGCsUFthBvJgjUkE,115887
11
+ reconcile/cli.py,sha256=bGWl826ucs0KOwH7DciYJkdZvEV90bqoSlMs36gxgg4,116607
12
12
  reconcile/closedbox_endpoint_monitoring_base.py,sha256=_OKz7K7HHw0-gzxeEma8PcUCtd70pRBy7JMoaAm8IVU,4940
13
13
  reconcile/cluster_deployment_mapper.py,sha256=aKroYLY6-nNxWi2jxDu7VRMuNZ3YgSI0J6ek7Fet2AQ,2241
14
14
  reconcile/dashdotdb_base.py,sha256=83ZWIf5JJk3P_D69y2TmXRcQr6ELJGlv10OM0h7fJVs,4767
@@ -98,6 +98,7 @@ reconcile/service_dependencies.py,sha256=KydjllianL0lUwhroBAPui7jrnhHSq7j2PB6CoV
98
98
  reconcile/signalfx_endpoint_monitoring.py,sha256=Nqgsg1cflSd2nNnm89y_e8c--7xLUqTrKOHkDs-qADE,2868
99
99
  reconcile/slack_base.py,sha256=I-msunWxfgu5bSwXYulGbtLjxUB_tRmTCAUCU-3nabI,3484
100
100
  reconcile/slack_usergroups.py,sha256=C36L64wb95tf2tIqJ8T1xXmREpxHvxbhnglk0QOfUVc,30939
101
+ reconcile/slack_usergroups_api.py,sha256=NnO8Di6tt5yVJG0e-KnHgOOpQq5JhourwCMaMnNEhDw,24862
101
102
  reconcile/sql_query.py,sha256=Go_H36p3YTW4Xv-elYDxW_Fe6Q4ErFhD6eQoFh9Jylw,26424
102
103
  reconcile/status.py,sha256=h73oaSxO5sftEGqFrXVAlySBvNYPWpowDaYYplcky5A,565
103
104
  reconcile/status_board.py,sha256=iv2CR3IsX_uDY5aXHjTOySeTR5d3vsABykYNiYNjZew,15316
@@ -289,6 +290,7 @@ reconcile/gql_definitions/common/smtp_client_settings.py,sha256=M7yAoK7dJDPv-nmv
289
290
  reconcile/gql_definitions/common/state_aws_account.py,sha256=nworxRE4w2L80eIwTStvmH9vj1ZprLTewnwwZVVXvx4,2191
290
291
  reconcile/gql_definitions/common/users.py,sha256=xyBIIywmpNxzjFVnPEoBq2JOaCiv2nP5-KATI0J2ndE,1683
291
292
  reconcile/gql_definitions/common/users_with_paths.py,sha256=nZVNZA0Z8oy0xCEe15PuX6q1YVQSUVRkr_MUch9798M,2721
293
+ reconcile/gql_definitions/common/vcs.py,sha256=OGHBQoMGGZj0GnpzMTMtomxnJUZbbwzq2xJF__qdh0Q,2315
292
294
  reconcile/gql_definitions/cost_report/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
293
295
  reconcile/gql_definitions/cost_report/app_names.py,sha256=OWCgrG9EAZvjC9lC_sqGwdjThAHcrxME4HGA2vX9dfM,1781
294
296
  reconcile/gql_definitions/cost_report/cost_namespaces.py,sha256=UptiwccN0l-z2t_zU62WEymg0wHlRouKRoJk-u-6II4,2281
@@ -403,6 +405,11 @@ reconcile/gql_definitions/slack_usergroups/__init__.py,sha256=47DEQpj8HBSa-_TImW
403
405
  reconcile/gql_definitions/slack_usergroups/clusters.py,sha256=O1XNASxsW5S57nsn0Y-y2533tlLTFaiIMKXtyFlpyXY,2114
404
406
  reconcile/gql_definitions/slack_usergroups/permissions.py,sha256=TPeOLm2Uy-L-Pejyk1TADZT9cmc1yC0KrTGzBlnK8UM,5443
405
407
  reconcile/gql_definitions/slack_usergroups/users.py,sha256=XMrZ4c_Mnnzq-JkIblrq91D-1-1TQua9kDuzeP4z9Ps,2875
408
+ reconcile/gql_definitions/slack_usergroups_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
409
+ reconcile/gql_definitions/slack_usergroups_api/clusters.py,sha256=lYTelX3xdklam8hsUfZuCE41LcwJIhlhLDj0jsRSy58,2129
410
+ reconcile/gql_definitions/slack_usergroups_api/permissions.py,sha256=uX7_aSXQghw1eekr7E2U_NBRZbTxIqCSXJmzfTM4OSY,4722
411
+ reconcile/gql_definitions/slack_usergroups_api/roles.py,sha256=a41pFZbF1-50M8uzib8eyI2rWUC7ke85gJ9jCiXBlI0,3694
412
+ reconcile/gql_definitions/slack_usergroups_api/users.py,sha256=8zL6qLgwiHtLJQ4X60AkTUBX68x_h5E5Fdmfb4skNlI,3002
406
413
  reconcile/gql_definitions/slo_documents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
407
414
  reconcile/gql_definitions/slo_documents/slo_documents.py,sha256=SZg-K5ShF3uFWuKWJwHX2W6ZOP8tcqEcWULrc491rVE,3741
408
415
  reconcile/gql_definitions/status_board/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -578,6 +585,7 @@ reconcile/typed_queries/unleash.py,sha256=7HDc4owF044xM9Thx4WsXV7DZgETxJjy4lbpwm
578
585
  reconcile/typed_queries/users.py,sha256=UXlaxeZAoNIugMEndfcjbkHYowUURE72aWcdmxfb3yk,377
579
586
  reconcile/typed_queries/users_with_paths.py,sha256=lvW0QzTJtKkLS2O_Jm9_0mFXJFKvGlZE809LI-5ddvc,342
580
587
  reconcile/typed_queries/vault.py,sha256=lkRsmobykorof3fcrIPLz-NgvAiSOWSOZc_jXBlnl1w,274
588
+ reconcile/typed_queries/vcs.py,sha256=a0XHygp1H3n-Eb4yWyCMHGyrfdciIczMB7DOwg-0rgc,1077
581
589
  reconcile/typed_queries/app_interface_metrics_exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
582
590
  reconcile/typed_queries/app_interface_metrics_exporter/onboarding_status.py,sha256=X-N1WJGOL6OR9940P0_K4-YJzkL5Vg4favhYrBxXD9A,327
583
591
  reconcile/typed_queries/app_interface_metrics_exporter/terraform_repo.py,sha256=r-nJ5CucAOE_cwxnbVp5lmAAfHBG8t1h2tVmhviVYls,290
@@ -756,9 +764,9 @@ reconcile/utils/rosa/session.py,sha256=o7RCTazHRQbDOC_E89qYaQBiHIoj4mfcCjC6ndlA8
756
764
  reconcile/utils/runtime/__init__.py,sha256=sfk92MGfsBh9tKYHl_FH17NdEsrGBwgDFTb7KNKoIfY,107
757
765
  reconcile/utils/runtime/desired_state_diff.py,sha256=Bw4zqel-klXCMZGqD1gyh8zkFq4h5qzv8rJn7K6WTXs,8132
758
766
  reconcile/utils/runtime/environment.py,sha256=h-CFKLK1qRl_gfOVIUwjqVNOmukIPzUG7AiqpJGrjHA,2038
759
- reconcile/utils/runtime/integration.py,sha256=6Dhx30J6kS1CTztVp7LP_V8TryJvidi8YAUuJaATNFA,10968
767
+ reconcile/utils/runtime/integration.py,sha256=ZvaRX6huhPqlX4wX2GHVwIdoi5kJgdhXMLLlgtyrYnU,14634
760
768
  reconcile/utils/runtime/meta.py,sha256=M_EOxrb0KhQA4TwpHekbog2jOZqaBPVTIijXyRuMjn0,255
761
- reconcile/utils/runtime/runner.py,sha256=Mi3qCwCe_WJZLJLdTWzD8FGbkN3zUfxU9uuiCVyarww,7938
769
+ reconcile/utils/runtime/runner.py,sha256=p7xCT1IDlDz6wKYMDMPOTEdztM4hbcxo0fw9gQf4q-A,9028
762
770
  reconcile/utils/runtime/sharding.py,sha256=r0ieUtNed7NvknSw6qQrCkKpVXE1shuHGnfFcnpA_k4,16142
763
771
  reconcile/utils/saasherder/__init__.py,sha256=3U8plqMAPRE1kjwZ5YnIsYsggTf4_gS7flRUEuXVBAs,343
764
772
  reconcile/utils/saasherder/interfaces.py,sha256=T-V6EQhzpKj0OAgnGAuAOWtKPa35UtMDuXcgnQs8Vd8,9413
@@ -809,7 +817,7 @@ tools/saas_promotion_state/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
809
817
  tools/saas_promotion_state/saas_promotion_state.py,sha256=uQv2QJAmUXP1g2GPIH30WTlvL9soY6m9lefpZEVDM5w,3965
810
818
  tools/sre_checkpoints/__init__.py,sha256=CDaDaywJnmRCLyl_NCcvxi-Zc0hTi_3OdwKiFOyS39I,145
811
819
  tools/sre_checkpoints/util.py,sha256=KcYVfa3UmJHVP_ocgrKe8NkrO5IDB9aWEDydSokPcRk,975
812
- qontract_reconcile-0.10.2.dev485.dist-info/METADATA,sha256=O8j7Xv0e0wviHqcNSOPnqpyCfuJPmdOjKoX5i3s36ik,24901
813
- qontract_reconcile-0.10.2.dev485.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
814
- qontract_reconcile-0.10.2.dev485.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
815
- qontract_reconcile-0.10.2.dev485.dist-info/RECORD,,
820
+ qontract_reconcile-0.10.2.dev494.dist-info/METADATA,sha256=xxqvM_0zadG_Fig-e0YGORv1y6FlgF1ClqiqKML8LbM,24958
821
+ qontract_reconcile-0.10.2.dev494.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
822
+ qontract_reconcile-0.10.2.dev494.dist-info/entry_points.txt,sha256=5i9l54La3vQrDLAdwDKQWC0iG4sV9RRfOb1BpvzOWLc,698
823
+ qontract_reconcile-0.10.2.dev494.dist-info/RECORD,,
reconcile/cli.py CHANGED
@@ -38,6 +38,7 @@ from reconcile.utils.runtime.integration import (
38
38
  ModuleBasedQontractReconcileIntegration,
39
39
  NoParams,
40
40
  PydanticRunParams,
41
+ QontractReconcileApiIntegration,
41
42
  QontractReconcileIntegration,
42
43
  )
43
44
  from reconcile.utils.runtime.meta import IntegrationMeta
@@ -563,7 +564,7 @@ def run_integration(
563
564
 
564
565
 
565
566
  def run_class_integration(
566
- integration: QontractReconcileIntegration,
567
+ integration: QontractReconcileIntegration | QontractReconcileApiIntegration,
567
568
  ctx: click.Context,
568
569
  ) -> None:
569
570
  register_faulthandler()
@@ -1240,6 +1241,29 @@ def slack_usergroups(
1240
1241
  )
1241
1242
 
1242
1243
 
1244
+ @integration.command(short_help="Manage Slack User Groups (channels and users).")
1245
+ @workspace_name
1246
+ @usergroup_name
1247
+ @click.pass_context
1248
+ def slack_usergroups_api(
1249
+ ctx: click.Context, workspace_name: str | None, usergroup_name: str | None
1250
+ ) -> None:
1251
+ from reconcile.slack_usergroups_api import (
1252
+ SlackUsergroupsIntegration,
1253
+ SlackUsergroupsIntegrationParams,
1254
+ )
1255
+
1256
+ run_class_integration(
1257
+ integration=SlackUsergroupsIntegration(
1258
+ SlackUsergroupsIntegrationParams(
1259
+ workspace_name=workspace_name,
1260
+ usergroup_name=usergroup_name,
1261
+ )
1262
+ ),
1263
+ ctx=ctx,
1264
+ )
1265
+
1266
+
1243
1267
  @integration.command(short_help="Manage permissions on GitLab projects.")
1244
1268
  @threaded()
1245
1269
  @click.pass_context
@@ -0,0 +1,91 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v2. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ ConfigDict,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+ from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
21
+
22
+
23
+ DEFINITION = """
24
+ fragment VaultSecret on VaultSecret_v1 {
25
+ path
26
+ field
27
+ version
28
+ format
29
+ }
30
+
31
+ query Vcs {
32
+ gh_orgs: githuborg_v1 {
33
+ name
34
+ url
35
+ default
36
+ token {
37
+ ...VaultSecret
38
+ }
39
+ }
40
+ gl_instances: gitlabinstance_v1 {
41
+ name
42
+ url
43
+ token {
44
+ ...VaultSecret
45
+ }
46
+ }
47
+ }
48
+ """
49
+
50
+
51
+ class ConfiguredBaseModel(BaseModel):
52
+ model_config = ConfigDict(
53
+ extra='forbid'
54
+ )
55
+
56
+
57
+ class GithubOrgV1(ConfiguredBaseModel):
58
+ name: str = Field(..., alias="name")
59
+ url: str = Field(..., alias="url")
60
+ default: Optional[bool] = Field(..., alias="default")
61
+ token: VaultSecret = Field(..., alias="token")
62
+
63
+
64
+ class GitlabInstanceV1(ConfiguredBaseModel):
65
+ name: str = Field(..., alias="name")
66
+ url: str = Field(..., alias="url")
67
+ token: VaultSecret = Field(..., alias="token")
68
+
69
+
70
+ class VcsQueryData(ConfiguredBaseModel):
71
+ gh_orgs: Optional[list[GithubOrgV1]] = Field(..., alias="gh_orgs")
72
+ gl_instances: Optional[list[GitlabInstanceV1]] = Field(..., alias="gl_instances")
73
+
74
+
75
+ def query(query_func: Callable, **kwargs: Any) -> VcsQueryData:
76
+ """
77
+ This is a convenience function which queries and parses the data into
78
+ concrete types. It should be compatible with most GQL clients.
79
+ You do not have to use it to consume the generated data classes.
80
+ Alternatively, you can also mime and alternate the behavior
81
+ of this function in the caller.
82
+
83
+ Parameters:
84
+ query_func (Callable): Function which queries your GQL Server
85
+ kwargs: optional arguments that will be passed to the query function
86
+
87
+ Returns:
88
+ VcsQueryData: queried data parsed into generated classes
89
+ """
90
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
91
+ return VcsQueryData(**raw_data)
@@ -0,0 +1,76 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v2. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ ConfigDict,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+
21
+ DEFINITION = """
22
+ query SlackUsergroupApiCluster {
23
+ clusters: clusters_v1 {
24
+ name
25
+ auth {
26
+ service
27
+ }
28
+ disable {
29
+ integrations
30
+ }
31
+ }
32
+ }
33
+ """
34
+
35
+
36
+ class ConfiguredBaseModel(BaseModel):
37
+ model_config = ConfigDict(
38
+ extra='forbid'
39
+ )
40
+
41
+
42
+ class ClusterAuthV1(ConfiguredBaseModel):
43
+ service: str = Field(..., alias="service")
44
+
45
+
46
+ class DisableClusterAutomationsV1(ConfiguredBaseModel):
47
+ integrations: Optional[list[str]] = Field(..., alias="integrations")
48
+
49
+
50
+ class ClusterV1(ConfiguredBaseModel):
51
+ name: str = Field(..., alias="name")
52
+ auth: list[ClusterAuthV1] = Field(..., alias="auth")
53
+ disable: Optional[DisableClusterAutomationsV1] = Field(..., alias="disable")
54
+
55
+
56
+ class SlackUsergroupApiClusterQueryData(ConfiguredBaseModel):
57
+ clusters: Optional[list[ClusterV1]] = Field(..., alias="clusters")
58
+
59
+
60
+ def query(query_func: Callable, **kwargs: Any) -> SlackUsergroupApiClusterQueryData:
61
+ """
62
+ This is a convenience function which queries and parses the data into
63
+ concrete types. It should be compatible with most GQL clients.
64
+ You do not have to use it to consume the generated data classes.
65
+ Alternatively, you can also mime and alternate the behavior
66
+ of this function in the caller.
67
+
68
+ Parameters:
69
+ query_func (Callable): Function which queries your GQL Server
70
+ kwargs: optional arguments that will be passed to the query function
71
+
72
+ Returns:
73
+ SlackUsergroupApiClusterQueryData: queried data parsed into generated classes
74
+ """
75
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
76
+ return SlackUsergroupApiClusterQueryData(**raw_data)
@@ -0,0 +1,173 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v2. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ ConfigDict,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+ from reconcile.gql_definitions.fragments.user import User
21
+ from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
22
+
23
+
24
+ DEFINITION = """
25
+ fragment User on User_v1 {
26
+ name
27
+ org_username
28
+ github_username
29
+ pagerduty_username
30
+ tag_on_merge_requests
31
+ }
32
+
33
+ fragment VaultSecret on VaultSecret_v1 {
34
+ path
35
+ field
36
+ version
37
+ format
38
+ }
39
+
40
+ query SlackUsergroupApiPermission {
41
+ permissions: permissions_v1 {
42
+ service
43
+ ... on PermissionSlackUsergroup_v1 {
44
+ name
45
+ channels
46
+ description
47
+ handle
48
+ ownersFromRepos
49
+ skip
50
+ pagerduty {
51
+ name
52
+ instance {
53
+ token {
54
+ ...VaultSecret
55
+ }
56
+ }
57
+ scheduleID
58
+ escalationPolicyID
59
+ }
60
+ roles {
61
+ users {
62
+ ...User
63
+ }
64
+ }
65
+ schedule {
66
+ schedule {
67
+ start
68
+ end
69
+ users {
70
+ ...User
71
+ }
72
+ }
73
+ }
74
+ workspace {
75
+ path
76
+ name
77
+ integrations {
78
+ name
79
+ token {
80
+ ...VaultSecret
81
+ }
82
+ channel
83
+ }
84
+ managedUsergroups
85
+ }
86
+ }
87
+ }
88
+ }
89
+ """
90
+
91
+
92
+ class ConfiguredBaseModel(BaseModel):
93
+ model_config = ConfigDict(
94
+ extra='forbid'
95
+ )
96
+
97
+
98
+ class PermissionV1(ConfiguredBaseModel):
99
+ service: str = Field(..., alias="service")
100
+
101
+
102
+ class PagerDutyInstanceV1(ConfiguredBaseModel):
103
+ token: VaultSecret = Field(..., alias="token")
104
+
105
+
106
+ class PagerDutyTargetV1(ConfiguredBaseModel):
107
+ name: str = Field(..., alias="name")
108
+ instance: PagerDutyInstanceV1 = Field(..., alias="instance")
109
+ schedule_id: Optional[str] = Field(..., alias="scheduleID")
110
+ escalation_policy_id: Optional[str] = Field(..., alias="escalationPolicyID")
111
+
112
+
113
+ class RoleV1(ConfiguredBaseModel):
114
+ users: list[User] = Field(..., alias="users")
115
+
116
+
117
+ class ScheduleEntryV1(ConfiguredBaseModel):
118
+ start: str = Field(..., alias="start")
119
+ end: str = Field(..., alias="end")
120
+ users: list[User] = Field(..., alias="users")
121
+
122
+
123
+ class ScheduleV1(ConfiguredBaseModel):
124
+ schedule: list[ScheduleEntryV1] = Field(..., alias="schedule")
125
+
126
+
127
+ class SlackWorkspaceIntegrationV1(ConfiguredBaseModel):
128
+ name: str = Field(..., alias="name")
129
+ token: VaultSecret = Field(..., alias="token")
130
+ channel: str = Field(..., alias="channel")
131
+
132
+
133
+ class SlackWorkspaceV1(ConfiguredBaseModel):
134
+ path: str = Field(..., alias="path")
135
+ name: str = Field(..., alias="name")
136
+ integrations: Optional[list[SlackWorkspaceIntegrationV1]] = Field(..., alias="integrations")
137
+ managed_usergroups: list[str] = Field(..., alias="managedUsergroups")
138
+
139
+
140
+ class PermissionSlackUsergroupV1(PermissionV1):
141
+ name: str = Field(..., alias="name")
142
+ channels: list[str] = Field(..., alias="channels")
143
+ description: str = Field(..., alias="description")
144
+ handle: str = Field(..., alias="handle")
145
+ owners_from_repos: Optional[list[str]] = Field(..., alias="ownersFromRepos")
146
+ skip: Optional[bool] = Field(..., alias="skip")
147
+ pagerduty: Optional[list[PagerDutyTargetV1]] = Field(..., alias="pagerduty")
148
+ roles: Optional[list[RoleV1]] = Field(..., alias="roles")
149
+ schedule: Optional[ScheduleV1] = Field(..., alias="schedule")
150
+ workspace: SlackWorkspaceV1 = Field(..., alias="workspace")
151
+
152
+
153
+ class SlackUsergroupApiPermissionQueryData(ConfiguredBaseModel):
154
+ permissions: list[Union[PermissionSlackUsergroupV1, PermissionV1]] = Field(..., alias="permissions")
155
+
156
+
157
+ def query(query_func: Callable, **kwargs: Any) -> SlackUsergroupApiPermissionQueryData:
158
+ """
159
+ This is a convenience function which queries and parses the data into
160
+ concrete types. It should be compatible with most GQL clients.
161
+ You do not have to use it to consume the generated data classes.
162
+ Alternatively, you can also mime and alternate the behavior
163
+ of this function in the caller.
164
+
165
+ Parameters:
166
+ query_func (Callable): Function which queries your GQL Server
167
+ kwargs: optional arguments that will be passed to the query function
168
+
169
+ Returns:
170
+ SlackUsergroupApiPermissionQueryData: queried data parsed into generated classes
171
+ """
172
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
173
+ return SlackUsergroupApiPermissionQueryData(**raw_data)
@@ -0,0 +1,135 @@
1
+ """
2
+ Generated by qenerate plugin=pydantic_v2. DO NOT MODIFY MANUALLY!
3
+ """
4
+ from collections.abc import Callable # noqa: F401 # pylint: disable=W0611
5
+ from datetime import datetime # noqa: F401 # pylint: disable=W0611
6
+ from enum import Enum # noqa: F401 # pylint: disable=W0611
7
+ from typing import ( # noqa: F401 # pylint: disable=W0611
8
+ Any,
9
+ Optional,
10
+ Union,
11
+ )
12
+
13
+ from pydantic import ( # noqa: F401 # pylint: disable=W0611
14
+ BaseModel,
15
+ ConfigDict,
16
+ Field,
17
+ Json,
18
+ )
19
+
20
+ from reconcile.gql_definitions.fragments.user import User
21
+
22
+
23
+ DEFINITION = """
24
+ fragment User on User_v1 {
25
+ name
26
+ org_username
27
+ github_username
28
+ pagerduty_username
29
+ tag_on_merge_requests
30
+ }
31
+
32
+ query SlackUsergroupsApiRoles {
33
+ roles: roles_v1 {
34
+ name
35
+ access {
36
+ cluster {
37
+ auth {
38
+ service
39
+ }
40
+ name
41
+ }
42
+ group
43
+ namespace {
44
+ cluster {
45
+ name
46
+ auth {
47
+ service
48
+ }
49
+ }
50
+ delete
51
+ managedRoles
52
+ }
53
+ }
54
+ expirationDate
55
+ users {
56
+ ...User
57
+ tag_on_cluster_updates
58
+ tag_on_merge_requests
59
+ }
60
+ tag_on_cluster_updates
61
+ }
62
+ }
63
+ """
64
+
65
+
66
+ class ConfiguredBaseModel(BaseModel):
67
+ model_config = ConfigDict(
68
+ extra='forbid'
69
+ )
70
+
71
+
72
+ class ClusterAuthV1(ConfiguredBaseModel):
73
+ service: str = Field(..., alias="service")
74
+
75
+
76
+ class ClusterV1(ConfiguredBaseModel):
77
+ auth: list[ClusterAuthV1] = Field(..., alias="auth")
78
+ name: str = Field(..., alias="name")
79
+
80
+
81
+ class NamespaceV1_ClusterV1_ClusterAuthV1(ConfiguredBaseModel):
82
+ service: str = Field(..., alias="service")
83
+
84
+
85
+ class NamespaceV1_ClusterV1(ConfiguredBaseModel):
86
+ name: str = Field(..., alias="name")
87
+ auth: list[NamespaceV1_ClusterV1_ClusterAuthV1] = Field(..., alias="auth")
88
+
89
+
90
+ class NamespaceV1(ConfiguredBaseModel):
91
+ cluster: NamespaceV1_ClusterV1 = Field(..., alias="cluster")
92
+ delete: Optional[bool] = Field(..., alias="delete")
93
+ managed_roles: Optional[bool] = Field(..., alias="managedRoles")
94
+
95
+
96
+ class AccessV1(ConfiguredBaseModel):
97
+ cluster: Optional[ClusterV1] = Field(..., alias="cluster")
98
+ group: Optional[str] = Field(..., alias="group")
99
+ namespace: Optional[NamespaceV1] = Field(..., alias="namespace")
100
+
101
+
102
+ class UserV1(User):
103
+ tag_on_cluster_updates: Optional[bool] = Field(..., alias="tag_on_cluster_updates")
104
+ tag_on_merge_requests: Optional[bool] = Field(..., alias="tag_on_merge_requests")
105
+
106
+
107
+ class RoleV1(ConfiguredBaseModel):
108
+ name: str = Field(..., alias="name")
109
+ access: Optional[list[AccessV1]] = Field(..., alias="access")
110
+ expiration_date: Optional[str] = Field(..., alias="expirationDate")
111
+ users: list[UserV1] = Field(..., alias="users")
112
+ tag_on_cluster_updates: Optional[bool] = Field(..., alias="tag_on_cluster_updates")
113
+
114
+
115
+ class SlackUsergroupsApiRolesQueryData(ConfiguredBaseModel):
116
+ roles: Optional[list[RoleV1]] = Field(..., alias="roles")
117
+
118
+
119
+ def query(query_func: Callable, **kwargs: Any) -> SlackUsergroupsApiRolesQueryData:
120
+ """
121
+ This is a convenience function which queries and parses the data into
122
+ concrete types. It should be compatible with most GQL clients.
123
+ You do not have to use it to consume the generated data classes.
124
+ Alternatively, you can also mime and alternate the behavior
125
+ of this function in the caller.
126
+
127
+ Parameters:
128
+ query_func (Callable): Function which queries your GQL Server
129
+ kwargs: optional arguments that will be passed to the query function
130
+
131
+ Returns:
132
+ SlackUsergroupsApiRolesQueryData: queried data parsed into generated classes
133
+ """
134
+ raw_data: dict[Any, Any] = query_func(DEFINITION, **kwargs)
135
+ return SlackUsergroupsApiRolesQueryData(**raw_data)