| 1 |
<?php |
| 2 |
/* |
| 3 |
* Copyright 2010 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 |
|
| 18 |
/** |
| 19 |
* Service definition for Admin (email_migration_v2). |
| 20 |
* |
| 21 |
* <p> |
| 22 |
* Email Migration API lets you migrate emails of users to Google backends. |
| 23 |
* </p> |
| 24 |
* |
| 25 |
* <p> |
| 26 |
* For more information about this service, see the API |
| 27 |
* <a href="https://developers.google.com/admin-sdk/email-migration/v2/" target="_blank">Documentation</a> |
| 28 |
* </p> |
| 29 |
* |
| 30 |
* @author Google, Inc. |
| 31 |
*/ |
| 32 |
class Analytify_Google_Service_Admin extends Analytify_Google_Service |
| 33 |
{ |
| 34 |
/** Manage email messages of users on your domain. */ |
| 35 |
const EMAIL_MIGRATION = "https://www.googleapis.com/auth/email.migration"; |
| 36 |
|
| 37 |
public $mail; |
| 38 |
|
| 39 |
|
| 40 |
/** |
| 41 |
* Constructs the internal representation of the Admin service. |
| 42 |
* |
| 43 |
* @param Analytify_Google_Client $client |
| 44 |
*/ |
| 45 |
public function __construct(Analytify_Google_Client $client) |
| 46 |
{ |
| 47 |
parent::__construct($client); |
| 48 |
$this->servicePath = 'email/v2/users/'; |
| 49 |
$this->version = 'email_migration_v2'; |
| 50 |
$this->serviceName = 'admin'; |
| 51 |
|
| 52 |
$this->mail = new Analytify_Google_Service_Admin_Mail_Resource( |
| 53 |
$this, |
| 54 |
$this->serviceName, |
| 55 |
'mail', |
| 56 |
array( |
| 57 |
'methods' => array( |
| 58 |
'insert' => array( |
| 59 |
'path' => '{userKey}/mail', |
| 60 |
'httpMethod' => 'POST', |
| 61 |
'parameters' => array( |
| 62 |
'userKey' => array( |
| 63 |
'location' => 'path', |
| 64 |
'type' => 'string', |
| 65 |
'required' => true, |
| 66 |
), |
| 67 |
), |
| 68 |
), |
| 69 |
) |
| 70 |
) |
| 71 |
); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
/** |
| 77 |
* The "mail" collection of methods. |
| 78 |
* Typical usage is: |
| 79 |
* <code> |
| 80 |
* $adminService = new Analytify_Google_Service_Admin(...); |
| 81 |
* $mail = $adminService->mail; |
| 82 |
* </code> |
| 83 |
*/ |
| 84 |
class Analytify_Google_Service_Admin_Mail_Resource extends Analytify_Google_Service_Resource |
| 85 |
{ |
| 86 |
|
| 87 |
/** |
| 88 |
* Insert Mail into Google's Gmail backends (mail.insert) |
| 89 |
* |
| 90 |
* @param string $userKey |
| 91 |
* The email or immutable id of the user |
| 92 |
* @param Analytify_Google_MailItem $postBody |
| 93 |
* @param array $optParams Optional parameters. |
| 94 |
*/ |
| 95 |
public function insert($userKey, Analytify_Google_Service_Admin_MailItem $postBody, $optParams = array()) |
| 96 |
{ |
| 97 |
$params = array('userKey' => $userKey, 'postBody' => $postBody); |
| 98 |
$params = array_merge($params, $optParams); |
| 99 |
return $this->call('insert', array($params)); |
| 100 |
} |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
class Analytify_Google_Service_Admin_MailItem extends Analytify_Google_Collection |
| 107 |
{ |
| 108 |
public $isDeleted; |
| 109 |
public $isDraft; |
| 110 |
public $isInbox; |
| 111 |
public $isSent; |
| 112 |
public $isStarred; |
| 113 |
public $isTrash; |
| 114 |
public $isUnread; |
| 115 |
public $kind; |
| 116 |
public $labels; |
| 117 |
|
| 118 |
public function setIsDeleted($isDeleted) |
| 119 |
{ |
| 120 |
$this->isDeleted = $isDeleted; |
| 121 |
} |
| 122 |
|
| 123 |
public function getIsDeleted() |
| 124 |
{ |
| 125 |
return $this->isDeleted; |
| 126 |
} |
| 127 |
|
| 128 |
public function setIsDraft($isDraft) |
| 129 |
{ |
| 130 |
$this->isDraft = $isDraft; |
| 131 |
} |
| 132 |
|
| 133 |
public function getIsDraft() |
| 134 |
{ |
| 135 |
return $this->isDraft; |
| 136 |
} |
| 137 |
|
| 138 |
public function setIsInbox($isInbox) |
| 139 |
{ |
| 140 |
$this->isInbox = $isInbox; |
| 141 |
} |
| 142 |
|
| 143 |
public function getIsInbox() |
| 144 |
{ |
| 145 |
return $this->isInbox; |
| 146 |
} |
| 147 |
|
| 148 |
public function setIsSent($isSent) |
| 149 |
{ |
| 150 |
$this->isSent = $isSent; |
| 151 |
} |
| 152 |
|
| 153 |
public function getIsSent() |
| 154 |
{ |
| 155 |
return $this->isSent; |
| 156 |
} |
| 157 |
|
| 158 |
public function setIsStarred($isStarred) |
| 159 |
{ |
| 160 |
$this->isStarred = $isStarred; |
| 161 |
} |
| 162 |
|
| 163 |
public function getIsStarred() |
| 164 |
{ |
| 165 |
return $this->isStarred; |
| 166 |
} |
| 167 |
|
| 168 |
public function setIsTrash($isTrash) |
| 169 |
{ |
| 170 |
$this->isTrash = $isTrash; |
| 171 |
} |
| 172 |
|
| 173 |
public function getIsTrash() |
| 174 |
{ |
| 175 |
return $this->isTrash; |
| 176 |
} |
| 177 |
|
| 178 |
public function setIsUnread($isUnread) |
| 179 |
{ |
| 180 |
$this->isUnread = $isUnread; |
| 181 |
} |
| 182 |
|
| 183 |
public function getIsUnread() |
| 184 |
{ |
| 185 |
return $this->isUnread; |
| 186 |
} |
| 187 |
|
| 188 |
public function setKind($kind) |
| 189 |
{ |
| 190 |
$this->kind = $kind; |
| 191 |
} |
| 192 |
|
| 193 |
public function getKind() |
| 194 |
{ |
| 195 |
return $this->kind; |
| 196 |
} |
| 197 |
|
| 198 |
public function setLabels($labels) |
| 199 |
{ |
| 200 |
$this->labels = $labels; |
| 201 |
} |
| 202 |
|
| 203 |
public function getLabels() |
| 204 |
{ |
| 205 |
return $this->labels; |
| 206 |
} |
| 207 |
} |
| 208 |
|