Skip to content

Commit a2aa819

Browse files
committed
Merge pull request #208 from magento-south/MAGETWO-32631-by-andrii
[South] Define Public API
2 parents 41d33d0 + c8bf4d7 commit a2aa819

21 files changed

+199
-5
lines changed

app/code/Magento/Customer/Api/AccountManagementInterface.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface AccountManagementInterface
2323
/**
2424
* Create customer account. Perform necessary business operations like sending email.
2525
*
26+
* @api
2627
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
2728
* @param string $password
2829
* @param string $redirectUrl
@@ -38,6 +39,7 @@ public function createAccount(
3839
/**
3940
* Create customer account using provided hashed password. Should not be exposed as a webapi.
4041
*
42+
* @api
4143
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
4244
* @param string $hash Password hash that we can save directly
4345
* @param string $redirectUrl URL fed to welcome email templates. Can be used by templates to, for example, direct
@@ -56,6 +58,7 @@ public function createAccountWithPasswordHash(
5658
/**
5759
* Validate customer data.
5860
*
61+
* @api
5962
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
6063
* @return \Magento\Customer\Api\Data\ValidationResultsInterface
6164
* @throws \Magento\Framework\Exception\LocalizedException
@@ -65,6 +68,7 @@ public function validate(\Magento\Customer\Api\Data\CustomerInterface $customer)
6568
/**
6669
* Check if customer can be deleted.
6770
*
71+
* @api
6872
* @param int $customerId
6973
* @return bool
7074
* @throws \Magento\Framework\Exception\NoSuchEntityException If group is not found
@@ -75,6 +79,7 @@ public function isReadonly($customerId);
7579
/**
7680
* Activate a customer account using a key that was sent in a confirmation e-mail.
7781
*
82+
* @api
7883
* @param string $email
7984
* @param string $confirmationKey
8085
* @return \Magento\Customer\Api\Data\CustomerInterface
@@ -85,6 +90,7 @@ public function activate($email, $confirmationKey);
8590
/**
8691
* Activate a customer account using a key that was sent in a confirmation e-mail.
8792
*
93+
* @api
8894
* @param int $customerId
8995
* @param string $confirmationKey
9096
* @return \Magento\Customer\Api\Data\CustomerInterface
@@ -95,6 +101,7 @@ public function activateById($customerId, $confirmationKey);
95101
/**
96102
* Authenticate a customer by username and password
97103
*
104+
* @api
98105
* @param string $email
99106
* @param string $password
100107
* @return \Magento\Customer\Api\Data\CustomerInterface
@@ -105,6 +112,7 @@ public function authenticate($email, $password);
105112
/**
106113
* Change customer password.
107114
*
115+
* @api
108116
* @param string $email
109117
* @param string $currentPassword
110118
* @param string $newPassword
@@ -116,6 +124,7 @@ public function changePassword($email, $currentPassword, $newPassword);
116124
/**
117125
* Change customer password.
118126
*
127+
* @api
119128
* @param int $customerId
120129
* @param string $currentPassword
121130
* @param string $newPassword
@@ -127,6 +136,7 @@ public function changePasswordById($customerId, $currentPassword, $newPassword);
127136
/**
128137
* Send an email to the customer with a password reset link.
129138
*
139+
* @api
130140
* @param string $email
131141
* @param string $template
132142
* @param int $websiteId
@@ -138,6 +148,7 @@ public function initiatePasswordReset($email, $template, $websiteId = null);
138148
/**
139149
* Reset customer password.
140150
*
151+
* @api
141152
* @param string $email
142153
* @param string $resetToken
143154
* @param string $newPassword
@@ -149,6 +160,7 @@ public function resetPassword($email, $resetToken, $newPassword);
149160
/**
150161
* Check if password reset token is valid.
151162
*
163+
* @api
152164
* @param int $customerId
153165
* @param string $resetPasswordLinkToken
154166
* @return bool True if the token is valid
@@ -163,6 +175,7 @@ public function validateResetPasswordLinkToken($customerId, $resetPasswordLinkTo
163175
/**
164176
* Gets the account confirmation status.
165177
*
178+
* @api
166179
* @param int $customerId
167180
* @return string
168181
* @throws \Magento\Framework\Exception\LocalizedException
@@ -172,6 +185,7 @@ public function getConfirmationStatus($customerId);
172185
/**
173186
* Resend confirmation email.
174187
*
188+
* @api
175189
* @param string $email
176190
* @param int $websiteId
177191
* @param string $redirectUrl
@@ -183,6 +197,7 @@ public function resendConfirmation($email, $websiteId, $redirectUrl = '');
183197
/**
184198
* Check if given email is associated with a customer account in given website.
185199
*
200+
* @api
186201
* @param string $customerEmail
187202
* @param int $websiteId If not set, will use the current websiteId
188203
* @return bool
@@ -193,6 +208,7 @@ public function isEmailAvailable($customerEmail, $websiteId = null);
193208
/**
194209
* Check store availability for customer given the customerId.
195210
*
211+
* @api
196212
* @param int $customerWebsiteId
197213
* @param int $storeId
198214
* @return bool
@@ -203,6 +219,7 @@ public function isCustomerInStore($customerWebsiteId, $storeId);
203219
/**
204220
* Retrieve default billing address for the given customerId.
205221
*
222+
* @api
206223
* @param int $customerId
207224
* @return \Magento\Customer\Api\Data\AddressInterface
208225
* @throws \Magento\Framework\Exception\NoSuchEntityException If the customer Id is invalid
@@ -213,6 +230,7 @@ public function getDefaultBillingAddress($customerId);
213230
/**
214231
* Retrieve default shipping address for the given customerId.
215232
*
233+
* @api
216234
* @param int $customerId
217235
* @return \Magento\Customer\Api\Data\AddressInterface
218236
* @throws \Magento\Framework\Exception\NoSuchEntityException If the customer Id is invalid
@@ -223,6 +241,7 @@ public function getDefaultShippingAddress($customerId);
223241
/**
224242
* Return hashed password, which can be directly saved to database.
225243
*
244+
* @api
226245
* @param string $password
227246
* @return string
228247
*/

