Skip to content

Commit ae20363

Browse files
authored
Use moved iam.policy now at google.api_core.iam.policy (#6741)
* update references to iam to use api-core\ * Update dependency to api_core
1 parent a992d3f commit ae20363

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

packages/google-cloud-storage/google/cloud/storage/blob.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
from google.cloud._helpers import _to_bytes
5252
from google.cloud._helpers import _bytes_to_unicode
5353
from google.cloud.exceptions import NotFound
54-
from google.cloud.iam import Policy
54+
from google.api_core.iam import Policy
5555
from google.cloud.storage._helpers import _PropertyMixin
5656
from google.cloud.storage._helpers import _scalar_property
5757
from google.cloud.storage._signing import generate_signed_url
@@ -1293,7 +1293,7 @@ def get_iam_policy(self, client=None):
12931293
:param client: Optional. The client to use. If not passed, falls back
12941294
to the ``client`` stored on the current object's bucket.
12951295
1296-
:rtype: :class:`google.cloud.iam.Policy`
1296+
:rtype: :class:`google.api_core.iam.Policy`
12971297
:returns: the policy instance, based on the resource returned from
12981298
the ``getIamPolicy`` API request.
12991299
"""
@@ -1326,15 +1326,15 @@ def set_iam_policy(self, policy, client=None):
13261326
If :attr:`user_project` is set on the bucket, bills the API request
13271327
to that project.
13281328
1329-
:type policy: :class:`google.cloud.iam.Policy`
1329+
:type policy: :class:`google.api_core.iam.Policy`
13301330
:param policy: policy instance used to update bucket's IAM policy.
13311331
13321332
:type client: :class:`~google.cloud.storage.client.Client` or
13331333
``NoneType``
13341334
:param client: Optional. The client to use. If not passed, falls back
13351335
to the ``client`` stored on the current bucket.
13361336
1337-
:rtype: :class:`google.cloud.iam.Policy`
1337+
:rtype: :class:`google.api_core.iam.Policy`
13381338
:returns: the policy instance, based on the resource returned from
13391339
the ``setIamPolicy`` API request.
13401340
"""

packages/google-cloud-storage/google/cloud/storage/bucket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from google.cloud._helpers import _NOW
2929
from google.cloud._helpers import _rfc3339_to_datetime
3030
from google.cloud.exceptions import NotFound
31-
from google.cloud.iam import Policy
31+
from google.api_core.iam import Policy
3232
from google.cloud.storage import _signing
3333
from google.cloud.storage._helpers import _PropertyMixin
3434
from google.cloud.storage._helpers import _scalar_property
@@ -1563,7 +1563,7 @@ def get_iam_policy(self, client=None):
15631563
:param client: Optional. The client to use. If not passed, falls back
15641564
to the ``client`` stored on the current bucket.
15651565
1566-
:rtype: :class:`google.cloud.iam.Policy`
1566+
:rtype: :class:`google.api_core.iam.Policy`
15671567
:returns: the policy instance, based on the resource returned from
15681568
the ``getIamPolicy`` API request.
15691569
"""
@@ -1589,15 +1589,15 @@ def set_iam_policy(self, policy, client=None):
15891589
15901590
If :attr:`user_project` is set, bills the API request to that project.
15911591
1592-
:type policy: :class:`google.cloud.iam.Policy`
1592+
:type policy: :class:`google.api_core.iam.Policy`
15931593
:param policy: policy instance used to update bucket's IAM policy.
15941594
15951595
:type client: :class:`~google.cloud.storage.client.Client` or
15961596
``NoneType``
15971597
:param client: Optional. The client to use. If not passed, falls back
15981598
to the ``client`` stored on the current bucket.
15991599
1600-
:rtype: :class:`google.cloud.iam.Policy`
1600+
:rtype: :class:`google.api_core.iam.Policy`
16011601
:returns: the policy instance, based on the resource returned from
16021602
the ``setIamPolicy`` API request.
16031603
"""

packages/google-cloud-storage/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# 'Development Status :: 5 - Production/Stable'
3030
release_status = 'Development Status :: 5 - Production/Stable'
3131
dependencies = [
32-
'google-api-core >= 1.0.0, < 2.0.0dev',
32+
'google-api-core >= 1.6.0, < 2.0.0dev',
3333
'google-cloud-core >= 0.28.0, < 0.29dev',
3434
'google-resumable-media >= 0.3.1',
3535
]

packages/google-cloud-storage/tests/unit/test_blob.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ def test_get_iam_policy(self):
18841884
from google.cloud.storage.iam import STORAGE_OWNER_ROLE
18851885
from google.cloud.storage.iam import STORAGE_EDITOR_ROLE
18861886
from google.cloud.storage.iam import STORAGE_VIEWER_ROLE
1887-
from google.cloud.iam import Policy
1887+
from google.api_core.iam import Policy
18881888

18891889
BLOB_NAME = "blob-name"
18901890
PATH = "/b/name/o/%s" % (BLOB_NAME,)
@@ -1935,7 +1935,7 @@ def test_get_iam_policy(self):
19351935
)
19361936

19371937
def test_get_iam_policy_w_user_project(self):
1938-
from google.cloud.iam import Policy
1938+
from google.api_core.iam import Policy
19391939

19401940
BLOB_NAME = "blob-name"
19411941
USER_PROJECT = "user-project-123"
@@ -1979,7 +1979,7 @@ def test_set_iam_policy(self):
19791979
from google.cloud.storage.iam import STORAGE_OWNER_ROLE
19801980
from google.cloud.storage.iam import STORAGE_EDITOR_ROLE
19811981
from google.cloud.storage.iam import STORAGE_VIEWER_ROLE
1982-
from google.cloud.iam import Policy
1982+
from google.api_core.iam import Policy
19831983

19841984
BLOB_NAME = "blob-name"
19851985
PATH = "/b/name/o/%s" % (BLOB_NAME,)
@@ -2029,7 +2029,7 @@ def test_set_iam_policy(self):
20292029
self.assertEqual(sorted(found["members"]), sorted(expected["members"]))
20302030

20312031
def test_set_iam_policy_w_user_project(self):
2032-
from google.cloud.iam import Policy
2032+
from google.api_core.iam import Policy
20332033

20342034
BLOB_NAME = "blob-name"
20352035
USER_PROJECT = "user-project-123"

packages/google-cloud-storage/tests/unit/test_bucket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ def test_get_iam_policy(self):
16131613
from google.cloud.storage.iam import STORAGE_OWNER_ROLE
16141614
from google.cloud.storage.iam import STORAGE_EDITOR_ROLE
16151615
from google.cloud.storage.iam import STORAGE_VIEWER_ROLE
1616-
from google.cloud.iam import Policy
1616+
from google.api_core.iam import Policy
16171617

16181618
NAME = "name"
16191619
PATH = "/b/%s" % (NAME,)
@@ -1656,7 +1656,7 @@ def test_get_iam_policy(self):
16561656
self.assertEqual(kw[0]["query_params"], {})
16571657

16581658
def test_get_iam_policy_w_user_project(self):
1659-
from google.cloud.iam import Policy
1659+
from google.api_core.iam import Policy
16601660

16611661
NAME = "name"
16621662
USER_PROJECT = "user-project-123"
@@ -1692,7 +1692,7 @@ def test_set_iam_policy(self):
16921692
from google.cloud.storage.iam import STORAGE_OWNER_ROLE
16931693
from google.cloud.storage.iam import STORAGE_EDITOR_ROLE
16941694
from google.cloud.storage.iam import STORAGE_VIEWER_ROLE
1695-
from google.cloud.iam import Policy
1695+
from google.api_core.iam import Policy
16961696

16971697
NAME = "name"
16981698
PATH = "/b/%s" % (NAME,)
@@ -1744,7 +1744,7 @@ def test_set_iam_policy_w_user_project(self):
17441744
from google.cloud.storage.iam import STORAGE_OWNER_ROLE
17451745
from google.cloud.storage.iam import STORAGE_EDITOR_ROLE
17461746
from google.cloud.storage.iam import STORAGE_VIEWER_ROLE
1747-
from google.cloud.iam import Policy
1747+
from google.api_core.iam import Policy
17481748

17491749
NAME = "name"
17501750
USER_PROJECT = "user-project-123"

0 commit comments

Comments
 (0)