mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-22 19:21:27 +01:00
@@ -7,7 +7,7 @@
|
||||
REQUEST_MARKER_TRAIT, RESPONSE_MARKER_TRAIT, supports_scopes, to_api_version,
|
||||
to_fqan, METHODS_RESOURCE, ADD_PARAM_MEDIA_EXAMPLE, PROTOCOL_TYPE_INFO, enclose_in,
|
||||
upload_action_fn, unique_type_name, schema_doc_format, METHODS_BUILDER_MARKER_TRAIT,
|
||||
to_extern_crate_name)
|
||||
to_extern_crate_name, rust_doc_sanitize)
|
||||
|
||||
def pretty_name(name):
|
||||
return ' '.join(split_camelcase_s(name).split('.'))
|
||||
@@ -341,7 +341,7 @@ You can read the full text at the repository's [license file][repo-license].
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub enum Scope {
|
||||
% for url, scope in auth.oauth2.scopes.items():
|
||||
${scope.description | rust_doc_comment}
|
||||
${scope.description | rust_doc_sanitize, rust_doc_comment}
|
||||
${scope_url_to_variant(name, url, fully_qualified=False)},
|
||||
% if not loop.last:
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
DELEGATE_PROPERTY_NAME, struct_type_bounds_s, scope_url_to_variant,
|
||||
re_find_replacements, ADD_PARAM_FN, ADD_PARAM_MEDIA_EXAMPLE, upload_action_fn, METHODS_RESOURCE,
|
||||
method_name_to_variant, unique_type_name, size_to_bytes, method_default_scope,
|
||||
is_repeated_property, setter_fn_name, ADD_SCOPE_FN)
|
||||
is_repeated_property, setter_fn_name, ADD_SCOPE_FN, rust_doc_sanitize)
|
||||
|
||||
def get_parts(part_prop):
|
||||
if not part_prop:
|
||||
@@ -58,7 +58,7 @@
|
||||
parts = get_parts(part_prop)
|
||||
%>\
|
||||
% if 'description' in m:
|
||||
${m.description | rust_doc_comment}
|
||||
${m.description | rust_doc_sanitize, rust_doc_comment}
|
||||
///
|
||||
% endif
|
||||
% if m.get('supportsMediaDownload', False):
|
||||
@@ -82,7 +82,7 @@ ${m.description | rust_doc_comment}
|
||||
/// It is not used directly, but through a `${rb_type(resource)}` instance.
|
||||
///
|
||||
% if part_desc:
|
||||
${part_desc | rust_doc_comment}
|
||||
${part_desc | rust_doc_sanitize, rust_doc_comment}
|
||||
///
|
||||
% if m.get('scopes'):
|
||||
/// # Scopes
|
||||
@@ -220,7 +220,7 @@ ${self._setter_fn(resource, method, m, p, part_prop, ThisType, c)}\
|
||||
# end part description
|
||||
%>\
|
||||
% if 'description' in p:
|
||||
${p.description | rust_doc_comment, indent_all_but_first_by(1)}
|
||||
${p.description | rust_doc_sanitize, rust_doc_comment, indent_all_but_first_by(1)}
|
||||
% endif
|
||||
% if is_repeated_property(p):
|
||||
///
|
||||
@@ -244,7 +244,7 @@ ${self._setter_fn(resource, method, m, p, part_prop, ThisType, c)}\
|
||||
% endif
|
||||
% if part_desc:
|
||||
///
|
||||
${part_desc | rust_doc_comment, indent_all_but_first_by(1)}
|
||||
${part_desc | rust_doc_sanitize, rust_doc_comment, indent_all_but_first_by(1)}
|
||||
% endif
|
||||
pub fn ${mangle_ident(setter_fn_name(p))}(mut self, ${value_name}: ${InType}) -> ${ThisType} {
|
||||
% if p.get('repeated', False):
|
||||
@@ -875,7 +875,7 @@ if enable_resource_parsing \
|
||||
}
|
||||
|
||||
% for p in media_params:
|
||||
${p.description | rust_doc_comment, indent_all_but_first_by(1)}
|
||||
${p.description | rust_doc_sanitize, rust_doc_comment, indent_all_but_first_by(1)}
|
||||
///
|
||||
% for item_name, item in p.info.iteritems():
|
||||
/// * *${split_camelcase_s(item_name)}*: ${isinstance(item, (list, tuple)) and put_and(enclose_in("'", item)) or str(item)}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
rust_copy_value_s, organize_params, REQUEST_VALUE_PROPERTY_NAME,
|
||||
build_all_params, rb_type_params_s, hub_type_params_s, mb_type_params_s, mb_additional_type_params,
|
||||
struct_type_bounds_s, METHODS_RESOURCE, SPACES_PER_TAB, prefix_all_but_first_with,
|
||||
METHODS_BUILDER_MARKER_TRAIT, remove_empty_lines, method_default_scope)
|
||||
METHODS_BUILDER_MARKER_TRAIT, remove_empty_lines, method_default_scope, rust_doc_sanitize)
|
||||
%>\
|
||||
<%namespace name="util" file="../../lib/util.mako"/>\
|
||||
<%namespace name="lib" file="lib.mako"/>\
|
||||
@@ -80,7 +80,7 @@ impl${rb_params} ${ThisType} {
|
||||
% if 'description' in m:
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
${m.description | rust_doc_comment, indent_all_but_first_by(1)}
|
||||
${m.description | rust_doc_sanitize, rust_doc_comment, indent_all_but_first_by(1)}
|
||||
% endif
|
||||
% if required_props:
|
||||
///
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
from util import (schema_markers, rust_doc_comment, mangle_ident, to_rust_type, put_and,
|
||||
IO_TYPES, activity_split, enclose_in, REQUEST_MARKER_TRAIT, mb_type, indent_all_but_first_by,
|
||||
NESTED_TYPE_SUFFIX, RESPONSE_MARKER_TRAIT, split_camelcase_s, METHODS_RESOURCE, unique_type_name,
|
||||
PART_MARKER_TRAIT, canonical_type_name, TO_PARTS_MARKER, UNUSED_TYPE_MARKER, is_schema_with_optionals)
|
||||
PART_MARKER_TRAIT, canonical_type_name, TO_PARTS_MARKER, UNUSED_TYPE_MARKER, is_schema_with_optionals,
|
||||
rust_doc_sanitize)
|
||||
%>\
|
||||
## Build a schema which must be an object
|
||||
###################################################################################################################
|
||||
@@ -12,7 +13,7 @@
|
||||
% if properties:
|
||||
${struct} {
|
||||
% for pn, p in properties.iteritems():
|
||||
${p.get('description', 'no description provided') | rust_doc_comment, indent_all_but_first_by(1)}
|
||||
${p.get('description', 'no description provided') | rust_doc_sanitize, rust_doc_comment, indent_all_but_first_by(1)}
|
||||
% if pn != mangle_ident(pn):
|
||||
#[serde(rename="${pn}")]
|
||||
% endif
|
||||
@@ -28,7 +29,7 @@ ${struct}(${to_rust_type(schemas, s.id, NESTED_TYPE_SUFFIX, s, allow_optionals=a
|
||||
%>\
|
||||
pub enum ${et} {
|
||||
% for p in s.variant.map:
|
||||
${p.get('description', 'no description provided') | rust_doc_comment, indent_all_but_first_by(1)}
|
||||
${p.get('description', 'no description provided') | rust_doc_sanitize, rust_doc_comment, indent_all_but_first_by(1)}
|
||||
% if variant_type(p) != p.type_value:
|
||||
#[serde(rename="${p.type_value}")]
|
||||
% endif
|
||||
@@ -72,7 +73,7 @@ ${struct} { _never_set: Option<bool> }
|
||||
|
||||
s_type = unique_type_name(s.id)
|
||||
%>\
|
||||
<%block filter="rust_doc_comment">\
|
||||
<%block filter="rust_doc_sanitize, rust_doc_comment">\
|
||||
${doc(s, c)}\
|
||||
</%block>
|
||||
#[derive(${', '.join(traits)})]
|
||||
|
||||
Reference in New Issue
Block a user