* $readerrevenuesubscriptionlinkingService = new Google\Service\SubscriptionLinking(...); * $readers = $readerrevenuesubscriptionlinkingService->publications_readers; * */ class PublicationsReaders extends \Google\Service\Resource { /** * Removes a publication reader, effectively severing the association with a * Google user. If `force` is set to true, any entitlements for this reader will * also be deleted. (Otherwise, the request will only work if the reader has no * entitlements.) - If the reader does not exist, return NOT_FOUND. - Return * FAILED_PRECONDITION if the force field is false (or unset) and entitlements * are present. (readers.delete) * * @param string $name Required. The resource name of the reader. Format: * publications/{publication_id}/readers/{ppid} * @param array $optParams Optional parameters. * * @opt_param bool force If set to true, any entitlements under the reader will * also be purged. * @return DeleteReaderResponse * @throws \Google\Service\Exception */ public function delete($name, $optParams = []) { $params = ['name' => $name]; $params = array_merge($params, $optParams); return $this->call('delete', [$params], DeleteReaderResponse::class); } /** * Gets a reader of a publication. Returns NOT_FOUND if the reader does not * exist. (readers.get) * * @param string $name Required. The resource name of the reader. Format: * publications/{publication_id}/readers/{ppid} * @param array $optParams Optional parameters. * @return Reader * @throws \Google\Service\Exception */ public function get($name, $optParams = []) { $params = ['name' => $name]; $params = array_merge($params, $optParams); return $this->call('get', [$params], Reader::class); } /** * Gets the reader entitlements for a publication reader. - Returns * PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if * the reader does not exist. (readers.getEntitlements) * * @param string $name Required. The name of the reader entitlements to * retrieve. Format: * publications/{publication_id}/readers/{reader_id}/entitlements * @param array $optParams Optional parameters. * @return ReaderEntitlements * @throws \Google\Service\Exception */ public function getEntitlements($name, $optParams = []) { $params = ['name' => $name]; $params = array_merge($params, $optParams); return $this->call('getEntitlements', [$params], ReaderEntitlements::class); } /** * Updates the reader entitlements for a publication reader. The entire reader * entitlements will be overwritten by the new reader entitlements in the * payload, like a PUT. - Returns PERMISSION_DENIED if the caller does not have * access. - Returns NOT_FOUND if the reader does not exist. * (readers.updateEntitlements) * * @param string $name Output only. The resource name of the singleton. * @param ReaderEntitlements $postBody * @param array $optParams Optional parameters. * * @opt_param string updateMask Optional. The list of fields to update. Defaults * to all fields. * @return ReaderEntitlements * @throws \Google\Service\Exception */ public function updateEntitlements($name, ReaderEntitlements $postBody, $optParams = []) { $params = ['name' => $name, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('updateEntitlements', [$params], ReaderEntitlements::class); } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(PublicationsReaders::class, 'Google_Service_SubscriptionLinking_Resource_PublicationsReaders');