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\Appengine\Resource;
19
20use Google\Service\Appengine\DomainMapping;
21use Google\Service\Appengine\ListDomainMappingsResponse;
22use Google\Service\Appengine\Operation;
23
24/**
25 * The "domainMappings" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $appengineService = new Google\Service\Appengine(...);
29 *   $domainMappings = $appengineService->domainMappings;
30 *  </code>
31 */
32class AppsDomainMappings extends \Google\Service\Resource
33{
34  /**
35   * Maps a domain to an application. A user must be authorized to administer a
36   * domain in order to map it to an application. For a list of available
37   * authorized domains, see AuthorizedDomains.ListAuthorizedDomains.
38   * (domainMappings.create)
39   *
40   * @param string $appsId Part of `parent`. Name of the parent Application
41   * resource. Example: apps/myapp.
42   * @param DomainMapping $postBody
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string overrideStrategy Whether the domain creation should
46   * override any existing mappings for this domain. By default, overrides are
47   * rejected.
48   * @return Operation
49   */
50  public function create($appsId, DomainMapping $postBody, $optParams = [])
51  {
52    $params = ['appsId' => $appsId, 'postBody' => $postBody];
53    $params = array_merge($params, $optParams);
54    return $this->call('create', [$params], Operation::class);
55  }
56  /**
57   * Deletes the specified domain mapping. A user must be authorized to administer
58   * the associated domain in order to delete a DomainMapping resource.
59   * (domainMappings.delete)
60   *
61   * @param string $appsId Part of `name`. Name of the resource to delete.
62   * Example: apps/myapp/domainMappings/example.com.
63   * @param string $domainMappingsId Part of `name`. See documentation of
64   * `appsId`.
65   * @param array $optParams Optional parameters.
66   * @return Operation
67   */
68  public function delete($appsId, $domainMappingsId, $optParams = [])
69  {
70    $params = ['appsId' => $appsId, 'domainMappingsId' => $domainMappingsId];
71    $params = array_merge($params, $optParams);
72    return $this->call('delete', [$params], Operation::class);
73  }
74  /**
75   * Gets the specified domain mapping. (domainMappings.get)
76   *
77   * @param string $appsId Part of `name`. Name of the resource requested.
78   * Example: apps/myapp/domainMappings/example.com.
79   * @param string $domainMappingsId Part of `name`. See documentation of
80   * `appsId`.
81   * @param array $optParams Optional parameters.
82   * @return DomainMapping
83   */
84  public function get($appsId, $domainMappingsId, $optParams = [])
85  {
86    $params = ['appsId' => $appsId, 'domainMappingsId' => $domainMappingsId];
87    $params = array_merge($params, $optParams);
88    return $this->call('get', [$params], DomainMapping::class);
89  }
90  /**
91   * Lists the domain mappings on an application.
92   * (domainMappings.listAppsDomainMappings)
93   *
94   * @param string $appsId Part of `parent`. Name of the parent Application
95   * resource. Example: apps/myapp.
96   * @param array $optParams Optional parameters.
97   *
98   * @opt_param int pageSize Maximum results to return per page.
99   * @opt_param string pageToken Continuation token for fetching the next page of
100   * results.
101   * @return ListDomainMappingsResponse
102   */
103  public function listAppsDomainMappings($appsId, $optParams = [])
104  {
105    $params = ['appsId' => $appsId];
106    $params = array_merge($params, $optParams);
107    return $this->call('list', [$params], ListDomainMappingsResponse::class);
108  }
109  /**
110   * Updates the specified domain mapping. To map an SSL certificate to a domain
111   * mapping, update certificate_id to point to an AuthorizedCertificate resource.
112   * A user must be authorized to administer the associated domain in order to
113   * update a DomainMapping resource. (domainMappings.patch)
114   *
115   * @param string $appsId Part of `name`. Name of the resource to update.
116   * Example: apps/myapp/domainMappings/example.com.
117   * @param string $domainMappingsId Part of `name`. See documentation of
118   * `appsId`.
119   * @param DomainMapping $postBody
120   * @param array $optParams Optional parameters.
121   *
122   * @opt_param string updateMask Required. Standard field mask for the set of
123   * fields to be updated.
124   * @return Operation
125   */
126  public function patch($appsId, $domainMappingsId, DomainMapping $postBody, $optParams = [])
127  {
128    $params = ['appsId' => $appsId, 'domainMappingsId' => $domainMappingsId, 'postBody' => $postBody];
129    $params = array_merge($params, $optParams);
130    return $this->call('patch', [$params], Operation::class);
131  }
132}
133
134// Adding a class alias for backwards compatibility with the previous class name.
135class_alias(AppsDomainMappings::class, 'Google_Service_Appengine_Resource_AppsDomainMappings');
136