Skip to content

Commit

Permalink
refactor: rename Contents to ContentResources
Browse files Browse the repository at this point in the history
  • Loading branch information
tdstein committed Jul 25, 2024
1 parent a8af5b3 commit df7d39d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/posit/connect/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/posit/connect/content/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 4 additions & 2 deletions src/posit/connect/content/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
8 changes: 5 additions & 3 deletions src/posit/connect/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit df7d39d

Please sign in to comment.