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\Gmail\Resource;
19
20use Google\Service\Gmail\ListSmimeInfoResponse;
21use Google\Service\Gmail\SmimeInfo;
22
23/**
24 * The "smimeInfo" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $gmailService = new Google\Service\Gmail(...);
28 *   $smimeInfo = $gmailService->smimeInfo;
29 *  </code>
30 */
31class UsersSettingsSendAsSmimeInfo extends \Google\Service\Resource
32{
33  /**
34   * Deletes the specified S/MIME config for the specified send-as alias.
35   * (smimeInfo.delete)
36   *
37   * @param string $userId The user's email address. The special value `me` can be
38   * used to indicate the authenticated user.
39   * @param string $sendAsEmail The email address that appears in the "From:"
40   * header for mail sent using this alias.
41   * @param string $id The immutable ID for the SmimeInfo.
42   * @param array $optParams Optional parameters.
43   */
44  public function delete($userId, $sendAsEmail, $id, $optParams = [])
45  {
46    $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
47    $params = array_merge($params, $optParams);
48    return $this->call('delete', [$params]);
49  }
50  /**
51   * Gets the specified S/MIME config for the specified send-as alias.
52   * (smimeInfo.get)
53   *
54   * @param string $userId The user's email address. The special value `me` can be
55   * used to indicate the authenticated user.
56   * @param string $sendAsEmail The email address that appears in the "From:"
57   * header for mail sent using this alias.
58   * @param string $id The immutable ID for the SmimeInfo.
59   * @param array $optParams Optional parameters.
60   * @return SmimeInfo
61   */
62  public function get($userId, $sendAsEmail, $id, $optParams = [])
63  {
64    $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
65    $params = array_merge($params, $optParams);
66    return $this->call('get', [$params], SmimeInfo::class);
67  }
68  /**
69   * Insert (upload) the given S/MIME config for the specified send-as alias. Note
70   * that pkcs12 format is required for the key. (smimeInfo.insert)
71   *
72   * @param string $userId The user's email address. The special value `me` can be
73   * used to indicate the authenticated user.
74   * @param string $sendAsEmail The email address that appears in the "From:"
75   * header for mail sent using this alias.
76   * @param SmimeInfo $postBody
77   * @param array $optParams Optional parameters.
78   * @return SmimeInfo
79   */
80  public function insert($userId, $sendAsEmail, SmimeInfo $postBody, $optParams = [])
81  {
82    $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody];
83    $params = array_merge($params, $optParams);
84    return $this->call('insert', [$params], SmimeInfo::class);
85  }
86  /**
87   * Lists S/MIME configs for the specified send-as alias.
88   * (smimeInfo.listUsersSettingsSendAsSmimeInfo)
89   *
90   * @param string $userId The user's email address. The special value `me` can be
91   * used to indicate the authenticated user.
92   * @param string $sendAsEmail The email address that appears in the "From:"
93   * header for mail sent using this alias.
94   * @param array $optParams Optional parameters.
95   * @return ListSmimeInfoResponse
96   */
97  public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = [])
98  {
99    $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail];
100    $params = array_merge($params, $optParams);
101    return $this->call('list', [$params], ListSmimeInfoResponse::class);
102  }
103  /**
104   * Sets the default S/MIME config for the specified send-as alias.
105   * (smimeInfo.setDefault)
106   *
107   * @param string $userId The user's email address. The special value `me` can be
108   * used to indicate the authenticated user.
109   * @param string $sendAsEmail The email address that appears in the "From:"
110   * header for mail sent using this alias.
111   * @param string $id The immutable ID for the SmimeInfo.
112   * @param array $optParams Optional parameters.
113   */
114  public function setDefault($userId, $sendAsEmail, $id, $optParams = [])
115  {
116    $params = ['userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id];
117    $params = array_merge($params, $optParams);
118    return $this->call('setDefault', [$params]);
119  }
120}
121
122// Adding a class alias for backwards compatibility with the previous class name.
123class_alias(UsersSettingsSendAsSmimeInfo::class, 'Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo');
124