Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce44d00

Browse files
committedMar 18, 2025
feat(forms): update the api
#### forms:v1 The following keys were added: - resources.forms.methods.create.parameters.unpublished (Total Keys: 2) - resources.forms.methods.setPublishSettings (Total Keys: 11) - schemas.Form.properties.publishSettings (Total Keys: 2) - schemas.PublishSettings (Total Keys: 3) - schemas.PublishState (Total Keys: 4) - schemas.SetPublishSettingsRequest (Total Keys: 5) - schemas.SetPublishSettingsResponse (Total Keys: 4)
1 parent 9476b41 commit ce44d00

File tree

2 files changed

+167
-4
lines changed

2 files changed

+167
-4
lines changed
 

‎docs/dyn/forms_v1.forms.html

+68-2
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,14 @@ <h2>Instance Methods</h2>
9191
<code><a href="#close">close()</a></code></p>
9292
<p class="firstline">Close httplib2 connections.</p>
9393
<p class="toc_element">
94-
<code><a href="#create">create(body=None, x__xgafv=None)</a></code></p>
94+
<code><a href="#create">create(body=None, unpublished=None, x__xgafv=None)</a></code></p>
9595
<p class="firstline">Create a new form using the title given in the provided form message in the request. *Important:* Only the form.info.title and form.info.document_title fields are copied to the new form. All other fields including the form description, items and settings are disallowed. To create a new form and add items, you must first call forms.create to create an empty form with a title and (optional) document title, and then call forms.update to add the items.</p>
9696
<p class="toc_element">
9797
<code><a href="#get">get(formId, x__xgafv=None)</a></code></p>
9898
<p class="firstline">Get a form.</p>
99+
<p class="toc_element">
100+
<code><a href="#setPublishSettings">setPublishSettings(formId, body=None, x__xgafv=None)</a></code></p>
101+
<p class="firstline">Updates the publish settings of a form. Legacy forms aren't supported because they don't have the `publish_settings` field.</p>
99102
<h3>Method Details</h3>
100103
<div class="method">
101104
<code class="details" id="batchUpdate">batchUpdate(formId, body=None, x__xgafv=None)</code>
@@ -1078,6 +1081,12 @@ <h3>Method Details</h3>
10781081
},
10791082
],
10801083
&quot;linkedSheetId&quot;: &quot;A String&quot;, # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
1084+
&quot;publishSettings&quot;: { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn&#x27;t set for legacy forms because they don&#x27;t have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
1085+
&quot;publishState&quot;: { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn&#x27;t supported and returns an error.
1086+
&quot;isAcceptingResponses&quot;: True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
1087+
&quot;isPublished&quot;: True or False, # Required. Whether the form is published and visible to others.
1088+
},
1089+
},
10811090
&quot;responderUri&quot;: &quot;A String&quot;, # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
10821091
&quot;revisionId&quot;: &quot;A String&quot;, # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
10831092
&quot;settings&quot;: { # A form&#x27;s settings. # The form&#x27;s settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
@@ -1110,7 +1119,7 @@ <h3>Method Details</h3>
11101119
</div>
11111120

11121121
<div class="method">
1113-
<code class="details" id="create">create(body=None, x__xgafv=None)</code>
1122+
<code class="details" id="create">create(body=None, unpublished=None, x__xgafv=None)</code>
11141123
<pre>Create a new form using the title given in the provided form message in the request. *Important:* Only the form.info.title and form.info.document_title fields are copied to the new form. All other fields including the form description, items and settings are disallowed. To create a new form and add items, you must first call forms.create to create an empty form with a title and (optional) document title, and then call forms.update to add the items.
11151124

11161125
Args:
@@ -1427,6 +1436,12 @@ <h3>Method Details</h3>
14271436
},
14281437
],
14291438
&quot;linkedSheetId&quot;: &quot;A String&quot;, # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
1439+
&quot;publishSettings&quot;: { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn&#x27;t set for legacy forms because they don&#x27;t have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
1440+
&quot;publishState&quot;: { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn&#x27;t supported and returns an error.
1441+
&quot;isAcceptingResponses&quot;: True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
1442+
&quot;isPublished&quot;: True or False, # Required. Whether the form is published and visible to others.
1443+
},
1444+
},
14301445
&quot;responderUri&quot;: &quot;A String&quot;, # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
14311446
&quot;revisionId&quot;: &quot;A String&quot;, # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
14321447
&quot;settings&quot;: { # A form&#x27;s settings. # The form&#x27;s settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
@@ -1437,6 +1452,7 @@ <h3>Method Details</h3>
14371452
},
14381453
}
14391454

