Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentItem.owner #165

Open
nealrichardson opened this issue Apr 10, 2024 · 4 comments
Open

ContentItem.owner #165

nealrichardson opened this issue Apr 10, 2024 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@nealrichardson
Copy link
Collaborator

Similar to #164 but less complicated because GET v1/content?include=owner always includes the owner.

If owner is not in the item's data, the owner @property should GET v1/users/{owner_guid}, insert the response into the data, and return it.

@tdstein tdstein added the enhancement New feature or request label Apr 18, 2024
@tdstein tdstein added this to the 0.3.0 milestone Apr 26, 2024
@brooklynbagel
Copy link
Contributor

brooklynbagel commented May 2, 2024

Is this for the find method? Maybe this a separate issue, but I noticed the type given for the owner property mismatches with what Connect provides:

owner 🆁: {
  Basic details about the owner of this content item. Included in responses when include=owner is provided.

  guid: uuid
  The user's GUID, or unique identifier, in UUID [RFC4122](https://www.rfc-editor.org/rfc/rfc4122) format

  username: string
  The user's username

  first_name: string
  The user's first name

  last_name: string
  The user's last name example: 'Doe'
}

at the bottom of the page https://docs.posit.co/connect/api/#get-/v1/content

versus:

@property
def owner(self) -> str:
return self.get("owner", {}) # type: ignore

@nealrichardson
Copy link
Collaborator Author

Yeah good catch, I think you're right.

@brooklynbagel
Copy link
Contributor

I think it's a simple fix, I can open a PR and either link to this issue or create a new one.

@nealrichardson
Copy link
Collaborator Author

That would be great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants