``` python
fra google.cloud importlager
def fix_limit_how_often_du_kan_gøre_bestemte_ting(
bucket_name="dit-spand-navn",
):
"""Fixer grænsen for, hvor ofte du kan gøre visse ting, hvis
bucket "fix_limit_how_often_du_can_do_visse_things" findes."""
# bucket_name ="dit-spand-navn"
storage_client =storage.Client()
bucket =storage_client.get_bucket(bucket_name)
hvis ikke bucket.iam_configuration.uniform_bucket_level_access_enabled:
bucket.iam_configuration.uniform_bucket_level_access_enabled =Sandt
bucket.iam_configuration.patch()
trykke(
"Ensartet adgang på bucket-niveau er nu aktiveret for bucket {}".format(
spand_navn
)
)
returspand
hvis bucket.retention_period er Ingen:
bucket.retention_period =3
bucket.retention_effective_time =Ingen
bucket.patch()
trykke(
"Retentionsperiode på 3 dage er nu indstillet for bucket {}".format(
spand_navn
)
)
returspand
```