1455+
unpublished: boolean, Optional. Whether the form is unpublished. If set to `true`, the form doesn&#x27;t accept responses. If set to `false` or unset, the form is published and accepts responses.
14401456
x__xgafv: string, V1 error format.
14411457
Allowed values
14421458
1 - v1 error format
@@ -1755,6 +1771,12 @@ <h3>Method Details</h3>
17551771
},
17561772
],
17571773
&quot;linkedSheetId&quot;: &quot;A String&quot;, # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
1774+
&quot;publishSettings&quot;: { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn&#x27;t set for legacy forms because they don&#x27;t have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
1775+
&quot;publishState&quot;: { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn&#x27;t supported and returns an error.
1776+
&quot;isAcceptingResponses&quot;: True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
1777+
&quot;isPublished&quot;: True or False, # Required. Whether the form is published and visible to others.
1778+
},
1779+
},
17581780
&quot;responderUri&quot;: &quot;A String&quot;, # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
17591781
&quot;revisionId&quot;: &quot;A String&quot;, # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
17601782
&quot;settings&quot;: { # A form&#x27;s settings. # The form&#x27;s settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
@@ -2090,6 +2112,12 @@ <h3>Method Details</h3>
20902112
},
20912113
],
20922114
&quot;linkedSheetId&quot;: &quot;A String&quot;, # Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists).
2115+
&quot;publishSettings&quot;: { # The publishing settings of a form. # Output only. The publishing settings for a form. This field isn&#x27;t set for legacy forms because they don&#x27;t have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.
2116+
&quot;publishState&quot;: { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn&#x27;t supported and returns an error.
2117+
&quot;isAcceptingResponses&quot;: True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
2118+
&quot;isPublished&quot;: True or False, # Required. Whether the form is published and visible to others.
2119+
},
2120+
},
20932121
&quot;responderUri&quot;: &quot;A String&quot;, # Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.
20942122
&quot;revisionId&quot;: &quot;A String&quot;, # Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes.
20952123
&quot;settings&quot;: { # A form&#x27;s settings. # The form&#x27;s settings. This must be updated with UpdateSettingsRequest; it is ignored during `forms.create` and UpdateFormInfoRequest.
@@ -2101,4 +2129,42 @@ <h3>Method Details</h3>
21012129
}</pre>
21022130
</div>
21032131

2132+
<div class="method">
2133+
<code class="details" id="setPublishSettings">setPublishSettings(formId, body=None, x__xgafv=None)</code>
2134+
<pre>Updates the publish settings of a form. Legacy forms aren&#x27;t supported because they don&#x27;t have the `publish_settings` field.
2135+
2136+
Args:
2137+
formId: string, Required. The ID of the form. You can get the id from `Form.form_id` field. (required)
2138+
body: object, The request body.
2139+
The object takes the form of:
2140+
2141+
{ # Updates the publish settings of a Form.
2142+
&quot;publishSettings&quot;: { # The publishing settings of a form. # Required. The desired publish settings to apply to the form.
2143+
&quot;publishState&quot;: { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn&#x27;t supported and returns an error.
2144+
&quot;isAcceptingResponses&quot;: True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
2145+
&quot;isPublished&quot;: True or False, # Required. Whether the form is published and visible to others.
2146+
},
2147+
},
2148+
&quot;updateMask&quot;: &quot;A String&quot;, # Optional. The `publish_settings` fields to update. This field mask accepts the following values: * `publish_state`: Updates or replaces all `publish_state` settings. * `&quot;*&quot;`: Updates or replaces all `publish_settings` fields.
2149+
}
2150+
2151+
x__xgafv: string, V1 error format.
2152+
Allowed values
2153+
1 - v1 error format
2154+
2 - v2 error format
2155+
2156+
Returns:
2157+
An object of the form:
2158+
2159+
{ # The response of a `SetPublishSettings` request.
2160+
&quot;formId&quot;: &quot;A String&quot;, # Required. The ID of the Form. This is same as the `Form.form_id` field.
2161+
&quot;publishSettings&quot;: { # The publishing settings of a form. # The publish settings of the form.
2162+
&quot;publishState&quot;: { # The publishing state of a form. # Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn&#x27;t supported and returns an error.
2163+
&quot;isAcceptingResponses&quot;: True or False, # Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.
2164+
&quot;isPublished&quot;: True or False, # Required. Whether the form is published and visible to others.
2165+
},
2166+
},
2167+
}</pre>
2168+
</div>
2169+
21042170
</body></html>

‎googleapiclient/discovery_cache/documents/forms.v1.json

