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\Iam\Resource; 19 20use Google\Service\Iam\ListWorkloadIdentityPoolProvidersResponse; 21use Google\Service\Iam\Operation; 22use Google\Service\Iam\UndeleteWorkloadIdentityPoolProviderRequest; 23use Google\Service\Iam\WorkloadIdentityPoolProvider; 24 25/** 26 * The "providers" collection of methods. 27 * Typical usage is: 28 * <code> 29 * $iamService = new Google\Service\Iam(...); 30 * $providers = $iamService->providers; 31 * </code> 32 */ 33class ProjectsLocationsWorkloadIdentityPoolsProviders extends \Google\Service\Resource 34{ 35 /** 36 * Creates a new WorkloadIdentityPoolProvider in a WorkloadIdentityPool. You 37 * cannot reuse the name of a deleted provider until 30 days after deletion. 38 * (providers.create) 39 * 40 * @param string $parent Required. The pool to create this provider in. 41 * @param WorkloadIdentityPoolProvider $postBody 42 * @param array $optParams Optional parameters. 43 * 44 * @opt_param string workloadIdentityPoolProviderId Required. The ID for the 45 * provider, which becomes the final component of the resource name. This value 46 * must be 4-32 characters, and may contain the characters [a-z0-9-]. The prefix 47 * `gcp-` is reserved for use by Google, and may not be specified. 48 * @return Operation 49 */ 50 public function create($parent, WorkloadIdentityPoolProvider $postBody, $optParams = []) 51 { 52 $params = ['parent' => $parent, 'postBody' => $postBody]; 53 $params = array_merge($params, $optParams); 54 return $this->call('create', [$params], Operation::class); 55 } 56 /** 57 * Deletes a WorkloadIdentityPoolProvider. Deleting a provider does not revoke 58 * credentials that have already been issued; they continue to grant access. You 59 * can undelete a provider for 30 days. After 30 days, deletion is permanent. 60 * You cannot update deleted providers. However, you can view and list them. 61 * (providers.delete) 62 * 63 * @param string $name Required. The name of the provider to delete. 64 * @param array $optParams Optional parameters. 65 * @return Operation 66 */ 67 public function delete($name, $optParams = []) 68 { 69 $params = ['name' => $name]; 70 $params = array_merge($params, $optParams); 71 return $this->call('delete', [$params], Operation::class); 72 } 73 /** 74 * Gets an individual WorkloadIdentityPoolProvider. (providers.get) 75 * 76 * @param string $name Required. The name of the provider to retrieve. 77 * @param array $optParams Optional parameters. 78 * @return WorkloadIdentityPoolProvider 79 */ 80 public function get($name, $optParams = []) 81 { 82 $params = ['name' => $name]; 83 $params = array_merge($params, $optParams); 84 return $this->call('get', [$params], WorkloadIdentityPoolProvider::class); 85 } 86 /** 87 * Lists all non-deleted WorkloadIdentityPoolProviders in a 88 * WorkloadIdentityPool. If `show_deleted` is set to `true`, then deleted 89 * providers are also listed. 90 * (providers.listProjectsLocationsWorkloadIdentityPoolsProviders) 91 * 92 * @param string $parent Required. The pool to list providers for. 93 * @param array $optParams Optional parameters. 94 * 95 * @opt_param int pageSize The maximum number of providers to return. If 96 * unspecified, at most 50 providers are returned. The maximum value is 100; 97 * values above 100 are truncated to 100. 98 * @opt_param string pageToken A page token, received from a previous 99 * `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the 100 * subsequent page. 101 * @opt_param bool showDeleted Whether to return soft-deleted providers. 102 * @return ListWorkloadIdentityPoolProvidersResponse 103 */ 104 public function listProjectsLocationsWorkloadIdentityPoolsProviders($parent, $optParams = []) 105 { 106 $params = ['parent' => $parent]; 107 $params = array_merge($params, $optParams); 108 return $this->call('list', [$params], ListWorkloadIdentityPoolProvidersResponse::class); 109 } 110 /** 111 * Updates an existing WorkloadIdentityPoolProvider. (providers.patch) 112 * 113 * @param string $name Output only. The resource name of the provider. 114 * @param WorkloadIdentityPoolProvider $postBody 115 * @param array $optParams Optional parameters. 116 * 117 * @opt_param string updateMask Required. The list of fields to update. 118 * @return Operation 119 */ 120 public function patch($name, WorkloadIdentityPoolProvider $postBody, $optParams = []) 121 { 122 $params = ['name' => $name, 'postBody' => $postBody]; 123 $params = array_merge($params, $optParams); 124 return $this->call('patch', [$params], Operation::class); 125 } 126 /** 127 * Undeletes a WorkloadIdentityPoolProvider, as long as it was deleted fewer 128 * than 30 days ago. (providers.undelete) 129 * 130 * @param string $name Required. The name of the provider to undelete. 131 * @param UndeleteWorkloadIdentityPoolProviderRequest $postBody 132 * @param array $optParams Optional parameters. 133 * @return Operation 134 */ 135 public function undelete($name, UndeleteWorkloadIdentityPoolProviderRequest $postBody, $optParams = []) 136 { 137 $params = ['name' => $name, 'postBody' => $postBody]; 138 $params = array_merge($params, $optParams); 139 return $this->call('undelete', [$params], Operation::class); 140 } 141} 142 143// Adding a class alias for backwards compatibility with the previous class name. 144class_alias(ProjectsLocationsWorkloadIdentityPoolsProviders::class, 'Google_Service_Iam_Resource_ProjectsLocationsWorkloadIdentityPoolsProviders'); 145