app/code/Magento/Customer/Api/AddressRepositoryInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface AddressRepositoryInterface
1414
/**
1515
* Save customer address.
1616
*
17+
* @api
1718
* @param \Magento\Customer\Api\Data\AddressInterface $address
1819
* @return \Magento\Customer\Api\Data\AddressInterface
1920
* @throws \Magento\Framework\Exception\LocalizedException
@@ -23,6 +24,7 @@ public function save(\Magento\Customer\Api\Data\AddressInterface $address);
2324
/**
2425
* Retrieve customer address.
2526
*
27+
* @api
2628
* @param int $addressId
2729
* @return \Magento\Customer\Api\Data\AddressInterface
2830
* @throws \Magento\Framework\Exception\LocalizedException
@@ -32,6 +34,7 @@ public function getById($addressId);
3234
/**
3335
* Retrieve customers addresses matching the specified criteria.
3436
*
37+
* @api
3538
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
3639
* @return \Magento\Customer\Api\Data\AddressSearchResultsInterface
3740
* @throws \Magento\Framework\Exception\LocalizedException
@@ -41,6 +44,7 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
4144
/**
4245
* Delete customer address.
4346
*
47+
* @api
4448
* @param \Magento\Customer\Api\Data\AddressInterface $address
4549
* @return bool true on success
4650
* @throws \Magento\Framework\Exception\LocalizedException
@@ -50,6 +54,7 @@ public function delete(\Magento\Customer\Api\Data\AddressInterface $address);
5054
/**
5155
* Delete customer address by ID.
5256
*
57+
* @api
5358
* @param int $addressId
5459
* @return bool true on success
5560
* @throws \Magento\Framework\Exception\NoSuchEntityException

app/code/Magento/Customer/Api/CustomerRepositoryInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ interface CustomerRepositoryInterface
1515
/**
1616
* Create customer.
1717
*
18+
* @api
1819
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
1920
* @param string $passwordHash
2021
* @return \Magento\Customer\Api\Data\CustomerInterface
@@ -27,6 +28,7 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa
2728
/**
2829
* Retrieve customer.
2930
*
31+
* @api
3032
* @param string $email
3133
* @param int|null $websiteId
3234
* @return \Magento\Customer\Api\Data\CustomerInterface
@@ -38,6 +40,7 @@ public function get($email, $websiteId = null);
3840
/**
3941
* Retrieve customer.
4042
*
43+
* @api
4144
* @param int $customerId
4245
* @return \Magento\Customer\Api\Data\CustomerInterface
4346
* @throws \Magento\Framework\Exception\NoSuchEntityException If customer with the specified ID does not exist.
@@ -48,6 +51,7 @@ public function getById($customerId);
4851
/**
4952
* Retrieve customers which match a specified criteria.
5053
*
54+
* @api
5155
* @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria
5256
* @return \Magento\Customer\Api\Data\CustomerSearchResultsInterface
5357
* @throws \Magento\Framework\Exception\LocalizedException
@@ -57,6 +61,7 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
5761
/**
5862
* Delete customer.
5963
*
64+
* @api
6065
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
6166
* @return bool true on success
6267
* @throws \Magento\Framework\Exception\LocalizedException
@@ -66,6 +71,7 @@ public function delete(\Magento\Customer\Api\Data\CustomerInterface $customer);
6671
/**
6772
* Delete customer by ID.
6873
*
74+
* @api
6975
* @param int $customerId
7076
* @return bool true on success
7177
* @throws \Magento\Framework\Exception\NoSuchEntityException

0 commit comments

Comments
 (0)