pub struct GitHubProjectsSource { /* private fields */ }Expand description
A source which reads GitHub afresh for every operation.
Implementations§
Source§impl GitHubProjectsSource
impl GitHubProjectsSource
Sourcepub async fn status_options(
&self,
mode: StatusOptionsMode,
) -> Result<StatusOptionsReport, SourceError>
pub async fn status_options( &self, mode: StatusOptionsMode, ) -> Result<StatusOptionsReport, SourceError>
Report missing configured Status options and, when apply is true, add them with
a whole-list mutation that preserves every existing id and verifies the result.
§Errors
Refuses a board without a single-select Status field. A post-write difference in
any pre-existing option id or item assignment is refused with the complete pre-write
assignment snapshot in the diagnostic for recovery.
Sourcepub fn new(
name: &SourceName,
config: GitHubProjectsConfig,
secrets: &dyn SecretResolver,
) -> Result<Self, SourceError>
pub fn new( name: &SourceName, config: GitHubProjectsConfig, secrets: &dyn SecretResolver, ) -> Result<Self, SourceError>
Validate configuration and capture the named credential without exposing it.
§Errors
Returns SourceError::Config for a configuration this instance cannot use and
SourceError::Auth when the named credential is missing or empty.
Sourcepub fn recording_into(
name: &SourceName,
config: GitHubProjectsConfig,
secrets: &dyn SecretResolver,
ledger: Arc<Accounting>,
) -> Result<Self, SourceError>
pub fn recording_into( name: &SourceName, config: GitHubProjectsConfig, secrets: &dyn SecretResolver, ledger: Arc<Accounting>, ) -> Result<Self, SourceError>
The same, recording every request it sends into an accounting the caller holds too.
Self::new is this with an accounting of its own. A caller that is also making
its own calls to GitHub — a lane verifying a schema, sweeping residue or cleaning
up — passes the one it records those into, so the session total accounts for the
whole session rather than for this source’s share of it.
§Errors
Exactly Self::new’s: SourceError::Config for a configuration this instance
cannot use and SourceError::Auth when the named credential is missing or empty.
Sourcepub fn accounting(&self) -> Session
pub fn accounting(&self) -> Session
A snapshot of every request this source has sent, and what each cost.
A value to hold and compare rather than a borrow of the accounting itself, so two
of them can sit side by side. When this source was built with
Self::recording_into the snapshot is the whole shared session, which is the
point of building it that way.
Trait Implementations§
Source§impl TaskSource for GitHubProjectsSource
impl TaskSource for GitHubProjectsSource
Source§fn write_task<'life0, 'life1, 'async_trait>(
&'life0 self,
write: &'life1 ItemWrite<Task>,
) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_task<'life0, 'life1, 'async_trait>(
&'life0 self,
write: &'life1 ItemWrite<Task>,
) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create or update one task.
Its delivers and delivered_by are checked before anything is read or written —
neither may name the task itself or name one task twice — and land in the body’s
metadata slot under their reserved keys, in place of any caller metadata of those
names.
Source§fn write_document<'life0, 'life1, 'async_trait>(
&'life0 self,
write: &'life1 ItemWrite<Document>,
) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_document<'life0, 'life1, 'async_trait>(
&'life0 self,
write: &'life1 ItemWrite<Document>,
) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create or update one document, which is one issue titled the way this board spells a document.
Everything else is exactly a task write: caller metadata goes to the same canonical JSON slot at the end of the body and comes back with its JSON types intact, a key or a field this board cannot carry is refused by name rather than dropped, a target naming an issue this board does not hold is refused rather than created, and an issue this call created is taken back when the rest of the write fails.
Source§fn set_task_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
category: StatusCategory,
) -> Pin<Box<dyn Future<Output = Result<Option<Status>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_task_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
category: StatusCategory,
) -> Pin<Box<dyn Future<Output = Result<Option<Status>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Set one task’s status alone.
An open target reopens a closed issue with an updateIssue carrying only its
stateInput, then selects the board option with updateProjectV2ItemFieldValue; a
terminal target selects its mapped option, then closes with its fixed reason. No
request carries a title, a body or a label. The status
answered is what [StatusMapping::status] reads off the state just written, which is
what a re-read reports.
Source§fn set_delivered_by<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
delivered_by: &'life2 [TaskRef],
) -> Pin<Box<dyn Future<Output = Result<Option<()>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_delivered_by<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
delivered_by: &'life2 [TaskRef],
) -> Pin<Box<dyn Future<Output = Result<Option<()>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Replace one task’s delivered_by with a single body update that changes the
metadata slot and nothing outside it.
Source§fn set_task_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
key: &'life2 MetadataKey,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_task_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
key: &'life2 MetadataKey,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set one key of one task issue’s metadata with a single body update that changes the metadata slot and nothing outside it — no title, label, state or board field request — and sends nothing when the task already holds that value under the key.
Source§fn set_project_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
key: &'life2 MetadataKey,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_project_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
key: &'life2 MetadataKey,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set one key of one project issue’s metadata, on exactly the terms of
set_task_metadata.
Source§fn set_document_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
key: &'life2 MetadataKey,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_document_metadata<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
key: &'life2 MetadataKey,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set one key of one design-document issue’s metadata, on exactly the terms of
set_task_metadata.
Source§fn task_comments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<Page<Comment>>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn task_comments<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<Page<Comment>>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
One page of the task issue’s own comments, walked by GitHub’s own cursor.
Nothing here filters, so nothing has to be read ahead of the page: the caller’s limit is
the page GitHub is asked for and GitHub’s endCursor is the cursor handed back.
Source§fn add_comment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
comment: &'life2 NewComment,
) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_comment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
comment: &'life2 NewComment,
) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Add one comment to the task’s issue, as the account the token belongs to.
The author is refused before anything is sent — not even the task is read — because no answer GitHub could give would make posting under another name than the one asked for the right outcome.
Source§fn metering<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Metering>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn metering<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Metering>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Every request this source has recorded, and what each of GitHub’s two budgets was attributed — read off the same accounting the session report is rendered from, so the two cannot count one request two ways.
Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Source§fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Health, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Health, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Task>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
None when there is no such task. Read moreSource§fn get_project<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_project<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Project>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
None when there is no such project. Read moreSource§fn query_tasks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 TaskQuery,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Task>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_tasks<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 TaskQuery,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Task>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
query. Read moreSource§fn query_projects<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 ProjectQuery,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Project>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_projects<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 ProjectQuery,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Project>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
query. Read moreSource§fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<Document>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
None when there is no such document. Read moreSource§fn query_documents<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 DocumentQuery,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Document>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_documents<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 DocumentQuery,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Document>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
query. Read moreSource§fn labels<'life0, 'life1, 'async_trait>(
&'life0 self,
page: &'life1 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Label>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn labels<'life0, 'life1, 'async_trait>(
&'life0 self,
page: &'life1 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<Label>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn task_dependencies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
direction: Direction,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn task_dependencies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
direction: Direction,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn project_dependencies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
direction: Direction,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn project_dependencies<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
direction: Direction,
page: &'life2 PageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<DependencyEdge>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn writes(&self) -> WriteSupport
fn writes(&self) -> WriteSupport
Source§fn write_project<'life0, 'life1, 'async_trait>(
&'life0 self,
write: &'life1 ItemWrite<Project>,
) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_project<'life0, 'life1, 'async_trait>(
&'life0 self,
write: &'life1 ItemWrite<Project>,
) -> Pin<Box<dyn Future<Output = Result<NativeId, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
write_task. Read moreSource§fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_task<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn delete_project<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_project<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
delete_task. Read moreSource§fn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 NativeId,
) -> Pin<Box<dyn Future<Output = Result<(), SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
delete_task. Read moreSource§fn edit_comment<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
comment: &'life2 NativeId,
body: &'life3 CommentBody,
) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn edit_comment<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
comment: &'life2 NativeId,
body: &'life3 CommentBody,
) -> Pin<Box<dyn Future<Output = Result<Option<Comment>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
comment on task, answering with the comment as the
source now holds it, or None when this source holds no such task or that task has no
such comment. Read moreSource§fn delete_comment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
comment: &'life2 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<NativeId>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_comment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task: &'life1 NativeId,
comment: &'life2 NativeId,
) -> Pin<Box<dyn Future<Output = Result<Option<NativeId>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
comment from task, answering with the id it removed, or None
when this source holds no such task or that task has no such comment. Read more