Skip to content

Commit

Permalink
Add DeleteParagraphBulletsRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Apr 24, 2024
1 parent 3e7f52d commit 0286917
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/v1/documents/request.rs
@@ -1,6 +1,7 @@
mod bullet_glyph_preset;
mod create_paragraph_bullets_request;
mod delete_content_range_request;
mod delete_paragraph_bullets_request;
mod end_of_segument_location;
mod insert_inline_image_request;
mod insert_inline_image_request_insertion_location;
Expand All @@ -17,6 +18,7 @@ mod update_text_style_request_insertion_location;
pub use self::bullet_glyph_preset::BulletGlyphPreset;
pub use self::create_paragraph_bullets_request::CreateParagraphBulletsRequest;
pub use self::delete_content_range_request::DeleteContentRangeRequest;
pub use self::delete_paragraph_bullets_request::DeleteParagraphBulletsRequest;
pub use self::end_of_segument_location::EndOfSegmentLocation;
pub use self::insert_inline_image_request::InsertInlineImageRequest;
pub use self::insert_inline_image_request_insertion_location::InsertInlineImageRequestInsertionLocation;
Expand Down
8 changes: 8 additions & 0 deletions src/v1/documents/request/delete_paragraph_bullets_request.rs
@@ -0,0 +1,8 @@
use crate::v1::documents::Range;

/// <https://developers.google.com/docs/api/reference/rest/v1/documents/request#deleteparagraphbulletsrequest>
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DeleteParagraphBulletsRequest {
pub range: Option<Range>,
}
2 changes: 2 additions & 0 deletions src/v1/documents/request/request_request.rs
@@ -1,5 +1,6 @@
use crate::v1::documents::request::CreateParagraphBulletsRequest;
use crate::v1::documents::request::DeleteContentRangeRequest;
use crate::v1::documents::request::DeleteParagraphBulletsRequest;
use crate::v1::documents::request::InsertInlineImageRequest;
use crate::v1::documents::request::InsertTextRequest;
use crate::v1::documents::request::ReplaceAllTextRequest;
Expand All @@ -12,6 +13,7 @@ pub enum RequestRequest {
InsertText(InsertTextRequest),
UpdateTextStyle(UpdateTextStyleRequest),
CreateParagraphBullets(CreateParagraphBulletsRequest),
DeleteParagraphBullets(DeleteParagraphBulletsRequest),
// TODO: ...
DeleteContentRange(DeleteContentRangeRequest),
InsertInlineImage(InsertInlineImageRequest),
Expand Down
16 changes: 16 additions & 0 deletions tests/v0_2.rs
Expand Up @@ -16,6 +16,22 @@ fn test_create_paragraph_bullets_request() {
};
}

#[test]
fn test_delete_paragraph_bullets_request() {
// Adds DeleteParagraphBulletsRequest
use google_docs_api_types::v1::documents::request::DeleteParagraphBulletsRequest;
use google_docs_api_types::v1::documents::request::Request;
use google_docs_api_types::v1::documents::request::RequestRequest;
use google_docs_api_types::v1::documents::Range;
let _ = Request {
request: Some(RequestRequest::DeleteParagraphBullets(
DeleteParagraphBulletsRequest {
range: Some(Range::default()),
},
)),
};
}

#[test]
fn test_update_text_style_request() {
// Adds UpdateTextStyleRequest and UpdateTextStyleRequestInsertionLocation
Expand Down

0 comments on commit 0286917

Please sign in to comment.