Skip to content

Add function to get content associated with an integration #433

@toph-allen

Description

@toph-allen

Recipe: Finding Content Associated with an Integration

Add a function that takes an integration and returns a list of content items it's associated with.

It would be nice to be able to write:

client <- connect()
integrations <- get_integrations(client)
github_integration <- integrations[1]
get_content(github_integration)

To accomplish that, we'd have to do two things:

  1. Add the Connect client object. Nice to do it as an attribute maybe. Easy.
  2. Uh… a function named get_content() already exists, with a very specific signature that kinda precludes doing something like get_content(x). The first argument is named src.

Ways forward:

  • Switch to method dispatch for get_content() but keep the weird name of the first argument src. People will mostly write get_content(integration) anyway.
  • Eat the pain of changing the name of the first argument to get_content() now. Most people don't pass in the client with a name, I would guess. Use method dispatch.
  • Name this function something like get_content_by_integration(). At a later date, make the painful breaking change in get_content(). (Maybe at a point when we're making more breaking changes?)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions