From df7d39d0abdac3b945088fb11219cb4894f6de76 Mon Sep 17 00:00:00 2001 From: tdstein Date: Wed, 24 Jul 2024 22:33:48 -0400 Subject: [PATCH] refactor: rename Contents to ContentResources --- src/posit/connect/client.py | 6 +++--- src/posit/connect/content/__init__.py | 4 ++-- src/posit/connect/content/contents.py | 6 ++++-- src/posit/connect/users.py | 8 +++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/posit/connect/client.py b/src/posit/connect/client.py index 9dc410d2..1903e373 100644 --- a/src/posit/connect/client.py +++ b/src/posit/connect/client.py @@ -10,7 +10,7 @@ from .auth import Auth from .config import Config from .oauth import OAuthIntegration -from .content import Contents +from .content import ContentResources from .metrics import Metrics from .tasks import Tasks from .users import User, Users @@ -234,7 +234,7 @@ def users(self) -> Users: return Users(config=self.config, session=self.session) @property - def content(self) -> Contents: + def content(self) -> ContentResources: """ The content resource interface. @@ -243,7 +243,7 @@ def content(self) -> Contents: Content The content resource instance. """ - return Contents(config=self.config, session=self.session) + return ContentResources(config=self.config, session=self.session) @property def metrics(self) -> Metrics: diff --git a/src/posit/connect/content/__init__.py b/src/posit/connect/content/__init__.py index a3eb732b..db5091db 100644 --- a/src/posit/connect/content/__init__.py +++ b/src/posit/connect/content/__init__.py @@ -2,6 +2,6 @@ from .content import Content from .content_owner import ContentOwner -from .contents import Contents +from .contents import ContentResources -__all__ = ["Content", "ContentOwner", "Contents"] +__all__ = ["Content", "ContentOwner", "ContentResources"] diff --git a/src/posit/connect/content/contents.py b/src/posit/connect/content/contents.py index fe82c81f..4a2d1b6e 100644 --- a/src/posit/connect/content/contents.py +++ b/src/posit/connect/content/contents.py @@ -10,8 +10,10 @@ from .content import Content -class Contents(Resources): - """Contents resource. +class ContentResources(Resources): + """Content resources. + + A resource for many pieces of content. Parameters ---------- diff --git a/src/posit/connect/users.py b/src/posit/connect/users.py index 51809c03..db20b267 100644 --- a/src/posit/connect/users.py +++ b/src/posit/connect/users.py @@ -8,7 +8,7 @@ from . import me, urls from .config import Config -from .content import Contents +from .content import ContentResources from .paginator import Paginator from .resources import Resource, Resources @@ -36,8 +36,10 @@ class User(Resource): """ @property - def content(self) -> Contents: - return Contents(self.config, self.session, owner_guid=self.guid) + def content(self) -> ContentResources: + return ContentResources( + self.config, self.session, owner_guid=self.guid + ) @property def guid(self) -> str: