changeset 67:c7768b877690

Implement global API parameters
author Lewin Bormann <lbo@spheniscida.de>
date Mon, 19 Oct 2020 23:08:05 +0200
parents fe548002c2e5
children 297eee4a1513
files drive_example/src/drive_v3_types.rs generate/generate.py generate/templates.py
diffstat 3 files changed, 395 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/drive_example/src/drive_v3_types.rs	Mon Oct 19 22:06:46 2020 +0200
+++ b/drive_example/src/drive_v3_types.rs	Mon Oct 19 23:08:05 2020 +0200
@@ -1629,14 +1629,53 @@
     pub photo_link: Option<String>,
 }
 
+/// 
+#[derive(Serialize, Deserialize, Debug, Clone, Default)]
+pub struct DriveParams {
+    /// Data format for the response.
+    #[serde(rename = "alt")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub alt: Option<String>,
+    /// Selector specifying which fields to include in a partial response.
+    #[serde(rename = "fields")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub fields: Option<String>,
+    /// API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
+    #[serde(rename = "key")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub key: Option<String>,
+    /// OAuth 2.0 token for the current user.
+    #[serde(rename = "oauth_token")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub oauth_token: Option<String>,
+    /// Returns response with indentations and line breaks.
+    #[serde(rename = "prettyPrint")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub pretty_print: Option<bool>,
+    /// An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
+    #[serde(rename = "quotaUser")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub quota_user: Option<String>,
+    /// Deprecated. Please use quotaUser instead.
+    #[serde(rename = "userIp")]
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub user_ip: Option<String>,
+}
+
 /// Parameters for the `about.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct AboutGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
 }
 
 /// Parameters for the `changes.getStartPageToken` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct ChangesGetStartPageTokenParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.
     #[serde(rename = "driveId")]
     pub drive_id: Option<String>,
@@ -1654,6 +1693,9 @@
 /// Parameters for the `changes.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct ChangesListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.
     #[serde(rename = "driveId")]
     pub drive_id: Option<String>,
@@ -1698,6 +1740,9 @@
 /// Parameters for the `changes.watch` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct ChangesWatchParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.
     #[serde(rename = "driveId")]
     pub drive_id: Option<String>,
@@ -1742,11 +1787,17 @@
 /// Parameters for the `channels.stop` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct ChannelsStopParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
 }
 
 /// Parameters for the `comments.create` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct CommentsCreateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -1755,6 +1806,9 @@
 /// Parameters for the `comments.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct CommentsDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -1766,6 +1820,9 @@
 /// Parameters for the `comments.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct CommentsGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -1780,6 +1837,9 @@
 /// Parameters for the `comments.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct CommentsListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -1800,6 +1860,9 @@
 /// Parameters for the `comments.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct CommentsUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -1811,6 +1874,9 @@
 /// Parameters for the `drives.create` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesCreateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned.
     #[serde(rename = "requestId")]
     pub request_id: String,
@@ -1819,6 +1885,9 @@
 /// Parameters for the `drives.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the shared drive.
     #[serde(rename = "driveId")]
     pub drive_id: String,
@@ -1827,6 +1896,9 @@
 /// Parameters for the `drives.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the shared drive.
     #[serde(rename = "driveId")]
     pub drive_id: String,
@@ -1838,6 +1910,9 @@
 /// Parameters for the `drives.hide` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesHideParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the shared drive.
     #[serde(rename = "driveId")]
     pub drive_id: String,
@@ -1846,6 +1921,9 @@
 /// Parameters for the `drives.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Maximum number of shared drives to return.
     #[serde(rename = "pageSize")]
     pub page_size: Option<i32>,
@@ -1863,6 +1941,9 @@
 /// Parameters for the `drives.unhide` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesUnhideParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the shared drive.
     #[serde(rename = "driveId")]
     pub drive_id: String,
@@ -1871,6 +1952,9 @@
 /// Parameters for the `drives.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct DrivesUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the shared drive.
     #[serde(rename = "driveId")]
     pub drive_id: String,
@@ -1882,6 +1966,9 @@
 /// Parameters for the `files.copy` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesCopyParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail.
     #[serde(rename = "enforceSingleParent")]
     pub enforce_single_parent: Option<bool>,
@@ -1911,6 +1998,9 @@
 /// Parameters for the `files.create` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesCreateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail.
     #[serde(rename = "enforceSingleParent")]
     pub enforce_single_parent: Option<bool>,
@@ -1940,6 +2030,9 @@
 /// Parameters for the `files.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If an item's last parent is deleted but the item itself is not, the item will be placed under its owner's root.
     #[serde(rename = "enforceSingleParent")]
     pub enforce_single_parent: Option<bool>,
@@ -1957,6 +2050,9 @@
 /// Parameters for the `files.emptyTrash` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesEmptyTrashParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter will only take effect if the item is not in a shared drive. If an item's last parent is deleted but the item itself is not, the item will be placed under its owner's root.
     #[serde(rename = "enforceSingleParent")]
     pub enforce_single_parent: Option<bool>,
@@ -1965,6 +2061,9 @@
 /// Parameters for the `files.export` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesExportParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -1976,6 +2075,9 @@
 /// Parameters for the `files.generateIds` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesGenerateIdsParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The number of IDs to return.
     #[serde(rename = "count")]
     pub count: Option<i32>,
@@ -1987,6 +2089,9 @@
 /// Parameters for the `files.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
     #[serde(rename = "acknowledgeAbuse")]
     pub acknowledge_abuse: Option<bool>,
@@ -2007,6 +2112,9 @@
 /// Parameters for the `files.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency.
     #[serde(rename = "corpora")]
     pub corpora: Option<String>,
@@ -2054,6 +2162,9 @@
 /// Parameters for the `files.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// A comma-separated list of parent IDs to add.
     #[serde(rename = "addParents")]
     pub add_parents: Option<String>,
@@ -2089,6 +2200,9 @@
 /// Parameters for the `files.watch` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct FilesWatchParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
     #[serde(rename = "acknowledgeAbuse")]
     pub acknowledge_abuse: Option<bool>,
@@ -2109,6 +2223,9 @@
 /// Parameters for the `permissions.create` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct PermissionsCreateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// A plain text custom message to include in the notification email.
     #[serde(rename = "emailMessage")]
     pub email_message: Option<String>,
@@ -2141,6 +2258,9 @@
 /// Parameters for the `permissions.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct PermissionsDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file or shared drive.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2161,6 +2281,9 @@
 /// Parameters for the `permissions.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct PermissionsGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2181,6 +2304,9 @@
 /// Parameters for the `permissions.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct PermissionsListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file or shared drive.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2207,6 +2333,9 @@
 /// Parameters for the `permissions.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct PermissionsUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file or shared drive.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2233,6 +2362,9 @@
 /// Parameters for the `replies.create` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RepliesCreateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -2244,6 +2376,9 @@
 /// Parameters for the `replies.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RepliesDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -2258,6 +2393,9 @@
 /// Parameters for the `replies.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RepliesGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -2275,6 +2413,9 @@
 /// Parameters for the `replies.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RepliesListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -2295,6 +2436,9 @@
 /// Parameters for the `replies.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RepliesUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the comment.
     #[serde(rename = "commentId")]
     pub comment_id: String,
@@ -2309,6 +2453,9 @@
 /// Parameters for the `revisions.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RevisionsDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2320,6 +2467,9 @@
 /// Parameters for the `revisions.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RevisionsGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
     #[serde(rename = "acknowledgeAbuse")]
     pub acknowledge_abuse: Option<bool>,
@@ -2334,6 +2484,9 @@
 /// Parameters for the `revisions.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RevisionsListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2348,6 +2501,9 @@
 /// Parameters for the `revisions.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct RevisionsUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the file.
     #[serde(rename = "fileId")]
     pub file_id: String,
@@ -2359,6 +2515,9 @@
 /// Parameters for the `teamdrives.create` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct TeamdrivesCreateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned.
     #[serde(rename = "requestId")]
     pub request_id: String,
@@ -2367,6 +2526,9 @@
 /// Parameters for the `teamdrives.delete` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct TeamdrivesDeleteParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the Team Drive
     #[serde(rename = "teamDriveId")]
     pub team_drive_id: String,
