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 |
|
---|
18 | namespace Google\Service\Forms\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Forms\FormResponse;
|
---|
21 | use Google\Service\Forms\ListFormResponsesResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "responses" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $formsService = new Google\Service\Forms(...);
|
---|
28 | * $responses = $formsService->forms_responses;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class FormsResponses extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Get one response from the form. (responses.get)
|
---|
35 | *
|
---|
36 | * @param string $formId Required. The form ID.
|
---|
37 | * @param string $responseId Required. The response ID within the form.
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return FormResponse
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function get($formId, $responseId, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['formId' => $formId, 'responseId' => $responseId];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('get', [$params], FormResponse::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * List a form's responses. (responses.listFormsResponses)
|
---|
50 | *
|
---|
51 | * @param string $formId Required. ID of the Form whose responses to list.
|
---|
52 | * @param array $optParams Optional parameters.
|
---|
53 | *
|
---|
54 | * @opt_param string filter Which form responses to return. Currently, the only
|
---|
55 | * supported filters are: * timestamp > *N* which means to get all form
|
---|
56 | * responses submitted after (but not at) timestamp *N*. * timestamp >= *N*
|
---|
57 | * which means to get all form responses submitted at and after timestamp *N*.
|
---|
58 | * For both supported filters, timestamp must be formatted in RFC3339 UTC "Zulu"
|
---|
59 | * format. Examples: "2014-10-02T15:01:23Z" and
|
---|
60 | * "2014-10-02T15:01:23.045123456Z".
|
---|
61 | * @opt_param int pageSize The maximum number of responses to return. The
|
---|
62 | * service may return fewer than this value. If unspecified or zero, at most
|
---|
63 | * 5000 responses are returned.
|
---|
64 | * @opt_param string pageToken A page token returned by a previous list
|
---|
65 | * response. If this field is set, the form and the values of the filter must be
|
---|
66 | * the same as for the original request.
|
---|
67 | * @return ListFormResponsesResponse
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function listFormsResponses($formId, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['formId' => $formId];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('list', [$params], ListFormResponsesResponse::class);
|
---|
75 | }
|
---|
76 | }
|
---|
77 |
|
---|
78 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
79 | class_alias(FormsResponses::class, 'Google_Service_Forms_Resource_FormsResponses');
|
---|