Skip to main content

WikiCategoriesPagesResource

Struct WikiCategoriesPagesResource 

Source
pub struct WikiCategoriesPagesResource<'a> { /* private fields */ }
Expand description

client.wiki().categories().pages()

Implementations§

Source§

impl<'a> WikiCategoriesPagesResource<'a>

Source

pub fn versions(&self) -> WikiCategoriesPagesVersionsResource<'a>

Source

pub fn create( &self, wiki_category_id: impl Display, body: &WikiPageCreate, ) -> Result<WikiPage>

Create a wiki page

POST /wiki/categories/{wikiCategoryId}/pages

Creates a page with a generated stable GUID and version 1. Requires churchwiki edit category; creating a title that resolves to a protected system page additionally requires a super administrator. The trimmed title must be unique in the category across stored versions. Unicode ellipsis is normalized to three periods. Omitted text is stored as null but returned as an empty string. isMarkdown and onStartpage default to false; this differs from the main page automatically created with a new category, which starts with Markdown enabled.

§Example
let body = models::WikiPageCreate {
    title: "My new wiki page".into(),
    ..Default::default()
};
let result = client.wiki().categories().pages().create(42, &body)?;
println!("{}", result.title);
Source

pub fn delete( &self, wiki_category_id: impl Display, identifier: impl Display, ) -> Result<()>

Delete a wiki page

DELETE /wiki/categories/{wikiCategoryId}/pages/{identifier}

Deletes the page identified by GUID and every stored revision. Requires churchwiki edit category. Protected system pages in category 0 cannot be deleted through this endpoint, including by super administrators. Missing pages succeed with 204. Latest redirect pages targeting the deleted title have redirectTo cleared; older redirect revisions are retained. This deletion has no dry-run or version precondition.

§Example
client.wiki().categories().pages().delete(42, "681F54E3-2EB7-40A4-84F0-EFF8E8F05727")?;
Source

pub fn get( &self, wiki_category_id: impl Display, identifier: impl Display, ) -> Result<WikiPage>

Get a wiki page

GET /wiki/categories/{wikiCategoryId}/pages/{identifier}

Requires churchwiki view category permission, including any permissions assigned to guests. For a protected system page in category 0, super-administrator access also permits the individual read. Returns one page revision with text: Markdown is returned as stored, legacy HTML is sanitized, and null content becomes an empty string. Prefer the stable page GUID; legacy titles are accepted and Unicode ellipsis characters in titles are normalized to three periods. A version value of 0 behaves like omission and selects the latest revision; other nonzero values select that exact revision. Redirect pages are returned as data with redirectTo rather than followed.

Use Self::get_with to pass query parameters.

§Example
let page = client.wiki().categories().pages().get(42, "main")?;
println!("{}", page.title);
Source

pub fn get_with( &self, wiki_category_id: impl Display, identifier: impl Display, query: &GetWikiCategoriesIdPagesIdentifierQuery, ) -> Result<WikiPage>

Get a wiki page

Like Self::get, with query parameters.

GET /wiki/categories/{wikiCategoryId}/pages/{identifier}

Requires churchwiki view category permission, including any permissions assigned to guests. For a protected system page in category 0, super-administrator access also permits the individual read. Returns one page revision with text: Markdown is returned as stored, legacy HTML is sanitized, and null content becomes an empty string. Prefer the stable page GUID; legacy titles are accepted and Unicode ellipsis characters in titles are normalized to three periods. A version value of 0 behaves like omission and selects the latest revision; other nonzero values select that exact revision. Redirect pages are returned as data with redirectTo rather than followed.

Source

pub fn list( &self, wiki_category_id: impl Display, ) -> Result<Vec<SimpleWikiPage>>

List wiki pages in a category

GET /wiki/categories/{wikiCategoryId}/pages

Lists the latest version of each non-system page in this category, including redirect pages. Requires churchwiki view category permission. Page text and previews are omitted. Results are ordered by display title (main uses the category name), then GUID, without pagination; meta.count is the number of returned pages. The nested wikiCategory.permissions object is normally empty, while page.permissions contains canEdit/canDelete.

§Example
for page in client.wiki().categories().pages().list(42)? {
    println!("{}", page.title);
}
Source

pub fn patch( &self, wiki_category_id: impl Display, identifier: impl Display, body: &WikiPageUpdate, ) -> Result<WikiPage>

Update a wiki page

PATCH /wiki/categories/{wikiCategoryId}/pages/{identifier}

Updates only supplied text, isMarkdown and onStartpage fields on the latest revision identified by GUID. Titles cannot be changed through this endpoint. Requires category edit permission; protected system pages in category 0 require a super administrator. Changed text creates the next revision with the same GUID; unchanged text or changes only to the flags modify the existing latest revision. Trimmed blank/null text clears the stored content. No expected-version or ETag precondition is accepted, so this endpoint does not provide optimistic edit-conflict protection.

§Example
let body = models::WikiPageUpdate {
    is_markdown: Some(true),
    ..Default::default()
};
let result = client.wiki().categories().pages().patch(42, "681F54E3-2EB7-40A4-84F0-EFF8E8F05727", &body)?;
println!("{}", result.title);

Trait Implementations§

Source§

impl<'a> Clone for WikiCategoriesPagesResource<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for WikiCategoriesPagesResource<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more