@@ -2375,6 +2537,9 @@
 /// Parameters for the `teamdrives.get` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct TeamdrivesGetParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the Team Drive
     #[serde(rename = "teamDriveId")]
     pub team_drive_id: String,
@@ -2386,6 +2551,9 @@
 /// Parameters for the `teamdrives.list` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct TeamdrivesListParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// Maximum number of Team Drives to return.
     #[serde(rename = "pageSize")]
     pub page_size: Option<i32>,
@@ -2403,6 +2571,9 @@
 /// Parameters for the `teamdrives.update` method.
 #[derive(Serialize, Deserialize, Debug, Clone, Default)]
 pub struct TeamdrivesUpdateParams {
+    /// General attributes applying to any API call
+    #[serde(flatten)]
+    pub drive_params: Option<DriveParams>,
     /// The ID of the Team Drive
     #[serde(rename = "teamDriveId")]
     pub team_drive_id: String,
@@ -2411,6 +2582,33 @@
     pub use_domain_admin_access: Option<bool>,
 }
 
+impl std::fmt::Display for DriveParams {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        if let Some(ref v) = self.alt {
+            write!(f, "&{}={}", "alt", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        if let Some(ref v) = self.fields {
+            write!(f, "&{}={}", "fields", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        if let Some(ref v) = self.key {
+            write!(f, "&{}={}", "key", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        if let Some(ref v) = self.oauth_token {
+            write!(f, "&{}={}", "oauth_token", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        if let Some(ref v) = self.pretty_print {
+            write!(f, "&{}={}", "prettyPrint", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        if let Some(ref v) = self.quota_user {
+            write!(f, "&{}={}", "quotaUser", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        if let Some(ref v) = self.user_ip {
+            write!(f, "&{}={}", "userIp", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        Ok(())
+    }
+}
+
 /// The Drive About service represents the About resource.
 pub struct AboutService {
     client: TlsClient,
@@ -2456,6 +2654,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2526,6 +2727,9 @@
         url_params.push_str(&format!("&teamDriveId={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2603,6 +2807,9 @@
         url_params.push_str(&format!("&teamDriveId={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
     url_params.push_str(&format!("&pageToken={}",
         percent_encode(format!("{}", params.page_token).as_bytes(), NON_ALPHANUMERIC).to_string()));
 
@@ -2682,6 +2889,9 @@
         url_params.push_str(&format!("&teamDriveId={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
     url_params.push_str(&format!("&pageToken={}",
         percent_encode(format!("{}", params.page_token).as_bytes(), NON_ALPHANUMERIC).to_string()));
 
@@ -2739,6 +2949,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2789,6 +3002,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2814,6 +3030,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2843,6 +3062,9 @@
         url_params.push_str(&format!("&includeDeleted={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2884,6 +3106,9 @@
         url_params.push_str(&format!("&startModifiedTime={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2908,6 +3133,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -2957,6 +3185,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
     url_params.push_str(&format!("&requestId={}",
         percent_encode(format!("{}", params.request_id).as_bytes(), NON_ALPHANUMERIC).to_string()));
 
@@ -2983,6 +3214,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3011,6 +3245,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3034,6 +3271,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3074,6 +3314,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3097,6 +3340,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3124,6 +3370,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3204,6 +3453,9 @@
         url_params.push_str(&format!("&supportsTeamDrives={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3262,6 +3514,9 @@
         url_params.push_str(&format!("&useContentAsIndexableText={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3323,6 +3578,9 @@
         url_params.push_str(&format!("&useContentAsIndexableText={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
     let opt_request: Option<EmptyRequest> = None;
@@ -3361,6 +3619,9 @@
         url_params.push_str(&format!("&supportsTeamDrives={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3388,6 +3649,9 @@
         url_params.push_str(&format!("&enforceSingleParent={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3417,6 +3681,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
     url_params.push_str(&format!("&mimeType={}",
         percent_encode(format!("{}", params.mime_type).as_bytes(), NON_ALPHANUMERIC).to_string()));
 
@@ -3452,6 +3719,9 @@
         url_params.push_str(&format!("&space={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3497,6 +3767,9 @@
         url_params.push_str(&format!("&supportsTeamDrives={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3582,6 +3855,9 @@
         url_params.push_str(&format!("&teamDriveId={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3645,6 +3921,9 @@
         url_params.push_str(&format!("&useContentAsIndexableText={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3712,6 +3991,9 @@
         url_params.push_str(&format!("&useContentAsIndexableText={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
     let opt_request: Option<EmptyRequest> = None;
@@ -3758,6 +4040,9 @@
         url_params.push_str(&format!("&supportsTeamDrives={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3840,6 +4125,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3877,6 +4165,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3917,6 +4208,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -3969,6 +4263,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4013,6 +4310,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4063,6 +4363,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4088,6 +4391,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4117,6 +4423,9 @@
         url_params.push_str(&format!("&includeDeleted={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4154,6 +4463,9 @@
         url_params.push_str(&format!("&pageToken={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4178,6 +4490,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4229,6 +4544,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4262,6 +4580,9 @@
         url_params.push_str(&format!("&acknowledgeAbuse={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4299,6 +4620,9 @@
         url_params.push_str(&format!("&pageToken={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4324,6 +4648,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4373,6 +4700,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
     url_params.push_str(&format!("&requestId={}",
         percent_encode(format!("{}", params.request_id).as_bytes(), NON_ALPHANUMERIC).to_string()));
 
@@ -4399,6 +4729,9 @@
         tok = self.authenticator.token(&self.scopes).await?;
     }
     let mut url_params = format!("?oauth_token={token}&fields=*", token=tok.as_str());
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4427,6 +4760,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4467,6 +4803,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
@@ -4494,6 +4833,9 @@
         url_params.push_str(&format!("&useDomainAdminAccess={}",
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
+    if let Some(ref api_params) = &params.drive_params {
+        url_params.push_str(&format!("{}", api_params));
+    }
 
     let full_uri = path + &url_params;
 
--- a/generate/generate.py	Mon Oct 19 22:06:46 2020 +0200
+++ b/generate/generate.py	Mon Oct 19 23:08:05 2020 +0200
@@ -37,8 +37,10 @@
             return c
         return '_' + c.lower()
 
-    return ''.join([r(c) for c in name])
+    return ''.join([(r(c) if i > 0 else c.lower()) for i, c in enumerate(name)])
 
+def global_params_name(api_name):
+    return capitalize_first(api_name)+'Params'
 
 def parse_schema_types(name, schema, optional=True):
     """Translate a JSON schema type into Rust types, recursively.
@@ -90,6 +92,7 @@
                     struct['fields'].append({
                         'name':
                         cleaned_pn,
+                        'original_name': jsonname,
                         'attr':
                         '#[serde(rename = "{}")]'.format(jsonname) +
                         '\n    #[serde(skip_serializing_if = "Option::is_none")]'
@@ -170,7 +173,7 @@
         raise e
 
 
-def generate_params_structs(resources, super_name=''):
+def generate_params_structs(resources, super_name='', global_params=None):
     """Generate parameter structs from the resources list.
 
     Returns a list of source code strings.
@@ -186,6 +189,10 @@
                 'description': 'Parameters for the `{}.{}` method.'.format(resourcename, methodname),
                 'fields': []
             }
+            struct['fields'].append({'name': snake_case(global_params),
+                'typ': optionalize(global_params, True),
+                'attr': '#[serde(flatten)]',
+                'comment': 'General attributes applying to any API call'})
             # Build struct dict for rendering.
             if 'parameters' in method:
                 for paramname, param in method['parameters'].items():
@@ -256,6 +263,7 @@
         else:
             upload_path = ''
         http_method = method['httpMethod']
+        has_global_params = 'parameters' in discdoc
         formatted_path, required_params = resolve_parameters(method['path'])
 
         if is_download:
@@ -275,6 +283,7 @@
                     'param': p,
                     'snake_param': sp
                 } for (p, sp) in required_parameters.items()],
+                'global_params_name': snake_case(global_params_name(discdoc.get('name', ''))) if has_global_params else None,
                 'scopes': [{
                     'scope': s
                 } for s in method.get('scopes', [])],
@@ -296,6 +305,7 @@
                     'param': p,
                     'snake_param': sp
                 } for (p, sp) in parameters.items()],
+                'global_params_name': snake_case(global_params_name(discdoc.get('name', ''))) if has_global_params else None,
                 'required_params': [{
                     'param': p,
                     'snake_param': sp
@@ -319,6 +329,7 @@
                     'out_type': out_type,
                     'base_path': discdoc['rootUrl'],
                     'rel_path_expr': '"' + upload_path.lstrip('/') + '"',
+                    'global_params_name': snake_case(global_params_name(discdoc.get('name', ''))) if has_global_params else None,
                     'params': [{
                         'param': p,
                         'snake_param': sp
@@ -369,7 +380,8 @@
     scopes_type = generate_scopes_type(discdoc['name'], discdoc.get('auth', {}).get('oauth2', {}).get('scopes', {}))
 
     # Generate parameter types (*Params - those are used as "side inputs" to requests)
-    parameter_types = generate_params_structs(resources)
+    params_struct_name = capitalize_first(discdoc['name'])+'Params'
+    parameter_types = generate_params_structs(resources, global_params=params_struct_name)
 
     # Generate service impls
     services = []
@@ -382,6 +394,15 @@
         typ, substructs = parse_schema_types(name, desc)
         structs.extend(substructs)
 
+    # Generate global params.
+    if 'parameters' in discdoc:
+        schema = {'type': 'object', 'properties': discdoc['parameters']}
+        name =  params_struct_name
+        typ, substructs = parse_schema_types(name, schema)
+        for s in substructs:
+            parameter_types.append(chevron.render(SchemaDisplayTmpl, s))
+        structs.extend(substructs)
+
     # Assemble everything into a file.
     modname = (discdoc['id'] + '_types').replace(':', '_')
     with open(path.join('gen', modname + '.rs'), 'w') as f:
--- a/generate/templates.py	Mon Oct 19 22:06:46 2020 +0200
+++ b/generate/templates.py	Mon Oct 19 23:08:05 2020 +0200
@@ -59,6 +59,20 @@
 }
 '''
 
+# Serialize a global params struct to a URL query string.
+SchemaDisplayTmpl = '''
+impl std::fmt::Display for {{{name}}} {
+    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+        {{#fields}}
+        if let Some(ref v) = self.{{{name}}} {
+            write!(f, "&{}={}", "{{{original_name}}}", percent_encode(format!("{}", v).as_bytes(), NON_ALPHANUMERIC).to_string())?;
+        }
+        {{/fields}}
+        Ok(())
+    }
+}
+'''
+
 # Dict contents --
 #
 # api, service (names: e.g. Files)
@@ -121,6 +135,11 @@
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
     {{/params}}
+    {{#global_params_name}}
+    if let Some(ref api_params) = &params.{{{global_params_name}}} {
+        url_params.push_str(&format!("{}", api_params));
+    }
+    {{/global_params_name}}
     {{#required_params}}
     url_params.push_str(&format!("&{{{param}}}={}",
         percent_encode(format!("{}", params.{{{snake_param}}}).as_bytes(), NON_ALPHANUMERIC).to_string()));
@@ -166,6 +185,11 @@
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
     {{/params}}
+    {{#global_params_name}}
+    if let Some(ref api_params) = &params.{{{global_params_name}}} {
+        url_params.push_str(&format!("{}", api_params));
+    }
+    {{/global_params_name}}
     {{#required_params}}
     url_params.push_str(&format!("&{{{param}}}={}",
         percent_encode(format!("{}", params.{{{snake_param}}}).as_bytes(), NON_ALPHANUMERIC).to_string()));
@@ -212,6 +236,11 @@
             percent_encode(format!("{}", val).as_bytes(), NON_ALPHANUMERIC).to_string()));
     }
     {{/params}}
+    {{#global_params_name}}
+    if let Some(ref api_params) = &params.{{{global_params_name}}} {
+        url_params.push_str(&format!("{}", api_params));
+    }
+    {{/global_params_name}}
     {{#required_params}}
     url_params.push_str(&format!("&{{{param}}}={}",
         percent_encode(format!("{}", params.{{{snake_param}}}).as_bytes(), NON_ALPHANUMERIC).to_string()));