@maxim_mazurok/gapi.client.forms-v1 0.0.20250218 → 0.0.20250304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +87 -1
  2. package/package.json +1 -1
  3. package/readme.md +5 -0
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://forms.googleapis.com/$discovery/rest?version=v1
12
- // Revision: 20250218
12
+ // Revision: 20250304
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -142,6 +142,8 @@ declare namespace gapi.client {
142
142
  items?: Item[];
143
143
  /** Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists). */
144
144
  linkedSheetId?: string;
145
+ /** 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. */
146
+ publishSettings?: PublishSettings;
145
147
  /** 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. */
146
148
  responderUri?: string;
147
149
  /** 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. */
@@ -278,6 +280,16 @@ declare namespace gapi.client {
278
280
  value?: string;
279
281
  }
280
282
  interface PageBreakItem {}
283
+ interface PublishSettings {
284
+ /** 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. */
285
+ publishState?: PublishState;
286
+ }
287
+ interface PublishState {
288
+ /** Required. Whether the form accepts responses. If `is_published` is set to `false`, this field is forced to `false`. */
289
+ isAcceptingResponses?: boolean;
290
+ /** Required. Whether the form is published and visible to others. */
291
+ isPublished?: boolean;
292
+ }
281
293
  interface Question {
282
294
  /** A respondent can choose from a pre-defined set of options. */
283
295
  choiceQuestion?: ChoiceQuestion;
@@ -359,6 +371,18 @@ declare namespace gapi.client {
359
371
  /** The label to display describing the lowest point on the scale. */
360
372
  lowLabel?: string;
361
373
  }
374
+ interface SetPublishSettingsRequest {
375
+ /** Required. The desired publish settings to apply to the form. */
376
+ publishSettings?: PublishSettings;
377
+ /** 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. */
378
+ updateMask?: string;
379
+ }
380
+ interface SetPublishSettingsResponse {
381
+ /** Required. The ID of the Form. This is same as the `Form.form_id` field. */
382
+ formId?: string;
383
+ /** The publish settings of the form. */
384
+ publishSettings?: PublishSettings;
385
+ }
362
386
  interface TextAnswer {
363
387
  /** Output only. The answer value. Formatting used for different kinds of question: * ChoiceQuestion * `RADIO` or `DROP_DOWN`: A single string corresponding to the option that was selected. * `CHECKBOX`: Multiple strings corresponding to each option that was selected. * TextQuestion: The text that the user entered. * ScaleQuestion: A string containing the number that was selected. * DateQuestion * Without time or year: MM-DD e.g. "05-19" * With year: YYYY-MM-DD e.g. "1986-05-19" * With time: MM-DD HH:MM e.g. "05-19 14:51" * With year and time: YYYY-MM-DD HH:MM e.g. "1986-05-19 14:51" * TimeQuestion: String with time or duration in HH:MM format e.g. "14:51" * RowQuestion within QuestionGroupItem: The answer for each row of a QuestionGroupItem is represented as a separate Answer. Each will contain one string for `RADIO`-type choices or multiple strings for `CHECKBOX` choices. */
364
388
  value?: string;
@@ -767,6 +791,8 @@ declare namespace gapi.client {
767
791
  prettyPrint?: boolean;
768
792
  /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
769
793
  quotaUser?: string;
794
+ /** 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. */
795
+ unpublished?: boolean;
770
796
  /** Upload protocol for media (e.g. "raw", "multipart"). */
771
797
  upload_protocol?: string;
772
798
  /** Legacy upload protocol for media (e.g. "media", "multipart"). */
@@ -794,6 +820,8 @@ declare namespace gapi.client {
794
820
  prettyPrint?: boolean;
795
821
  /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
796
822
  quotaUser?: string;
823
+ /** 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. */
824
+ unpublished?: boolean;
797
825
  /** Upload protocol for media (e.g. "raw", "multipart"). */
798
826
  upload_protocol?: string;
799
827
  /** Legacy upload protocol for media (e.g. "media", "multipart"). */
@@ -828,6 +856,64 @@ declare namespace gapi.client {
828
856
  /** Legacy upload protocol for media (e.g. "media", "multipart"). */
829
857
  uploadType?: string;
830
858
  }): client.Request<Form>;
859
+ /** Updates the publish settings of a form. Legacy forms aren't supported because they don't have the `publish_settings` field. */
860
+ setPublishSettings(request: {
861
+ /** V1 error format. */
862
+ '$.xgafv'?: string;
863
+ /** OAuth access token. */
864
+ access_token?: string;
865
+ /** Data format for response. */
866
+ alt?: string;
867
+ /** JSONP */
868
+ callback?: string;
869
+ /** Selector specifying which fields to include in a partial response. */
870
+ fields?: string;
871
+ /** Required. The ID of the form. You can get the id from `Form.form_id` field. */
872
+ formId: string;
873
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
874
+ key?: string;
875
+ /** OAuth 2.0 token for the current user. */
876
+ oauth_token?: string;
877
+ /** Returns response with indentations and line breaks. */
878
+ prettyPrint?: boolean;
879
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
880
+ quotaUser?: string;
881
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
882
+ upload_protocol?: string;
883
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
884
+ uploadType?: string;
885
+ /** Request body */
886
+ resource: SetPublishSettingsRequest;
887
+ }): client.Request<SetPublishSettingsResponse>;
888
+ setPublishSettings(
889
+ request: {
890
+ /** V1 error format. */
891
+ '$.xgafv'?: string;
892
+ /** OAuth access token. */
893
+ access_token?: string;
894
+ /** Data format for response. */
895
+ alt?: string;
896
+ /** JSONP */
897
+ callback?: string;
898
+ /** Selector specifying which fields to include in a partial response. */
899
+ fields?: string;
900
+ /** Required. The ID of the form. You can get the id from `Form.form_id` field. */
901
+ formId: string;
902
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
903
+ key?: string;
904
+ /** OAuth 2.0 token for the current user. */
905
+ oauth_token?: string;
906
+ /** Returns response with indentations and line breaks. */
907
+ prettyPrint?: boolean;
908
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
909
+ quotaUser?: string;
910
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
911
+ upload_protocol?: string;
912
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
913
+ uploadType?: string;
914
+ },
915
+ body: SetPublishSettingsRequest,
916
+ ): client.Request<SetPublishSettingsResponse>;
831
917
  responses: ResponsesResource;
832
918
  watches: WatchesResource;
833
919
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.forms-v1",
3
- "version": "0.0.20250218",
3
+ "version": "0.0.20250304",
4
4
  "description": "TypeScript typings for Google Forms API v1",
5
5
  "repository": {
6
6
  "type": "git",
package/readme.md CHANGED
@@ -98,4 +98,9 @@ await gapi.client.forms.forms.create({});
98
98
  Get a form.
99
99
  */
100
100
  await gapi.client.forms.forms.get({formId: 'formId'});
101
+
102
+ /*
103
+ Updates the publish settings of a form. Legacy forms aren't supported because they don't have the `publish_settings` field.
104
+ */
105
+ await gapi.client.forms.forms.setPublishSettings({formId: 'formId'});
101
106
  ```