Skip to content

Commit 2f24537

Browse files
tcoffee-googleJon Wayne Parrott
authored andcommitted
Fix method doc signatures for multiline required parameters (googleapis#374)
* Fix method doc signatures for multiline required parameters. Existing doc generator failed to recognize parameters as required when parameter descriptions extended over more than one line. Besides presenting incorrect information, resulting inconsistencies broke checks for automated sample generation. * Regen docs
1 parent e833b79 commit 2f24537

File tree

266 files changed

+21055
-21047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+21055
-21047
lines changed

describe.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,23 @@ def method_params(doc):
200200
args = doclines[begin+1:]
201201

202202
parameters = []
203+
pname = None
204+
desc = ''
205+
def add_param(pname, desc):
206+
if pname is None:
207+
return
208+
if '(required)' not in desc:
209+
pname = pname + '=None'
210+
parameters.append(pname)
203211
for line in args:
204212
m = re.search('^\s+([a-zA-Z0-9_]+): (.*)', line)
205213
if m is None:
214+
desc += line
206215
continue
216+
add_param(pname, desc)
207217
pname = m.group(1)
208218
desc = m.group(2)
209-
if '(required)' not in desc:
210-
pname = pname + '=None'
211-
parameters.append(pname)
219+
add_param(pname, desc)
212220
parameters = ', '.join(parameters)
213221
else:
214222
parameters = ''

docs/dyn/adexchangebuyer2_v2beta1.accounts.clients.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h2>Instance Methods</h2>
8585
<p class="firstline">Returns the users Resource.</p>
8686

8787
<p class="toc_element">
88-
<code><a href="#create">create(accountId=None, body, x__xgafv=None)</a></code></p>
88+
<code><a href="#create">create(accountId, body, x__xgafv=None)</a></code></p>
8989
<p class="firstline">Creates a new client buyer.</p>
9090
<p class="toc_element">
9191
<code><a href="#get">get(accountId, clientAccountId, x__xgafv=None)</a></code></p>
@@ -97,11 +97,11 @@ <h2>Instance Methods</h2>
9797
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
9898
<p class="firstline">Retrieves the next page of results.</p>
9999
<p class="toc_element">
100-
<code><a href="#update">update(accountId=None, clientAccountId, body, x__xgafv=None)</a></code></p>
100+
<code><a href="#update">update(accountId, clientAccountId, body, x__xgafv=None)</a></code></p>
101101
<p class="firstline">Updates an existing client buyer.</p>
102102
<h3>Method Details</h3>
103103
<div class="method">
104-
<code class="details" id="create">create(accountId=None, body, x__xgafv=None)</code>
104+
<code class="details" id="create">create(accountId, body, x__xgafv=None)</code>
105105
<pre>Creates a new client buyer.
106106

107107
Args:
@@ -342,7 +342,7 @@ <h3>Method Details</h3>
342342
</div>
343343

344344
<div class="method">
345-
<code class="details" id="update">update(accountId=None, clientAccountId, body, x__xgafv=None)</code>
345+
<code class="details" id="update">update(accountId, clientAccountId, body, x__xgafv=None)</code>
346346
<pre>Updates an existing client buyer.
347347

348348
Args:

docs/dyn/adexchangebuyer2_v2beta1.accounts.clients.invitations.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@
7575
<h1><a href="adexchangebuyer2_v2beta1.html">Ad Exchange Buyer API II</a> . <a href="adexchangebuyer2_v2beta1.accounts.html">accounts</a> . <a href="adexchangebuyer2_v2beta1.accounts.clients.html">clients</a> . <a href="adexchangebuyer2_v2beta1.accounts.clients.invitations.html">invitations</a></h1>
7676
<h2>Instance Methods</h2>
7777
<p class="toc_element">
78-
<code><a href="#create">create(accountId, clientAccountId=None, body, x__xgafv=None)</a></code></p>
78+
<code><a href="#create">create(accountId, clientAccountId, body, x__xgafv=None)</a></code></p>
7979
<p class="firstline">Creates and sends out an email invitation to access</p>
8080
<p class="toc_element">
81-
<code><a href="#get">get(accountId, clientAccountId=None, invitationId, x__xgafv=None)</a></code></p>
81+
<code><a href="#get">get(accountId, clientAccountId, invitationId, x__xgafv=None)</a></code></p>
8282
<p class="firstline">Retrieves an existing client user invitation.</p>
8383
<p class="toc_element">
84-
<code><a href="#list">list(accountId, clientAccountId=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
84+
<code><a href="#list">list(accountId, clientAccountId, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
8585
<p class="firstline">Lists all the client users invitations for a client</p>
8686
<p class="toc_element">
8787
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
8888
<p class="firstline">Retrieves the next page of results.</p>
8989
<h3>Method Details</h3>
9090
<div class="method">
91-
<code class="details" id="create">create(accountId, clientAccountId=None, body, x__xgafv=None)</code>
91+
<code class="details" id="create">create(accountId, clientAccountId, body, x__xgafv=None)</code>
9292
<pre>Creates and sends out an email invitation to access
9393
an Ad Exchange client buyer account.
9494

@@ -105,11 +105,11 @@ <h3>Method Details</h3>
105105
"clientAccountId": "A String", # Numerical account ID of the client buyer
106106
# that the invited user is associated with.
107107
# The value of this field is ignored in create operations.
108+
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
109+
# The value of this field is ignored in create operations.
108110
"email": "A String", # The email address to which the invitation is sent. Email
109111
# addresses should be unique among all client users under each sponsor
110112
# buyer.
111-
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
112-
# The value of this field is ignored in create operations.
113113
}
114114

115115
x__xgafv: string, V1 error format.
@@ -126,16 +126,16 @@ <h3>Method Details</h3>
126126
"clientAccountId": "A String", # Numerical account ID of the client buyer
127127
# that the invited user is associated with.
128128
# The value of this field is ignored in create operations.
129+
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
130+
# The value of this field is ignored in create operations.
129131
"email": "A String", # The email address to which the invitation is sent. Email
130132
# addresses should be unique among all client users under each sponsor
131133
# buyer.
132-
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
133-
# The value of this field is ignored in create operations.
134134
}</pre>
135135
</div>
136136

137137
<div class="method">
138-
<code class="details" id="get">get(accountId, clientAccountId=None, invitationId, x__xgafv=None)</code>
138+
<code class="details" id="get">get(accountId, clientAccountId, invitationId, x__xgafv=None)</code>
139139
<pre>Retrieves an existing client user invitation.
140140

141141
Args:
@@ -157,16 +157,16 @@ <h3>Method Details</h3>
157157
"clientAccountId": "A String", # Numerical account ID of the client buyer
158158
# that the invited user is associated with.
159159
# The value of this field is ignored in create operations.
160+
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
161+
# The value of this field is ignored in create operations.
160162
"email": "A String", # The email address to which the invitation is sent. Email
161163
# addresses should be unique among all client users under each sponsor
162164
# buyer.
163-
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
164-
# The value of this field is ignored in create operations.
165165
}</pre>
166166
</div>
167167

168168
<div class="method">
169-
<code class="details" id="list">list(accountId, clientAccountId=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
169+
<code class="details" id="list">list(accountId, clientAccountId, pageSize=None, pageToken=None, x__xgafv=None)</code>
170170
<pre>Lists all the client users invitations for a client
171171
with a given account ID.
172172

@@ -209,11 +209,11 @@ <h3>Method Details</h3>
209209
"clientAccountId": "A String", # Numerical account ID of the client buyer
210210
# that the invited user is associated with.
211211
# The value of this field is ignored in create operations.
212+
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
213+
# The value of this field is ignored in create operations.
212214
"email": "A String", # The email address to which the invitation is sent. Email
213215
# addresses should be unique among all client users under each sponsor
214216
# buyer.
215-
"invitationId": "A String", # The unique numerical ID of the invitation that is sent to the user.
216-
# The value of this field is ignored in create operations.
217217
},
218218
],
219219
}</pre>

docs/dyn/adexchangebuyer2_v2beta1.accounts.clients.users.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,20 @@
7575
<h1><a href="adexchangebuyer2_v2beta1.html">Ad Exchange Buyer API II</a> . <a href="adexchangebuyer2_v2beta1.accounts.html">accounts</a> . <a href="adexchangebuyer2_v2beta1.accounts.clients.html">clients</a> . <a href="adexchangebuyer2_v2beta1.accounts.clients.users.html">users</a></h1>
7676
<h2>Instance Methods</h2>
7777
<p class="toc_element">
78-
<code><a href="#get">get(accountId, clientAccountId=None, userId, x__xgafv=None)</a></code></p>
78+
<code><a href="#get">get(accountId, clientAccountId, userId, x__xgafv=None)</a></code></p>
7979
<p class="firstline">Retrieves an existing client user.</p>
8080
<p class="toc_element">
81-
<code><a href="#list">list(accountId=None, clientAccountId, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
81+
<code><a href="#list">list(accountId, clientAccountId, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
8282
<p class="firstline">Lists all the known client users for a specified</p>
8383
<p class="toc_element">
8484
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
8585
<p class="firstline">Retrieves the next page of results.</p>
8686
<p class="toc_element">
87-
<code><a href="#update">update(accountId, clientAccountId=None, userId, body, x__xgafv=None)</a></code></p>
87+
<code><a href="#update">update(accountId, clientAccountId, userId, body, x__xgafv=None)</a></code></p>
8888
<p class="firstline">Updates an existing client user.</p>
8989
<h3>Method Details</h3>
9090
<div class="method">
91-
<code class="details" id="get">get(accountId, clientAccountId=None, userId, x__xgafv=None)</code>
91+
<code class="details" id="get">get(accountId, clientAccountId, userId, x__xgafv=None)</code>
9292
<pre>Retrieves an existing client user.
9393

9494
Args:
@@ -130,7 +130,7 @@ <h3>Method Details</h3>
130130
</div>
131131

132132
<div class="method">
133-
<code class="details" id="list">list(accountId=None, clientAccountId, pageSize=None, pageToken=None, x__xgafv=None)</code>
133+
<code class="details" id="list">list(accountId, clientAccountId, pageSize=None, pageToken=None, x__xgafv=None)</code>
134134
<pre>Lists all the known client users for a specified
135135
sponsor buyer account ID.
136136

@@ -208,7 +208,7 @@ <h3>Method Details</h3>
208208
</div>
209209

210210
<div class="method">
211-
<code class="details" id="update">update(accountId, clientAccountId=None, userId, body, x__xgafv=None)</code>
211+
<code class="details" id="update">update(accountId, clientAccountId, userId, body, x__xgafv=None)</code>
212212
<pre>Updates an existing client user.
213213
Only the user status can be changed on update.
214214

docs/dyn/adexchangebuyer2_v2beta1.accounts.creatives.dealAssociations.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h2>Instance Methods</h2>
7878
<code><a href="#add">add(accountId, creativeId, body, x__xgafv=None)</a></code></p>
7979
<p class="firstline">Associate an existing deal with a creative.</p>
8080
<p class="toc_element">
81-
<code><a href="#list">list(accountId=None, creativeId=None, pageSize=None, pageToken=None, x__xgafv=None, query=None)</a></code></p>
81+
<code><a href="#list">list(accountId, creativeId, pageSize=None, pageToken=None, x__xgafv=None, query=None)</a></code></p>
8282
<p class="firstline">List all creative-deal associations.</p>
8383
<p class="toc_element">
8484
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
@@ -126,7 +126,7 @@ <h3>Method Details</h3>
126126
</div>
127127

128128
<div class="method">
129-
<code class="details" id="list">list(accountId=None, creativeId=None, pageSize=None, pageToken=None, x__xgafv=None, query=None)</code>
129+
<code class="details" id="list">list(accountId, creativeId, pageSize=None, pageToken=None, x__xgafv=None, query=None)</code>
130130
<pre>List all creative-deal associations.
131131

132132
Args:

0 commit comments

Comments
 (0)