+99-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@
157157
"httpMethod": "POST",
158158
"id": "forms.forms.create",
159159
"parameterOrder": [],
160-
"parameters": {},
160+
"parameters": {
161+
"unpublished": {
162+
"description": "Optional. Whether the form is unpublished. If set to `true`, the form doesn't accept responses. If set to `false` or unset, the form is published and accepts responses.",
163+
"location": "query",
164+
"type": "boolean"
165+
}
166+
},
161167
"path": "v1/forms",
162168
"request": {
163169
"$ref": "Form"
@@ -198,6 +204,35 @@
198204
"https://www.googleapis.com/auth/forms.body",
199205
"https://www.googleapis.com/auth/forms.body.readonly"
200206
]
207+
},
208+
"setPublishSettings": {
209+
"description": "Updates the publish settings of a form. Legacy forms aren't supported because they don't have the `publish_settings` field.",
210+
"flatPath": "v1/forms/{formId}:setPublishSettings",
211+
"httpMethod": "POST",
212+
"id": "forms.forms.setPublishSettings",
213+
"parameterOrder": [
214+
"formId"
215+
],
216+
"parameters": {
217+
"formId": {
218+
"description": "Required. The ID of the form. You can get the id from `Form.form_id` field.",
219+
"location": "path",
220+
"required": true,
221+
"type": "string"
222+
}
223+
},
224+
"path": "v1/forms/{formId}:setPublishSettings",
225+
"request": {
226+
"$ref": "SetPublishSettingsRequest"
227+
},
228+
"response": {
229+
"$ref": "SetPublishSettingsResponse"
230+
},
231+
"scopes": [
232+
"https://www.googleapis.com/auth/drive",
233+
"https://www.googleapis.com/auth/drive.file",
234+
"https://www.googleapis.com/auth/forms.body"
235+
]
201236
}
202237
},
203238
"resources": {
@@ -423,7 +458,7 @@
423458
}
424459
}
425460
},
426-
"revision": "20250218",
461+
"revision": "20250304",
427462
"rootUrl": "https://forms.googleapis.com/",
428463
"schemas": {
429464
"Answer": {
@@ -794,6 +829,11 @@
794829
"readOnly": true,
795830
"type": "string"
796831
},
832+
"publishSettings": {
833+
"$ref": "PublishSettings",
834+
"description": "Output only. The publishing settings for a form. This field isn't set for legacy forms because they don't have the `publish_settings` field. All newly created forms support publish settings. Forms with `publish_settings` value set can call UpdatePublishSettings API to publish or unpublish the form.",
835+
"readOnly": true
836+
},
797837
"responderUri": {
798838
"description": "Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions.",
799839
"readOnly": true,
@@ -1182,6 +1222,32 @@
11821222
"properties": {},
11831223
"type": "object"
11841224
},
1225+
"PublishSettings": {
1226+
"description": "The publishing settings of a form.",
1227+
"id": "PublishSettings",
1228+
"properties": {
1229+
"publishState": {
1230+
"$ref": "PublishState",
1231+
"description": "Optional. The publishing state of a form. When updating `publish_state`, both `is_published` and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true` and `is_published` to `false` isn't supported and returns an error."
1232+
}
1233+
},
1234+
"type": "object"
1235+
},
1236+
"PublishState": {
1237+
"description": "The publishing state of a form.",
1238+
"id": "PublishState",
1239+
"properties": {
1240+
"isAcceptingResponses": {
1241+
"description": "Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`.",
1242+
"type": "boolean"
1243+
},
1244+
"isPublished": {
1245+
"description": "Required. Whether the form is published and visible to others.",
1246+
"type": "boolean"
1247+
}
1248+
},
1249+
"type": "object"
1250+
},
11851251
"Question": {
11861252
"description": "Any question. The specific type of question is known by its `kind`.",
11871253
"id": "Question",
@@ -1393,6 +1459,37 @@
13931459
},
13941460
"type": "object"
13951461
},
1462+
"SetPublishSettingsRequest": {
1463+
"description": "Updates the publish settings of a Form.",
1464+
"id": "SetPublishSettingsRequest",
1465+
"properties": {
1466+
"publishSettings": {
1467+
"$ref": "PublishSettings",
1468+
"description": "Required. The desired publish settings to apply to the form."
1469+
},
1470+
"updateMask": {
1471+
"description": "Optional. The `publish_settings` fields to update. This field mask accepts the following values: * `publish_state`: Updates or replaces all `publish_state` settings. * `\"*\"`: Updates or replaces all `publish_settings` fields.",
1472+
"format": "google-fieldmask",
1473+
"type": "string"
1474+
}
1475+
},
1476+
"type": "object"
1477+
},
1478+
"SetPublishSettingsResponse": {
1479+
"description": "The response of a `SetPublishSettings` request.",
1480+
"id": "SetPublishSettingsResponse",
1481+
"properties": {
1482+
"formId": {
1483+
"description": "Required. The ID of the Form. This is same as the `Form.form_id` field.",
1484+
"type": "string"
1485+
},
1486+
"publishSettings": {
1487+
"$ref": "PublishSettings",
1488+
"description": "The publish settings of the form."
1489+
}
1490+
},
1491+
"type": "object"
1492+
},
13961493
"TextAnswer": {
13971494
"description": "An answer to a question represented as text.",
13981495
"id": "TextAnswer",

0 commit comments

Comments
 (0)
Please sign in to comment.