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\Sasportal\Resource; 19 20use Google\Service\Sasportal\SasPortalEmpty; 21use Google\Service\Sasportal\SasPortalListNodesResponse; 22use Google\Service\Sasportal\SasPortalMoveNodeRequest; 23use Google\Service\Sasportal\SasPortalNode; 24use Google\Service\Sasportal\SasPortalOperation; 25 26/** 27 * The "nodes" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $sasportalService = new Google\Service\Sasportal(...); 31 * $nodes = $sasportalService->nodes; 32 * </code> 33 */ 34class NodesNodes extends \Google\Service\Resource 35{ 36 /** 37 * Creates a new node. (nodes.create) 38 * 39 * @param string $parent Required. The parent resource name where the node is to 40 * be created. 41 * @param SasPortalNode $postBody 42 * @param array $optParams Optional parameters. 43 * @return SasPortalNode 44 */ 45 public function create($parent, SasPortalNode $postBody, $optParams = []) 46 { 47 $params = ['parent' => $parent, 'postBody' => $postBody]; 48 $params = array_merge($params, $optParams); 49 return $this->call('create', [$params], SasPortalNode::class); 50 } 51 /** 52 * Deletes a node. (nodes.delete) 53 * 54 * @param string $name Required. The name of the node. 55 * @param array $optParams Optional parameters. 56 * @return SasPortalEmpty 57 */ 58 public function delete($name, $optParams = []) 59 { 60 $params = ['name' => $name]; 61 $params = array_merge($params, $optParams); 62 return $this->call('delete', [$params], SasPortalEmpty::class); 63 } 64 /** 65 * Returns a requested node. (nodes.get) 66 * 67 * @param string $name Required. The name of the node. 68 * @param array $optParams Optional parameters. 69 * @return SasPortalNode 70 */ 71 public function get($name, $optParams = []) 72 { 73 $params = ['name' => $name]; 74 $params = array_merge($params, $optParams); 75 return $this->call('get', [$params], SasPortalNode::class); 76 } 77 /** 78 * Lists nodes. (nodes.listNodesNodes) 79 * 80 * @param string $parent Required. The parent resource name, for example, 81 * "nodes/1". 82 * @param array $optParams Optional parameters. 83 * 84 * @opt_param string filter The filter expression. The filter should have the 85 * following format: "DIRECT_CHILDREN" or format: "direct_children". The filter 86 * is case insensitive. If empty, then no nodes are filtered. 87 * @opt_param int pageSize The maximum number of nodes to return in the 88 * response. 89 * @opt_param string pageToken A pagination token returned from a previous call 90 * to ListNodes that indicates where this listing should continue from. 91 * @return SasPortalListNodesResponse 92 */ 93 public function listNodesNodes($parent, $optParams = []) 94 { 95 $params = ['parent' => $parent]; 96 $params = array_merge($params, $optParams); 97 return $this->call('list', [$params], SasPortalListNodesResponse::class); 98 } 99 /** 100 * Moves a node under another node or customer. (nodes.move) 101 * 102 * @param string $name Required. The name of the node to move. 103 * @param SasPortalMoveNodeRequest $postBody 104 * @param array $optParams Optional parameters. 105 * @return SasPortalOperation 106 */ 107 public function move($name, SasPortalMoveNodeRequest $postBody, $optParams = []) 108 { 109 $params = ['name' => $name, 'postBody' => $postBody]; 110 $params = array_merge($params, $optParams); 111 return $this->call('move', [$params], SasPortalOperation::class); 112 } 113 /** 114 * Updates an existing node. (nodes.patch) 115 * 116 * @param string $name Output only. Resource name. 117 * @param SasPortalNode $postBody 118 * @param array $optParams Optional parameters. 119 * 120 * @opt_param string updateMask Fields to be updated. 121 * @return SasPortalNode 122 */ 123 public function patch($name, SasPortalNode $postBody, $optParams = []) 124 { 125 $params = ['name' => $name, 'postBody' => $postBody]; 126 $params = array_merge($params, $optParams); 127 return $this->call('patch', [$params], SasPortalNode::class); 128 } 129} 130 131// Adding a class alias for backwards compatibility with the previous class name. 132class_alias(NodesNodes::class, 'Google_Service_Sasportal_Resource_NodesNodes'); 133