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\PolicySimulator\Resource;
19
20use Google\Service\PolicySimulator\GoogleCloudPolicysimulatorV1Replay;
21use Google\Service\PolicySimulator\GoogleLongrunningOperation;
22
23/**
24 * The "replays" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $policysimulatorService = new Google\Service\PolicySimulator(...);
28 *   $replays = $policysimulatorService->replays;
29 *  </code>
30 */
31class FoldersLocationsReplays extends \Google\Service\Resource
32{
33  /**
34   * Creates and starts a Replay using the given ReplayConfig. (replays.create)
35   *
36   * @param string $parent Required. The parent resource where this Replay will be
37   * created. This resource must be a project, folder, or organization with a
38   * location. Example: `projects/my-example-project/locations/global`
39   * @param GoogleCloudPolicysimulatorV1Replay $postBody
40   * @param array $optParams Optional parameters.
41   * @return GoogleLongrunningOperation
42   */
43  public function create($parent, GoogleCloudPolicysimulatorV1Replay $postBody, $optParams = [])
44  {
45    $params = ['parent' => $parent, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], GoogleLongrunningOperation::class);
48  }
49  /**
50   * Gets the specified Replay. Each `Replay` is available for at least 7 days.
51   * (replays.get)
52   *
53   * @param string $name Required. The name of the Replay to retrieve, in the
54   * following format: `{projects|folders|organizations}/{resource-
55   * id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of
56   * the project, folder, or organization that owns the `Replay`. Example:
57   * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-
58   * 8e03-479ce1833c36`
59   * @param array $optParams Optional parameters.
60   * @return GoogleCloudPolicysimulatorV1Replay
61   */
62  public function get($name, $optParams = [])
63  {
64    $params = ['name' => $name];
65    $params = array_merge($params, $optParams);
66    return $this->call('get', [$params], GoogleCloudPolicysimulatorV1Replay::class);
67  }
68}
69
70// Adding a class alias for backwards compatibility with the previous class name.
71class_alias(FoldersLocationsReplays::class, 'Google_Service_PolicySimulator_Resource_FoldersLocationsReplays');
72