Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
121 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use crate::v1::documents::Range; | ||
|
||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct DeleteContentRangeRequest { | ||
pub range: Option<Range>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct EndOfSegmentLocation { | ||
pub segment_id: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use crate::v1::documents::request::InsertInlineImageRequestInsertionLocation; | ||
use crate::v1::documents::Size; | ||
|
||
/// <https://developers.google.com/docs/api/reference/rest/v1/documents/request#insertinlineimagerequest> | ||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct InsertInlineImageRequest { | ||
pub uri: Option<String>, | ||
pub object_size: Option<Size>, | ||
#[serde(flatten)] | ||
pub insertion_location: Option<InsertInlineImageRequestInsertionLocation>, | ||
} |
10 changes: 10 additions & 0 deletions
10
src/v1/documents/request/insert_inline_image_request_insertion_location.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use crate::v1::documents::request::EndOfSegmentLocation; | ||
use crate::v1::documents::request::Location; | ||
|
||
/// <https://developers.google.com/docs/api/reference/rest/v1/documents/request#insertinlineimagerequest> | ||
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum InsertInlineImageRequestInsertionLocation { | ||
Location(Location), | ||
EndOfSegmentLocation(EndOfSegmentLocation), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use crate::v1::documents::request::InsertTextRequestInsertionLocation; | ||
|
||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct InsertTextRequest { | ||
pub text: Option<String>, | ||
#[serde(flatten)] | ||
pub insertion_location: Option<InsertTextRequestInsertionLocation>, | ||
} |
9 changes: 9 additions & 0 deletions
9
src/v1/documents/request/insert_text_request_insertion_location.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use crate::v1::documents::request::EndOfSegmentLocation; | ||
use crate::v1::documents::request::Location; | ||
|
||
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum InsertTextRequestInsertionLocation { | ||
Location(Location), | ||
EndOfSegmentLocation(EndOfSegmentLocation), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct Location { | ||
pub segment_id: Option<String>, | ||
pub index: Option<usize>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use crate::v1::documents::request::ReplaceAllTextRequestCriteria; | ||
|
||
/// <https://developers.google.com/docs/api/reference/rest/v1/documents/request#replacealltextrequest> | ||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct ReplaceAllTextRequest { | ||
pub replace_text: Option<String>, | ||
#[serde(flatten)] | ||
pub criteria: Option<ReplaceAllTextRequestCriteria>, | ||
} |
8 changes: 8 additions & 0 deletions
8
src/v1/documents/request/replace_all_text_request_criteria.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use crate::v1::documents::request::SubstringMatchCriteria; | ||
|
||
/// <https://developers.google.com/docs/api/reference/rest/v1/documents/request#replacealltextrequest> | ||
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum ReplaceAllTextRequestCriteria { | ||
ContainsText(SubstringMatchCriteria), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use crate::v1::documents::request::DeleteContentRangeRequest; | ||
use crate::v1::documents::request::InsertInlineImageRequest; | ||
use crate::v1::documents::request::InsertTextRequest; | ||
use crate::v1::documents::request::ReplaceAllTextRequest; | ||
|
||
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub enum RequestRequest { | ||
ReplaceAllText(ReplaceAllTextRequest), | ||
InsertText(InsertTextRequest), | ||
// TODO: ... | ||
DeleteContentRange(DeleteContentRangeRequest), | ||
InsertInlineImage(InsertInlineImageRequest), | ||
// TODO: ... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// <https://developers.google.com/docs/api/reference/rest/v1/documents/request#substringmatchcriteria> | ||
#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct SubstringMatchCriteria { | ||
pub text: Option<String>, | ||
pub match_case: Option<bool>, | ||
} |