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\Datastream\Resource;
19
20use Google\Service\Datastream\ListStreamObjectsResponse;
21use Google\Service\Datastream\LookupStreamObjectRequest;
22use Google\Service\Datastream\StartBackfillJobRequest;
23use Google\Service\Datastream\StartBackfillJobResponse;
24use Google\Service\Datastream\StopBackfillJobRequest;
25use Google\Service\Datastream\StopBackfillJobResponse;
26use Google\Service\Datastream\StreamObject;
27
28/**
29 * The "objects" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $datastreamService = new Google\Service\Datastream(...);
33 *   $objects = $datastreamService->objects;
34 *  </code>
35 */
36class ProjectsLocationsStreamsObjects extends \Google\Service\Resource
37{
38  /**
39   * Use this method to get details about a stream object. (objects.get)
40   *
41   * @param string $name Required. The name of the stream object resource to get.
42   * @param array $optParams Optional parameters.
43   * @return StreamObject
44   */
45  public function get($name, $optParams = [])
46  {
47    $params = ['name' => $name];
48    $params = array_merge($params, $optParams);
49    return $this->call('get', [$params], StreamObject::class);
50  }
51  /**
52   * Use this method to list the objects of a specific stream.
53   * (objects.listProjectsLocationsStreamsObjects)
54   *
55   * @param string $parent Required. The parent stream that owns the collection of
56   * objects.
57   * @param array $optParams Optional parameters.
58   *
59   * @opt_param int pageSize Maximum number of objects to return. Default is 50.
60   * The maximum value is 1000; values above 1000 will be coerced to 1000.
61   * @opt_param string pageToken Page token received from a previous
62   * `ListStreamObjectsRequest` call. Provide this to retrieve the subsequent
63   * page. When paginating, all other parameters provided to
64   * `ListStreamObjectsRequest` must match the call that provided the page token.
65   * @return ListStreamObjectsResponse
66   */
67  public function listProjectsLocationsStreamsObjects($parent, $optParams = [])
68  {
69    $params = ['parent' => $parent];
70    $params = array_merge($params, $optParams);
71    return $this->call('list', [$params], ListStreamObjectsResponse::class);
72  }
73  /**
74   * Use this method to look up a stream object by its source object identifier.
75   * (objects.lookup)
76   *
77   * @param string $parent Required. The parent stream that owns the collection of
78   * objects.
79   * @param LookupStreamObjectRequest $postBody
80   * @param array $optParams Optional parameters.
81   * @return StreamObject
82   */
83  public function lookup($parent, LookupStreamObjectRequest $postBody, $optParams = [])
84  {
85    $params = ['parent' => $parent, 'postBody' => $postBody];
86    $params = array_merge($params, $optParams);
87    return $this->call('lookup', [$params], StreamObject::class);
88  }
89  /**
90   * Use this method to start a backfill job for the specified stream object.
91   * (objects.startBackfillJob)
92   *
93   * @param string $object Required. The name of the stream object resource to
94   * start a backfill job for.
95   * @param StartBackfillJobRequest $postBody
96   * @param array $optParams Optional parameters.
97   * @return StartBackfillJobResponse
98   */
99  public function startBackfillJob($object, StartBackfillJobRequest $postBody, $optParams = [])
100  {
101    $params = ['object' => $object, 'postBody' => $postBody];
102    $params = array_merge($params, $optParams);
103    return $this->call('startBackfillJob', [$params], StartBackfillJobResponse::class);
104  }
105  /**
106   * Use this method to stop a backfill job for the specified stream object.
107   * (objects.stopBackfillJob)
108   *
109   * @param string $object Required. The name of the stream object resource to
110   * stop the backfill job for.
111   * @param StopBackfillJobRequest $postBody
112   * @param array $optParams Optional parameters.
113   * @return StopBackfillJobResponse
114   */
115  public function stopBackfillJob($object, StopBackfillJobRequest $postBody, $optParams = [])
116  {
117    $params = ['object' => $object, 'postBody' => $postBody];
118    $params = array_merge($params, $optParams);
119    return $this->call('stopBackfillJob', [$params], StopBackfillJobResponse::class);
120  }
121}
122
123// Adding a class alias for backwards compatibility with the previous class name.
124class_alias(ProjectsLocationsStreamsObjects::class, 'Google_Service_Datastream_Resource_ProjectsLocationsStreamsObjects');
125