(self)
| 820 | return name |
| 821 | |
| 822 | def func_doc(self) -> str: |
| 823 | def _out(): |
| 824 | if self.description: |
| 825 | yield (textwrap.fill(line) for line in self.description.splitlines()) |
| 826 | |
| 827 | if deprecated := self.deprecated(":py:meth:`", "`"): |
| 828 | yield chain( |
| 829 | (".. deprecated::",), |
| 830 | wrap_indent(deprecated), |
| 831 | ) |
| 832 | if experimental := self.experimental(":py:meth:`", "`"): |
| 833 | yield chain( |
| 834 | (".. caution::",), |
| 835 | wrap_indent("Experimental: " + experimental), |
| 836 | ) |
| 837 | |
| 838 | if self.name == "id": |
| 839 | yield ( |
| 840 | "Note", |
| 841 | "----", |
| 842 | "This is lazily evaluated, no operation is actually run.", |
| 843 | ) |
| 844 | |
| 845 | if any(arg.description or arg.deprecated is not None for arg in self.args): |
| 846 | yield chain( |
| 847 | ( |
| 848 | "Parameters", |
| 849 | "----------", |
| 850 | ), |
| 851 | (arg.as_doc() for arg in self.args), |
| 852 | ) |
| 853 | |
| 854 | if self.is_leaf: |
| 855 | return_doc = output_type_description(self.graphql.type) |
| 856 | if not self.convert_id and return_doc: |
| 857 | yield chain( |
| 858 | ( |
| 859 | "Returns", |
| 860 | "-------", |
| 861 | self.type, |
| 862 | ), |
| 863 | wrap_indent(return_doc), |
| 864 | ) |
| 865 | |
| 866 | yield chain( |
| 867 | ( |
| 868 | "Raises", |
| 869 | "------", |
| 870 | "ExecuteTimeoutError", |
| 871 | ), |
| 872 | wrap_indent( |
| 873 | "If the time to execute the query exceeds the " |
| 874 | "configured timeout." |
| 875 | ), |
| 876 | ( |
| 877 | "QueryError", |
| 878 | indent("If the API returns an error."), |
| 879 | ), |
no outgoing calls