1<?php
2/*
3 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 * use this file except in compliance with the License. You may obtain a copy of
5 * the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 * License for the specific language governing permissions and limitations under
13 * the License.
14 */
15
16
17  /**
18   * The "activities" collection of methods.
19   * Typical usage is:
20   *  <code>
21   *   $auditService = new Google_AuditService(...);
22   *   $activities = $auditService->activities;
23   *  </code>
24   */
25  class Google_ActivitiesServiceResource extends Google_ServiceResource {
26
27    /**
28     * Retrieves a list of activities for a specific customer and application. (activities.list)
29     *
30     * @param string $customerId Represents the customer who is the owner of target object on which action was performed.
31     * @param string $applicationId Application ID of the application on which the event was performed.
32     * @param array $optParams Optional parameters.
33     *
34     * @opt_param string actorApplicationId Application ID of the application which interacted on behalf of the user while performing the event.
35     * @opt_param string actorEmail Email address of the user who performed the action.
36     * @opt_param string actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.
37     * @opt_param string caller Type of the caller.
38     * @opt_param string continuationToken Next page URL.
39     * @opt_param string endTime Return events which occured at or before this time.
40     * @opt_param string eventName Name of the event being queried.
41     * @opt_param int maxResults Number of activity records to be shown in each page.
42     * @opt_param string startTime Return events which occured at or after this time.
43     * @return Google_Activities
44     */
45    public function listActivities($customerId, $applicationId, $optParams = array()) {
46      $params = array('customerId' => $customerId, 'applicationId' => $applicationId);
47      $params = array_merge($params, $optParams);
48      $data = $this->__call('list', array($params));
49      if ($this->useObjects()) {
50        return new Google_Activities($data);
51      } else {
52        return $data;
53      }
54    }
55  }
56
57/**
58 * Service definition for Google_Audit (v1).
59 *
60 * <p>
61 * Lets you access user activities in your enterprise made through various applications.
62 * </p>
63 *
64 * <p>
65 * For more information about this service, see the
66 * <a href="https://developers.google.com/google-apps/admin-audit/get_started" target="_blank">API Documentation</a>
67 * </p>
68 *
69 * @author Google, Inc.
70 */
71class Google_AuditService extends Google_Service {
72  public $activities;
73  /**
74   * Constructs the internal representation of the Audit service.
75   *
76   * @param Google_Client $client
77   */
78  public function __construct(Google_Client $client) {
79    $this->servicePath = 'apps/reporting/audit/v1/';
80    $this->version = 'v1';
81    $this->serviceName = 'audit';
82
83    $client->addService($this->serviceName, $this->version);
84    $this->activities = new Google_ActivitiesServiceResource($this, $this->serviceName, 'activities', json_decode('{"methods": {"list": {"id": "audit.activities.list", "path": "{customerId}/{applicationId}", "httpMethod": "GET", "parameters": {"actorApplicationId": {"type": "string", "format": "int64", "location": "query"}, "actorEmail": {"type": "string", "location": "query"}, "actorIpAddress": {"type": "string", "location": "query"}, "applicationId": {"type": "string", "required": true, "format": "int64", "location": "path"}, "caller": {"type": "string", "enum": ["application_owner", "customer"], "location": "query"}, "continuationToken": {"type": "string", "location": "query"}, "customerId": {"type": "string", "required": true, "location": "path"}, "endTime": {"type": "string", "location": "query"}, "eventName": {"type": "string", "location": "query"}, "maxResults": {"type": "integer", "format": "int32", "minimum": "1", "maximum": "1000", "location": "query"}, "startTime": {"type": "string", "location": "query"}}, "response": {"$ref": "Activities"}}}}', true));
85
86  }
87}
88
89
90
91class Google_Activities extends Google_Model {
92  protected $__itemsType = 'Google_Activity';
93  protected $__itemsDataType = 'array';
94  public $items;
95  public $kind;
96  public $next;
97  public function setItems(/* array(Google_Activity) */ $items) {
98    $this->assertIsArray($items, 'Google_Activity', __METHOD__);
99    $this->items = $items;
100  }
101  public function getItems() {
102    return $this->items;
103  }
104  public function setKind( $kind) {
105    $this->kind = $kind;
106  }
107  public function getKind() {
108    return $this->kind;
109  }
110  public function setNext( $next) {
111    $this->next = $next;
112  }
113  public function getNext() {
114    return $this->next;
115  }
116}
117
118class Google_Activity extends Google_Model {
119  protected $__actorType = 'Google_ActivityActor';
120  protected $__actorDataType = '';
121  public $actor;
122  protected $__eventsType = 'Google_ActivityEvents';
123  protected $__eventsDataType = 'array';
124  public $events;
125  protected $__idType = 'Google_ActivityId';
126  protected $__idDataType = '';
127  public $id;
128  public $ipAddress;
129  public $kind;
130  public $ownerDomain;
131  public function setActor(Google_ActivityActor $actor) {
132    $this->actor = $actor;
133  }
134  public function getActor() {
135    return $this->actor;
136  }
137  public function setEvents(/* array(Google_ActivityEvents) */ $events) {
138    $this->assertIsArray($events, 'Google_ActivityEvents', __METHOD__);
139    $this->events = $events;
140  }
141  public function getEvents() {
142    return $this->events;
143  }
144  public function setId(Google_ActivityId $id) {
145    $this->id = $id;
146  }
147  public function getId() {
148    return $this->id;
149  }
150  public function setIpAddress( $ipAddress) {
151    $this->ipAddress = $ipAddress;
152  }
153  public function getIpAddress() {
154    return $this->ipAddress;
155  }
156  public function setKind( $kind) {
157    $this->kind = $kind;
158  }
159  public function getKind() {
160    return $this->kind;
161  }
162  public function setOwnerDomain( $ownerDomain) {
163    $this->ownerDomain = $ownerDomain;
164  }
165  public function getOwnerDomain() {
166    return $this->ownerDomain;
167  }
168}
169
170class Google_ActivityActor extends Google_Model {
171  public $applicationId;
172  public $callerType;
173  public $email;
174  public $key;
175  public function setApplicationId( $applicationId) {
176    $this->applicationId = $applicationId;
177  }
178  public function getApplicationId() {
179    return $this->applicationId;
180  }
181  public function setCallerType( $callerType) {
182    $this->callerType = $callerType;
183  }
184  public function getCallerType() {
185    return $this->callerType;
186  }
187  public function setEmail( $email) {
188    $this->email = $email;
189  }
190  public function getEmail() {
191    return $this->email;
192  }
193  public function setKey( $key) {
194    $this->key = $key;
195  }
196  public function getKey() {
197    return $this->key;
198  }
199}
200
201class Google_ActivityEvents extends Google_Model {
202  public $eventType;
203  public $name;
204  protected $__parametersType = 'Google_ActivityEventsParameters';
205  protected $__parametersDataType = 'array';
206  public $parameters;
207  public function setEventType( $eventType) {
208    $this->eventType = $eventType;
209  }
210  public function getEventType() {
211    return $this->eventType;
212  }
213  public function setName( $name) {
214    $this->name = $name;
215  }
216  public function getName() {
217    return $this->name;
218  }
219  public function setParameters(/* array(Google_ActivityEventsParameters) */ $parameters) {
220    $this->assertIsArray($parameters, 'Google_ActivityEventsParameters', __METHOD__);
221    $this->parameters = $parameters;
222  }
223  public function getParameters() {
224    return $this->parameters;
225  }
226}
227
228class Google_ActivityEventsParameters extends Google_Model {
229  public $name;
230  public $value;
231  public function setName( $name) {
232    $this->name = $name;
233  }
234  public function getName() {
235    return $this->name;
236  }
237  public function setValue( $value) {
238    $this->value = $value;
239  }
240  public function getValue() {
241    return $this->value;
242  }
243}
244
245class Google_ActivityId extends Google_Model {
246  public $applicationId;
247  public $customerId;
248  public $time;
249  public $uniqQualifier;
250  public function setApplicationId( $applicationId) {
251    $this->applicationId = $applicationId;
252  }
253  public function getApplicationId() {
254    return $this->applicationId;
255  }
256  public function setCustomerId( $customerId) {
257    $this->customerId = $customerId;
258  }
259  public function getCustomerId() {
260    return $this->customerId;
261  }
262  public function setTime( $time) {
263    $this->time = $time;
264  }
265  public function getTime() {
266    return $this->time;
267  }
268  public function setUniqQualifier( $uniqQualifier) {
269    $this->uniqQualifier = $uniqQualifier;
270  }
271  public function getUniqQualifier() {
272    return $this->uniqQualifier;
273  }
274}
275