Skip to content

Commit f700d8c

Browse files
1 parent b9937f0 commit f700d8c

File tree

9 files changed

+554
-18
lines changed

9 files changed

+554
-18
lines changed

clients/google-api-services-forms/v1/2.0.0/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Add the following lines to your `pom.xml` file:
2222
<dependency>
2323
<groupId>com.google.apis</groupId>
2424
<artifactId>google-api-services-forms</artifactId>
25-
<version>v1-rev20250218-2.0.0</version>
25+
<version>v1-rev20250415-2.0.0</version>
2626
</dependency>
2727
</dependencies>
2828
</project>
@@ -35,7 +35,7 @@ repositories {
3535
mavenCentral()
3636
}
3737
dependencies {
38-
implementation 'com.google.apis:google-api-services-forms:v1-rev20250218-2.0.0'
38+
implementation 'com.google.apis:google-api-services-forms:v1-rev20250415-2.0.0'
3939
}
4040
```
4141

clients/google-api-services-forms/v1/2.0.0/com/google/api/services/forms/v1/Forms.java

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,29 @@ public Create setUploadProtocol(java.lang.String uploadProtocol) {
372372
return (Create) super.setUploadProtocol(uploadProtocol);
373373
}
374374

375+
/**
376+
* Optional. Whether the form is unpublished. If set to `true`, the form doesn't accept
377+
* responses. If set to `false` or unset, the form is published and accepts responses.
378+
*/
379+
@com.google.api.client.util.Key
380+
private java.lang.Boolean unpublished;
381+
382+
/** Optional. Whether the form is unpublished. If set to `true`, the form doesn't accept responses. If
383+
set to `false` or unset, the form is published and accepts responses.
384+
*/
385+
public java.lang.Boolean getUnpublished() {
386+
return unpublished;
387+
}
388+
389+
/**
390+
* Optional. Whether the form is unpublished. If set to `true`, the form doesn't accept
391+
* responses. If set to `false` or unset, the form is published and accepts responses.
392+
*/
393+
public Create setUnpublished(java.lang.Boolean unpublished) {
394+
this.unpublished = unpublished;
395+
return this;
396+
}
397+
375398
@Override
376399
public Create set(String parameterName, Object value) {
377400
return (Create) super.set(parameterName, value);
@@ -502,6 +525,126 @@ public Get set(String parameterName, Object value) {
502525
return (Get) super.set(parameterName, value);
503526
}
504527
}
528+
/**
529+
* Updates the publish settings of a form. Legacy forms aren't supported because they don't have the
530+
* `publish_settings` field.
531+
*
532+
* Create a request for the method "forms.setPublishSettings".
533+
*
534+
* This request holds the parameters needed by the forms server. After setting any optional
535+
* parameters, call the {@link SetPublishSettings#execute()} method to invoke the remote operation.
536+
*
537+
* @param formId Required. The ID of the form. You can get the id from `Form.form_id` field.
538+
* @param content the {@link com.google.api.services.forms.v1.model.SetPublishSettingsRequest}
539+
* @return the request
540+
*/
541+
public SetPublishSettings setPublishSettings(java.lang.String formId, com.google.api.services.forms.v1.model.SetPublishSettingsRequest content) throws java.io.IOException {
542+
SetPublishSettings result = new SetPublishSettings(formId, content);
543+
initialize(result);
544+
return result;
545+
}
546+
547+
public class SetPublishSettings extends FormsRequest<com.google.api.services.forms.v1.model.SetPublishSettingsResponse> {
548+
549+
private static final String REST_PATH = "v1/forms/{formId}:setPublishSettings";
550+
551+
/**
552+
* Updates the publish settings of a form. Legacy forms aren't supported because they don't have
553+
* the `publish_settings` field.
554+
*
555+
* Create a request for the method "forms.setPublishSettings".
556+
*
557+
* This request holds the parameters needed by the the forms server. After setting any optional
558+
* parameters, call the {@link SetPublishSettings#execute()} method to invoke the remote
559+
* operation. <p> {@link SetPublishSettings#initialize(com.google.api.client.googleapis.services.A
560+
* bstractGoogleClientRequest)} must be called to initialize this instance immediately after
561+
* invoking the constructor. </p>
562+
*
563+
* @param formId Required. The ID of the form. You can get the id from `Form.form_id` field.
564+
* @param content the {@link com.google.api.services.forms.v1.model.SetPublishSettingsRequest}
565+
* @since 1.13
566+
*/
567+
protected SetPublishSettings(java.lang.String formId, com.google.api.services.forms.v1.model.SetPublishSettingsRequest content) {
568+
super(Forms.this, "POST", REST_PATH, content, com.google.api.services.forms.v1.model.SetPublishSettingsResponse.class);
569+
this.formId = com.google.api.client.util.Preconditions.checkNotNull(formId, "Required parameter formId must be specified.");
570+
}
571+
572+
@Override
573+
public SetPublishSettings set$Xgafv(java.lang.String $Xgafv) {
574+
return (SetPublishSettings) super.set$Xgafv($Xgafv);
575+
}
576+
577+
@Override
578+
public SetPublishSettings setAccessToken(java.lang.String accessToken) {
579+
return (SetPublishSettings) super.setAccessToken(accessToken);
580+
}
581+
582+
@Override
583+
public SetPublishSettings setAlt(java.lang.String alt) {
584+
return (SetPublishSettings) super.setAlt(alt);
585+
}
586+
587+
@Override
588+
public SetPublishSettings setCallback(java.lang.String callback) {
589+
return (SetPublishSettings) super.setCallback(callback);
590+
}
591+
592+
@Override
593+
public SetPublishSettings setFields(java.lang.String fields) {
594+
return (SetPublishSettings) super.setFields(fields);
595+
}
596+
597+
@Override
598+
public SetPublishSettings setKey(java.lang.String key) {
599+
return (SetPublishSettings) super.setKey(key);
600+
}
601+
602+
@Override
603+
public SetPublishSettings setOauthToken(java.lang.String oauthToken) {
604+
return (SetPublishSettings) super.setOauthToken(oauthToken);
605+
}
606+
607+
@Override
608+
public SetPublishSettings setPrettyPrint(java.lang.Boolean prettyPrint) {
609+
return (SetPublishSettings) super.setPrettyPrint(prettyPrint);
610+
}
611+
612+
@Override
613+
public SetPublishSettings setQuotaUser(java.lang.String quotaUser) {
614+
return (SetPublishSettings) super.setQuotaUser(quotaUser);
615+
}
616+
617+
@Override
618+
public SetPublishSettings setUploadType(java.lang.String uploadType) {
619+
return (SetPublishSettings) super.setUploadType(uploadType);
620+
}
621+
622+
@Override
623+
public SetPublishSettings setUploadProtocol(java.lang.String uploadProtocol) {
624+
return (SetPublishSettings) super.setUploadProtocol(uploadProtocol);
625+
}
626+
627+
/** Required. The ID of the form. You can get the id from `Form.form_id` field. */
628+
@com.google.api.client.util.Key
629+
private java.lang.String formId;
630+
631+
/** Required. The ID of the form. You can get the id from `Form.form_id` field.
632+
*/
633+
public java.lang.String getFormId() {
634+
return formId;
635+
}
636+
637+
/** Required. The ID of the form. You can get the id from `Form.form_id` field. */
638+
public SetPublishSettings setFormId(java.lang.String formId) {
639+
this.formId = formId;
640+
return this;
641+
}
642+
643+
@Override
644+
public SetPublishSettings set(String parameterName, Object value) {
645+
return (SetPublishSettings) super.set(parameterName, value);
646+
}
647+
}
505648

506649
/**
507650
* An accessor for creating requests from the Responses collection.

clients/google-api-services-forms/v1/2.0.0/com/google/api/services/forms/v1/model/Form.java

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,20 @@ public final class Form extends com.google.api.client.json.GenericJson {
6060
@com.google.api.client.util.Key
6161
private java.lang.String linkedSheetId;
6262

63+
/**
64+
* Output only. The publishing settings for a form. This field isn't set for legacy forms because
65+
* they don't have the `publish_settings` field. All newly created forms support publish settings.
66+
* Forms with `publish_settings` value set can call SetPublishSettings API to publish or unpublish
67+
* the form.
68+
* The value may be {@code null}.
69+
*/
70+
@com.google.api.client.util.Key
71+
private PublishSettings publishSettings;
72+
6373
/**
6474
* Output only. The form URI to share with responders. This opens a page that allows the user to
65-
* submit responses but not edit the questions.
75+
* submit responses but not edit the questions. For forms that have `publish_settings` value set,
76+
* this is the published form URI.
6677
* The value may be {@code null}.
6778
*/
6879
@com.google.api.client.util.Key
@@ -73,9 +84,11 @@ public final class Form extends com.google.api.client.json.GenericJson {
7384
* identify the revision on which the changes are based. The format of the revision ID may change
7485
* over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be
7586
* valid for 24 hours after it has been returned and cannot be shared across users. If the
76-
* revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID
77-
* (for the same form and user) usually means the form has been updated; however, a changed ID can
78-
* also be due to internal factors such as ID format changes.
87+
* revision ID is unchanged between calls, then the form *content* has not changed. Conversely, a
88+
* changed ID (for the same form and user) usually means the form *content* has been updated;
89+
* however, a changed ID can also be due to internal factors such as ID format changes. Form
90+
* content excludes form metadata, including: * sharing settings (who has access to the form) *
91+
* `publish_settings` (if the form supports publishing and if it is published)
7992
* The value may be {@code null}.
8093
*/
8194
@com.google.api.client.util.Key
@@ -161,9 +174,33 @@ public Form setLinkedSheetId(java.lang.String linkedSheetId) {
161174
return this;
162175
}
163176

177+
/**
178+
* Output only. The publishing settings for a form. This field isn't set for legacy forms because
179+
* they don't have the `publish_settings` field. All newly created forms support publish settings.
180+
* Forms with `publish_settings` value set can call SetPublishSettings API to publish or unpublish
181+
* the form.
182+
* @return value or {@code null} for none
183+
*/
184+
public PublishSettings getPublishSettings() {
185+
return publishSettings;
186+
}
187+
188+
/**
189+
* Output only. The publishing settings for a form. This field isn't set for legacy forms because
190+
* they don't have the `publish_settings` field. All newly created forms support publish settings.
191+
* Forms with `publish_settings` value set can call SetPublishSettings API to publish or unpublish
192+
* the form.
193+
* @param publishSettings publishSettings or {@code null} for none
194+
*/
195+
public Form setPublishSettings(PublishSettings publishSettings) {
196+
this.publishSettings = publishSettings;
197+
return this;
198+
}
199+
164200
/**
165201
* Output only. The form URI to share with responders. This opens a page that allows the user to
166-
* submit responses but not edit the questions.
202+
* submit responses but not edit the questions. For forms that have `publish_settings` value set,
203+
* this is the published form URI.
167204
* @return value or {@code null} for none
168205
*/
169206
public java.lang.String getResponderUri() {
@@ -172,7 +209,8 @@ public java.lang.String getResponderUri() {
172209

173210
/**
174211
* Output only. The form URI to share with responders. This opens a page that allows the user to
175-
* submit responses but not edit the questions.
212+
* submit responses but not edit the questions. For forms that have `publish_settings` value set,
213+
* this is the published form URI.
176214
* @param responderUri responderUri or {@code null} for none
177215
*/
178216
public Form setResponderUri(java.lang.String responderUri) {
@@ -185,9 +223,11 @@ public Form setResponderUri(java.lang.String responderUri) {
185223
* identify the revision on which the changes are based. The format of the revision ID may change
186224
* over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be
187225
* valid for 24 hours after it has been returned and cannot be shared across users. If the
188-
* revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID
189-
* (for the same form and user) usually means the form has been updated; however, a changed ID can
190-
* also be due to internal factors such as ID format changes.
226+
* revision ID is unchanged between calls, then the form *content* has not changed. Conversely, a
227+
* changed ID (for the same form and user) usually means the form *content* has been updated;
228+
* however, a changed ID can also be due to internal factors such as ID format changes. Form
229+
* content excludes form metadata, including: * sharing settings (who has access to the form) *
230+
* `publish_settings` (if the form supports publishing and if it is published)
191231
* @return value or {@code null} for none
192232
*/
193233
public java.lang.String getRevisionId() {
@@ -199,9 +239,11 @@ public java.lang.String getRevisionId() {
199239
* identify the revision on which the changes are based. The format of the revision ID may change
200240
* over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be
201241
* valid for 24 hours after it has been returned and cannot be shared across users. If the
202-
* revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID
203-
* (for the same form and user) usually means the form has been updated; however, a changed ID can
204-
* also be due to internal factors such as ID format changes.
242+
* revision ID is unchanged between calls, then the form *content* has not changed. Conversely, a
243+
* changed ID (for the same form and user) usually means the form *content* has been updated;
244+
* however, a changed ID can also be due to internal factors such as ID format changes. Form
245+
* content excludes form metadata, including: * sharing settings (who has access to the form) *
246+
* `publish_settings` (if the form supports publishing and if it is published)
205247
* @param revisionId revisionId or {@code null} for none
206248
*/
207249
public Form setRevisionId(java.lang.String revisionId) {
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
3+
* in compliance with the License. You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under the License
8+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9+
* or implied. See the License for the specific language governing permissions and limitations under
10+
* the License.
11+
*/
12+
/*
13+
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
14+
* Modify at your own risk.
15+
*/
16+
17+
package com.google.api.services.forms.v1.model;
18+
19+
/**
20+
* The publishing settings of a form.
21+
*
22+
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
23+
* transmitted over HTTP when working with the Google Forms API. For a detailed explanation see:
24+
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
25+
* </p>
26+
*
27+
* @author Google, Inc.
28+
*/
29+
@SuppressWarnings("javadoc")
30+
public final class PublishSettings extends com.google.api.client.json.GenericJson {
31+
32+
/**
33+
* Optional. The publishing state of a form. When updating `publish_state`, both `is_published`
34+
* and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true`
35+
* and `is_published` to `false` isn't supported and returns an error.
36+
* The value may be {@code null}.
37+
*/
38+
@com.google.api.client.util.Key
39+
private PublishState publishState;
40+
41+
/**
42+
* Optional. The publishing state of a form. When updating `publish_state`, both `is_published`
43+
* and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true`
44+
* and `is_published` to `false` isn't supported and returns an error.
45+
* @return value or {@code null} for none
46+
*/
47+
public PublishState getPublishState() {
48+
return publishState;
49+
}
50+
51+
/**
52+
* Optional. The publishing state of a form. When updating `publish_state`, both `is_published`
53+
* and `is_accepting_responses` must be set. However, setting `is_accepting_responses` to `true`
54+
* and `is_published` to `false` isn't supported and returns an error.
55+
* @param publishState publishState or {@code null} for none
56+
*/
57+
public PublishSettings setPublishState(PublishState publishState) {
58+
this.publishState = publishState;
59+
return this;
60+
}
61+
62+
@Override
63+
public PublishSettings set(String fieldName, Object value) {
64+
return (PublishSettings) super.set(fieldName, value);
65+
}
66+
67+
@Override
68+
public PublishSettings clone() {
69+
return (PublishSettings) super.clone();
70+
}
71+
72+
}

0 commit comments

Comments
 (0)