#![allow(clippy::too_many_arguments)]
use super::inputs::*;
use super::queries::*;
use crate::client::Client;
use crate::error::LinearError;
use crate::field_selection::GraphQLFields;
use serde::de::DeserializeOwned;
impl Client {
pub fn workflow_states<T>(&self) -> WorkflowStatesQueryBuilder<'_, T> {
crate::generated::queries::workflow_states(self)
}
pub fn users<T>(&self) -> UsersQueryBuilder<'_, T> {
crate::generated::queries::users(self)
}
pub async fn whoami<T: DeserializeOwned + GraphQLFields<FullType = super::types::User>>(
&self,
) -> Result<T, LinearError> {
crate::generated::queries::whoami::<T>(self).await
}
pub fn projects<T>(&self) -> ProjectsQueryBuilder<'_, T> {
crate::generated::queries::projects(self)
}
pub async fn project<T: DeserializeOwned + GraphQLFields<FullType = super::types::Project>>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::project::<T>(self, id).await
}
pub fn teams<T>(&self) -> TeamsQueryBuilder<'_, T> {
crate::generated::queries::teams(self)
}
pub async fn team<T: DeserializeOwned + GraphQLFields<FullType = super::types::Team>>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::team::<T>(self, id).await
}
pub fn search_issues<T>(&self, term: impl Into<String>) -> SearchIssuesQueryBuilder<'_, T> {
crate::generated::queries::search_issues(self, term)
}
pub fn project_milestones<T>(&self) -> ProjectMilestonesQueryBuilder<'_, T> {
crate::generated::queries::project_milestones(self)
}
pub async fn project_milestone<
T: DeserializeOwned + GraphQLFields<FullType = super::types::ProjectMilestone>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::project_milestone::<T>(self, id).await
}
pub fn issues<T>(&self) -> IssuesQueryBuilder<'_, T> {
crate::generated::queries::issues(self)
}
pub async fn issue<T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::issue::<T>(self, id).await
}
pub async fn issue_vcs_branch_search<
T: DeserializeOwned + GraphQLFields<FullType = super::types::Issue>,
>(
&self,
branch_name: String,
) -> Result<Option<T>, LinearError> {
crate::generated::queries::issue_vcs_branch_search::<T>(self, branch_name).await
}
pub fn issue_relations<T>(&self) -> IssueRelationsQueryBuilder<'_, T> {
crate::generated::queries::issue_relations(self)
}
pub async fn issue_relation<
T: DeserializeOwned + GraphQLFields<FullType = super::types::IssueRelation>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::issue_relation::<T>(self, id).await
}
pub fn issue_labels<T>(&self) -> IssueLabelsQueryBuilder<'_, T> {
crate::generated::queries::issue_labels(self)
}
pub fn documents<T>(&self) -> DocumentsQueryBuilder<'_, T> {
crate::generated::queries::documents(self)
}
pub async fn document<
T: DeserializeOwned + GraphQLFields<FullType = super::types::Document>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::document::<T>(self, id).await
}
pub fn cycles<T>(&self) -> CyclesQueryBuilder<'_, T> {
crate::generated::queries::cycles(self)
}
pub async fn cycle<T: DeserializeOwned + GraphQLFields<FullType = super::types::Cycle>>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::queries::cycle::<T>(self, id).await
}
pub async fn file_upload(
&self,
meta_data: Option<serde_json::Value>,
make_public: Option<bool>,
size: i64,
content_type: String,
filename: String,
) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::file_upload(
self,
meta_data,
make_public,
size,
content_type,
filename,
)
.await
}
pub async fn image_upload_from_url(
&self,
url: String,
) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::image_upload_from_url(self, url).await
}
pub async fn comment_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
&self,
input: CommentCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::comment_create::<T>(self, input).await
}
pub async fn comment_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
&self,
skip_edited_at: Option<bool>,
input: CommentUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::comment_update::<T>(self, skip_edited_at, input, id).await
}
pub async fn comment_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::comment_delete(self, id).await
}
pub async fn comment_resolve<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
&self,
resolving_comment_id: Option<String>,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::comment_resolve::<T>(self, resolving_comment_id, id).await
}
pub async fn comment_unresolve<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Comment>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::comment_unresolve::<T>(self, id).await
}
pub async fn project_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Project>,
>(
&self,
slack_channel_name: Option<String>,
input: ProjectCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::project_create::<T>(self, slack_channel_name, input).await
}
pub async fn project_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Project>,
>(
&self,
input: ProjectUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::project_update::<T>(self, input, id).await
}
pub async fn project_delete<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Project>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::project_delete::<T>(self, id).await
}
pub async fn team_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Team>,
>(
&self,
copy_settings_from_team_id: Option<String>,
input: TeamCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::team_create::<T>(self, copy_settings_from_team_id, input).await
}
pub async fn team_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Team>,
>(
&self,
mapping: Option<InheritanceEntityMapping>,
input: TeamUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::team_update::<T>(self, mapping, input, id).await
}
pub async fn team_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::team_delete(self, id).await
}
pub async fn team_membership_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::TeamMembership>,
>(
&self,
input: TeamMembershipCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::team_membership_create::<T>(self, input).await
}
pub async fn team_membership_delete(
&self,
also_leave_parent_teams: Option<bool>,
id: String,
) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::team_membership_delete(self, also_leave_parent_teams, id).await
}
pub async fn project_milestone_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
>(
&self,
input: ProjectMilestoneCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::project_milestone_create::<T>(self, input).await
}
pub async fn project_milestone_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::ProjectMilestone>,
>(
&self,
input: ProjectMilestoneUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::project_milestone_update::<T>(self, input, id).await
}
pub async fn project_milestone_delete(
&self,
id: String,
) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::project_milestone_delete(self, id).await
}
pub async fn issue_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
&self,
input: IssueCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_create::<T>(self, input).await
}
pub async fn issue_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
&self,
input: IssueUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_update::<T>(self, input, id).await
}
pub async fn issue_batch_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
&self,
input: IssueUpdateInput,
ids: Vec<String>,
) -> Result<Vec<T>, LinearError> {
crate::generated::mutations::issue_batch_update::<T>(self, input, ids).await
}
pub async fn issue_archive<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
&self,
trash: Option<bool>,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_archive::<T>(self, trash, id).await
}
pub async fn issue_unarchive<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_unarchive::<T>(self, id).await
}
pub async fn issue_delete<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Issue>,
>(
&self,
permanently_delete: Option<bool>,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_delete::<T>(self, permanently_delete, id).await
}
pub async fn issue_relation_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::IssueRelation>,
>(
&self,
override_created_at: Option<serde_json::Value>,
input: IssueRelationCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_relation_create::<T>(self, override_created_at, input)
.await
}
pub async fn issue_relation_delete(
&self,
id: String,
) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::issue_relation_delete(self, id).await
}
pub async fn issue_label_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
>(
&self,
replace_team_labels: Option<bool>,
input: IssueLabelCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_label_create::<T>(self, replace_team_labels, input).await
}
pub async fn issue_label_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::IssueLabel>,
>(
&self,
replace_team_labels: Option<bool>,
input: IssueLabelUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::issue_label_update::<T>(self, replace_team_labels, input, id)
.await
}
pub async fn issue_label_delete(&self, id: String) -> Result<serde_json::Value, LinearError> {
crate::generated::mutations::issue_label_delete(self, id).await
}
pub async fn document_create<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Document>,
>(
&self,
input: DocumentCreateInput,
) -> Result<T, LinearError> {
crate::generated::mutations::document_create::<T>(self, input).await
}
pub async fn document_update<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Document>,
>(
&self,
input: DocumentUpdateInput,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::document_update::<T>(self, input, id).await
}
pub async fn document_delete<
T: serde::de::DeserializeOwned
+ crate::field_selection::GraphQLFields<FullType = super::types::Document>,
>(
&self,
id: String,
) -> Result<T, LinearError> {
crate::generated::mutations::document_delete::<T>(self, id).await
}
}