* $integrationsService = new Google\Service\Integrations(...); * $templates = $integrationsService->projects_locations_templates; * */ class ProjectsLocationsTemplates extends \Google\Service\Resource { /** * Creates a new template (templates.create) * * @param string $parent Required. "projects/{project}/locations/{location}" * format. * @param GoogleCloudIntegrationsV1alphaTemplate $postBody * @param array $optParams Optional parameters. * @return GoogleCloudIntegrationsV1alphaTemplate * @throws \Google\Service\Exception */ public function create($parent, GoogleCloudIntegrationsV1alphaTemplate $postBody, $optParams = []) { $params = ['parent' => $parent, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('create', [$params], GoogleCloudIntegrationsV1alphaTemplate::class); } /** * Deletes a template (templates.delete) * * @param string $name Required. The name that is associated with the Template. * @param array $optParams Optional parameters. * @return GoogleProtobufEmpty * @throws \Google\Service\Exception */ public function delete($name, $optParams = []) { $params = ['name' => $name]; $params = array_merge($params, $optParams); return $this->call('delete', [$params], GoogleProtobufEmpty::class); } /** * Downloads a template. Retrieves the `Template` and returns the response as a * string. (templates.download) * * @param string $name Required. The template to download. Format: * projects/{project}/locations/{location}/template/{template_id} * @param array $optParams Optional parameters. * * @opt_param string fileFormat Required. File format for download request. * @return GoogleCloudIntegrationsV1alphaDownloadTemplateResponse * @throws \Google\Service\Exception */ public function download($name, $optParams = []) { $params = ['name' => $name]; $params = array_merge($params, $optParams); return $this->call('download', [$params], GoogleCloudIntegrationsV1alphaDownloadTemplateResponse::class); } /** * Get a template in the specified project. (templates.get) * * @param string $name Required. The template to retrieve. Format: * projects/{project}/locations/{location}/templates/{template} * @param array $optParams Optional parameters. * @return GoogleCloudIntegrationsV1alphaTemplate * @throws \Google\Service\Exception */ public function get($name, $optParams = []) { $params = ['name' => $name]; $params = array_merge($params, $optParams); return $this->call('get', [$params], GoogleCloudIntegrationsV1alphaTemplate::class); } /** * Import the template to an existing integration. This api would keep track of * usage_count and last_used_time. PERMISSION_DENIED would be thrown if template * is not accessible by client. (templates.import) * * @param string $name Required. The name that is associated with the Template. * @param GoogleCloudIntegrationsV1alphaImportTemplateRequest $postBody * @param array $optParams Optional parameters. * @return GoogleCloudIntegrationsV1alphaImportTemplateResponse * @throws \Google\Service\Exception */ public function import($name, GoogleCloudIntegrationsV1alphaImportTemplateRequest $postBody, $optParams = []) { $params = ['name' => $name, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('import', [$params], GoogleCloudIntegrationsV1alphaImportTemplateResponse::class); } /** * Lists all templates matching the filter. * (templates.listProjectsLocationsTemplates) * * @param string $parent Required. The client, which owns this collection of * Templates. * @param array $optParams Optional parameters. * * @opt_param string filter Optional. Standard filter field to filter templates. * client_id filter won't be supported and will restrict to templates belonging * to the current client only. Return all templates of the current client if the * filter is empty. Also supports operators like AND, OR, NOT For example, * "status=\"ACTIVE\" * @opt_param string orderBy Optional. The results would be returned in the * order you specified here. * @opt_param int pageSize Optional. The size of the response entries. If * unspecified, defaults to 100. The maximum value is 1000; values above 1000 * will be coerced to 1000. * @opt_param string pageToken Optional. The token returned in the previous * response. * @opt_param string readMask Optional. The mask which specifies fields that * need to be returned in the template's response. * @return GoogleCloudIntegrationsV1alphaListTemplatesResponse * @throws \Google\Service\Exception */ public function listProjectsLocationsTemplates($parent, $optParams = []) { $params = ['parent' => $parent]; $params = array_merge($params, $optParams); return $this->call('list', [$params], GoogleCloudIntegrationsV1alphaListTemplatesResponse::class); } /** * Updates the template by given id. (templates.patch) * * @param string $name Identifier. Resource name of the template. * @param GoogleCloudIntegrationsV1alphaTemplate $postBody * @param array $optParams Optional parameters. * * @opt_param string updateMask Required. Field mask specifying the fields in * the above template that have been modified and must be updated. * @return GoogleCloudIntegrationsV1alphaTemplate * @throws \Google\Service\Exception */ public function patch($name, GoogleCloudIntegrationsV1alphaTemplate $postBody, $optParams = []) { $params = ['name' => $name, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('patch', [$params], GoogleCloudIntegrationsV1alphaTemplate::class); } /** * Search templates based on user query and filters. This api would query the * templates and return a list of templates based on the user filter. * (templates.search) * * @param string $parent Required. The client, which owns this collection of * Templates. * @param array $optParams Optional parameters. * * @opt_param string filter Optional. Standard filter field to filter templates. * client_id filter won't be supported and will restrict to templates belonging * to the current client only. Return all templates of the current client if the * filter is empty. Also supports operators like AND, OR, NOT For example, * "status=\"ACTIVE\" * @opt_param string orderBy Optional. The results would be returned in the * order you specified here. * @opt_param int pageSize Optional. The size of the response entries. If * unspecified, defaults to 100. The maximum value is 1000; values above 1000 * will be coerced to 1000. * @opt_param string pageToken Optional. The token returned in the previous * response. * @opt_param string readMask Optional. The mask which specifies fields that * need to be returned in the template's response. * @return GoogleCloudIntegrationsV1alphaSearchTemplatesResponse * @throws \Google\Service\Exception */ public function search($parent, $optParams = []) { $params = ['parent' => $parent]; $params = array_merge($params, $optParams); return $this->call('search', [$params], GoogleCloudIntegrationsV1alphaSearchTemplatesResponse::class); } /** * Share a template with other clients. Only the template owner can share the * templates with other projects. PERMISSION_DENIED would be thrown if the * request is not from the owner. (templates.share) * * @param string $name Required. The name that is associated with the Template. * @param GoogleCloudIntegrationsV1alphaShareTemplateRequest $postBody * @param array $optParams Optional parameters. * @return GoogleProtobufEmpty * @throws \Google\Service\Exception */ public function share($name, GoogleCloudIntegrationsV1alphaShareTemplateRequest $postBody, $optParams = []) { $params = ['name' => $name, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('share', [$params], GoogleProtobufEmpty::class); } /** * Unshare a template from given clients. Owner of the template can unshare * template with clients. Shared client can only unshare the template from * itself. PERMISSION_DENIED would be thrown if request is not from owner or for * unsharing itself. (templates.unshare) * * @param string $name Required. The name that is associated with the Template. * @param GoogleCloudIntegrationsV1alphaUnshareTemplateRequest $postBody * @param array $optParams Optional parameters. * @return GoogleProtobufEmpty * @throws \Google\Service\Exception */ public function unshare($name, GoogleCloudIntegrationsV1alphaUnshareTemplateRequest $postBody, $optParams = []) { $params = ['name' => $name, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('unshare', [$params], GoogleProtobufEmpty::class); } /** * Uploads a template. The content can be a previously downloaded template. * Performs the same function as CreateTemplate, but accepts input in a string * format, which holds the complete representation of the Template content. * (templates.upload) * * @param string $parent Required. The template to upload. Format: * projects/{project}/locations/{location} * @param GoogleCloudIntegrationsV1alphaUploadTemplateRequest $postBody * @param array $optParams Optional parameters. * @return GoogleCloudIntegrationsV1alphaUploadTemplateResponse * @throws \Google\Service\Exception */ public function upload($parent, GoogleCloudIntegrationsV1alphaUploadTemplateRequest $postBody, $optParams = []) { $params = ['parent' => $parent, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('upload', [$params], GoogleCloudIntegrationsV1alphaUploadTemplateResponse::class); } /** * Use the template to create integration. This api would keep track of * usage_count and last_used_time. PERMISSION_DENIED would be thrown if template * is not accessible by client. (templates.useProjectsLocationsTemplates) * * @param string $name Required. The name that is associated with the Template. * @param GoogleCloudIntegrationsV1alphaUseTemplateRequest $postBody * @param array $optParams Optional parameters. * @return GoogleCloudIntegrationsV1alphaUseTemplateResponse * @throws \Google\Service\Exception */ public function useProjectsLocationsTemplates($name, GoogleCloudIntegrationsV1alphaUseTemplateRequest $postBody, $optParams = []) { $params = ['name' => $name, 'postBody' => $postBody]; $params = array_merge($params, $optParams); return $this->call('use', [$params], GoogleCloudIntegrationsV1alphaUseTemplateResponse::class); } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(ProjectsLocationsTemplates::class, 'Google_Service_Integrations_Resource_ProjectsLocationsTemplates');