source: vendor/google/apiclient-services/src/Forms/Resource/Forms.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 2.9 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Forms\Resource;
19
20use Google\Service\Forms\BatchUpdateFormRequest;
21use Google\Service\Forms\BatchUpdateFormResponse;
22use Google\Service\Forms\Form;
23
24/**
25 * The "forms" collection of methods.
26 * Typical usage is:
27 * <code>
28 * $formsService = new Google\Service\Forms(...);
29 * $forms = $formsService->forms;
30 * </code>
31 */
32class Forms extends \Google\Service\Resource
33{
34 /**
35 * Change the form with a batch of updates. (forms.batchUpdate)
36 *
37 * @param string $formId Required. The form ID.
38 * @param BatchUpdateFormRequest $postBody
39 * @param array $optParams Optional parameters.
40 * @return BatchUpdateFormResponse
41 * @throws \Google\Service\Exception
42 */
43 public function batchUpdate($formId, BatchUpdateFormRequest $postBody, $optParams = [])
44 {
45 $params = ['formId' => $formId, 'postBody' => $postBody];
46 $params = array_merge($params, $optParams);
47 return $this->call('batchUpdate', [$params], BatchUpdateFormResponse::class);
48 }
49 /**
50 * Create a new form using the title given in the provided form message in the
51 * request. *Important:* Only the form.info.title and form.info.document_title
52 * fields are copied to the new form. All other fields including the form
53 * description, items and settings are disallowed. To create a new form and add
54 * items, you must first call forms.create to create an empty form with a title
55 * and (optional) document title, and then call forms.update to add the items.
56 * (forms.create)
57 *
58 * @param Form $postBody
59 * @param array $optParams Optional parameters.
60 * @return Form
61 * @throws \Google\Service\Exception
62 */
63 public function create(Form $postBody, $optParams = [])
64 {
65 $params = ['postBody' => $postBody];
66 $params = array_merge($params, $optParams);
67 return $this->call('create', [$params], Form::class);
68 }
69 /**
70 * Get a form. (forms.get)
71 *
72 * @param string $formId Required. The form ID.
73 * @param array $optParams Optional parameters.
74 * @return Form
75 * @throws \Google\Service\Exception
76 */
77 public function get($formId, $optParams = [])
78 {
79 $params = ['formId' => $formId];
80 $params = array_merge($params, $optParams);
81 return $this->call('get', [$params], Form::class);
82 }
83}
84
85// Adding a class alias for backwards compatibility with the previous class name.
86class_alias(Forms::class, 'Google_Service_Forms_Resource_Forms');
Note: See TracBrowser for help on using the repository browser.