Skip to content

Commit d75a132

Browse files
committed
feat(client): Update to API specification v2.3
1 parent f0fefd6 commit d75a132

27 files changed

+1961
-57
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 0.6.0
4+
5+
* feat(user): Add profile theme and instruments played.
6+
* feat(edu): Add new cursor-based pagination for `GET /v2/organizations/users` and `GET /v2/organizations/invitations`.
7+
* feat(edu): Add new methods:
8+
* `PUT /v2/organizations/users/{user}`: Admin endpoint to update managed accounts.
9+
* `DELETE /v2/organizations/users/{user}`: Admin endpoint to delete or convert edu accounts to consumer accounts.
10+
* feat(edu): Classes have a new state `inactive` that can be activated using the new method `POST /v2/classes/{class}/activate`.
11+
* feat(edu): Assignments have a new state `draft` and can have a new attachment type `exercise`.
12+
* feat(edu): Return Canvas LMS Instance domain in classes details
13+
* feat(edu): Return Clever.com section information in classes details
14+
315
## 0.5.0
416

517
* feat(edu): Public release of the first education APIs:

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ All URIs are relative to *https://api.flat.io/v2*
8383
Class | Method | HTTP request | Description
8484
------------ | ------------- | ------------- | -------------
8585
*AccountApi* | [**getAuthenticatedUser**](docs/Api/AccountApi.md#getauthenticateduser) | **GET** /me | Get current user profile
86+
*ClassApi* | [**activateClass**](docs/Api/ClassApi.md#activateclass) | **POST** /classes/{class}/activate | Activate the class
8687
*ClassApi* | [**addClassUser**](docs/Api/ClassApi.md#addclassuser) | **PUT** /classes/{class}/users/{user} | Add a user to the class
8788
*ClassApi* | [**archiveClass**](docs/Api/ClassApi.md#archiveclass) | **POST** /classes/{class}/archive | Archive the class
8889
*ClassApi* | [**copyAssignment**](docs/Api/ClassApi.md#copyassignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment
@@ -111,7 +112,9 @@ Class | Method | HTTP request | Description
111112
*OrganizationApi* | [**listOrganizationInvitations**](docs/Api/OrganizationApi.md#listorganizationinvitations) | **GET** /organizations/invitations | List the organization invitations
112113
*OrganizationApi* | [**listOrganizationUsers**](docs/Api/OrganizationApi.md#listorganizationusers) | **GET** /organizations/users | List the organization users
113114
*OrganizationApi* | [**removeOrganizationInvitation**](docs/Api/OrganizationApi.md#removeorganizationinvitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation
115+
*OrganizationApi* | [**removeOrganizationUser**](docs/Api/OrganizationApi.md#removeorganizationuser) | **DELETE** /organizations/users/{user} | Remove an account from Flat
114116
*OrganizationApi* | [**revokeLtiCredentials**](docs/Api/OrganizationApi.md#revokelticredentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials
117+
*OrganizationApi* | [**updateOrganizationUser**](docs/Api/OrganizationApi.md#updateorganizationuser) | **PUT** /organizations/users/{user} | Update account information
115118
*ScoreApi* | [**addScoreCollaborator**](docs/Api/ScoreApi.md#addscorecollaborator) | **POST** /scores/{score}/collaborators | Add a new collaborator
116119
*ScoreApi* | [**createScore**](docs/Api/ScoreApi.md#createscore) | **POST** /scores | Create a new score
117120
*ScoreApi* | [**createScoreRevision**](docs/Api/ScoreApi.md#createscorerevision) | **POST** /scores/{score}/revisions | Create a new revision
@@ -151,12 +154,12 @@ Class | Method | HTTP request | Description
151154
- [ClassCreation](docs/Model/ClassCreation.md)
152155
- [ClassDetails](docs/Model/ClassDetails.md)
153156
- [ClassDetailsCanvas](docs/Model/ClassDetailsCanvas.md)
157+
- [ClassDetailsClever](docs/Model/ClassDetailsClever.md)
154158
- [ClassDetailsGoogleClassroom](docs/Model/ClassDetailsGoogleClassroom.md)
155159
- [ClassDetailsGoogleDrive](docs/Model/ClassDetailsGoogleDrive.md)
156160
- [ClassDetailsLti](docs/Model/ClassDetailsLti.md)
157161
- [ClassRoles](docs/Model/ClassRoles.md)
158162
- [ClassState](docs/Model/ClassState.md)
159-
- [ClassStreamPostMode](docs/Model/ClassStreamPostMode.md)
160163
- [ClassUpdate](docs/Model/ClassUpdate.md)
161164
- [FlatErrorResponse](docs/Model/FlatErrorResponse.md)
162165
- [FlatLocales](docs/Model/FlatLocales.md)
@@ -196,9 +199,11 @@ Class | Method | HTTP request | Description
196199
- [ScoreSource](docs/Model/ScoreSource.md)
197200
- [ScoreSummary](docs/Model/ScoreSummary.md)
198201
- [ScoreViewsCounts](docs/Model/ScoreViewsCounts.md)
202+
- [UserAdminUpdate](docs/Model/UserAdminUpdate.md)
199203
- [UserBasics](docs/Model/UserBasics.md)
200204
- [UserCreation](docs/Model/UserCreation.md)
201205
- [UserDetailsAdminLicense](docs/Model/UserDetailsAdminLicense.md)
206+
- [UserInstruments](docs/Model/UserInstruments.md)
202207
- [ScoreDetails](docs/Model/ScoreDetails.md)
203208
- [UserPublicSummary](docs/Model/UserPublicSummary.md)
204209
- [UserDetailsAdmin](docs/Model/UserDetailsAdmin.md)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flat/api",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "PHP client for the Flat REST API",
55
"keywords": [
66
"Music",

docs/Api/ClassApi.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All URIs are relative to *https://api.flat.io/v2*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7+
[**activateClass**](ClassApi.md#activateClass) | **POST** /classes/{class}/activate | Activate the class
78
[**addClassUser**](ClassApi.md#addClassUser) | **PUT** /classes/{class}/users/{user} | Add a user to the class
89
[**archiveClass**](ClassApi.md#archiveClass) | **POST** /classes/{class}/archive | Archive the class
910
[**copyAssignment**](ClassApi.md#copyAssignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment
@@ -24,6 +25,54 @@ Method | HTTP request | Description
2425
[**updateClass**](ClassApi.md#updateClass) | **PUT** /classes/{class} | Update the class
2526

2627

28+
# **activateClass**
29+
> \Flat\APIClient\Model\ClassDetails activateClass($class)
30+
31+
Activate the class
32+
33+
Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI.
34+
35+
### Example
36+
```php
37+
<?php
38+
require_once(__DIR__ . '/vendor/autoload.php');
39+
40+
// Configure OAuth2 access token for authorization: OAuth2
41+
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
42+
43+
$api_instance = new Flat\APIClient\Api\ClassApi();
44+
$class = "class_example"; // string | Unique identifier of the class
45+
46+
try {
47+
$result = $api_instance->activateClass($class);
48+
print_r($result);
49+
} catch (Exception $e) {
50+
echo 'Exception when calling ClassApi->activateClass: ', $e->getMessage(), PHP_EOL;
51+
}
52+
?>
53+
```
54+
55+
### Parameters
56+
57+
Name | Type | Description | Notes
58+
------------- | ------------- | ------------- | -------------
59+
**class** | **string**| Unique identifier of the class |
60+
61+
### Return type
62+
63+
[**\Flat\APIClient\Model\ClassDetails**](../Model/ClassDetails.md)
64+
65+
### Authorization
66+
67+
[OAuth2](../../README.md#OAuth2)
68+
69+
### HTTP request headers
70+
71+
- **Content-Type**: application/json
72+
- **Accept**: application/json
73+
74+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
75+
2776
# **addClassUser**
2877
> addClassUser($class, $user)
2978

docs/Api/OrganizationApi.md

Lines changed: 115 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Method | HTTP request | Description
1111
[**listOrganizationInvitations**](OrganizationApi.md#listOrganizationInvitations) | **GET** /organizations/invitations | List the organization invitations
1212
[**listOrganizationUsers**](OrganizationApi.md#listOrganizationUsers) | **GET** /organizations/users | List the organization users
1313
[**removeOrganizationInvitation**](OrganizationApi.md#removeOrganizationInvitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation
14+
[**removeOrganizationUser**](OrganizationApi.md#removeOrganizationUser) | **DELETE** /organizations/users/{user} | Remove an account from Flat
1415
[**revokeLtiCredentials**](OrganizationApi.md#revokeLtiCredentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials
16+
[**updateOrganizationUser**](OrganizationApi.md#updateOrganizationUser) | **PUT** /organizations/users/{user} | Update account information
1517

1618

1719
# **createLtiCredentials**
@@ -199,7 +201,7 @@ This endpoint does not need any parameter.
199201
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
200202

201203
# **listOrganizationInvitations**
202-
> \Flat\APIClient\Model\OrganizationInvitation[] listOrganizationInvitations($role, $limit, $offset)
204+
> \Flat\APIClient\Model\OrganizationInvitation[] listOrganizationInvitations($role, $limit, $next, $previous)
203205
204206
List the organization invitations
205207

@@ -213,11 +215,12 @@ Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_AC
213215

214216
$api_instance = new Flat\APIClient\Api\OrganizationApi();
215217
$role = "role_example"; // string | Filter users by role
216-
$limit = 100; // int | This is the maximum number of objects that may be returned
217-
$offset = 0; // int | This offsets the start of each page by the number specified
218+
$limit = 50; // int | This is the maximum number of objects that may be returned
219+
$next = "next_example"; // string | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
220+
$previous = "previous_example"; // string | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
218221

219222
try {
220-
$result = $api_instance->listOrganizationInvitations($role, $limit, $offset);
223+
$result = $api_instance->listOrganizationInvitations($role, $limit, $next, $previous);
221224
print_r($result);
222225
} catch (Exception $e) {
223226
echo 'Exception when calling OrganizationApi->listOrganizationInvitations: ', $e->getMessage(), PHP_EOL;
@@ -230,8 +233,9 @@ try {
230233
Name | Type | Description | Notes
231234
------------- | ------------- | ------------- | -------------
232235
**role** | **string**| Filter users by role | [optional]
233-
**limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 100]
234-
**offset** | **int**| This offsets the start of each page by the number specified | [optional] [default to 0]
236+
**limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 50]
237+
**next** | **string**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data. | [optional]
238+
**previous** | **string**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data. | [optional]
235239

236240
### Return type
237241

@@ -249,7 +253,7 @@ Name | Type | Description | Notes
249253
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
250254

251255
# **listOrganizationUsers**
252-
> \Flat\APIClient\Model\UserDetailsAdmin[] listOrganizationUsers($role, $limit, $offset)
256+
> \Flat\APIClient\Model\UserDetailsAdmin[] listOrganizationUsers($role, $limit, $next, $previous)
253257
254258
List the organization users
255259

@@ -263,11 +267,12 @@ Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_AC
263267

264268
$api_instance = new Flat\APIClient\Api\OrganizationApi();
265269
$role = "role_example"; // string | Filter users by role
266-
$limit = 100; // int | This is the maximum number of objects that may be returned
267-
$offset = 0; // int | This offsets the start of each page by the number specified
270+
$limit = 50; // int | This is the maximum number of objects that may be returned
271+
$next = "next_example"; // string | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
272+
$previous = "previous_example"; // string | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
268273

269274
try {
270-
$result = $api_instance->listOrganizationUsers($role, $limit, $offset);
275+
$result = $api_instance->listOrganizationUsers($role, $limit, $next, $previous);
271276
print_r($result);
272277
} catch (Exception $e) {
273278
echo 'Exception when calling OrganizationApi->listOrganizationUsers: ', $e->getMessage(), PHP_EOL;
@@ -280,8 +285,9 @@ try {
280285
Name | Type | Description | Notes
281286
------------- | ------------- | ------------- | -------------
282287
**role** | **string**| Filter users by role | [optional]
283-
**limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 100]
284-
**offset** | **int**| This offsets the start of each page by the number specified | [optional] [default to 0]
288+
**limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 50]
289+
**next** | **string**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data. | [optional]
290+
**previous** | **string**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the &#x60;Link&#x60; header when requesting the API. These URLs will contain a &#x60;next&#x60; and &#x60;previous&#x60; cursor based on the available data. | [optional]
285291

286292
### Return type
287293

@@ -343,6 +349,55 @@ void (empty response body)
343349

344350
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
345351

352+
# **removeOrganizationUser**
353+
> removeOrganizationUser($user, $convertToIndividual)
354+
355+
Remove an account from Flat
356+
357+
This operation removes an account from Flat and its data, including: * The music scores created by this user (documents, history, comments, collaboration information) * Education related data (assignments and classroom information)
358+
359+
### Example
360+
```php
361+
<?php
362+
require_once(__DIR__ . '/vendor/autoload.php');
363+
364+
// Configure OAuth2 access token for authorization: OAuth2
365+
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
366+
367+
$api_instance = new Flat\APIClient\Api\OrganizationApi();
368+
$user = "user_example"; // string | Unique identifier of the Flat account
369+
$convertToIndividual = true; // bool | If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal.
370+
371+
try {
372+
$api_instance->removeOrganizationUser($user, $convertToIndividual);
373+
} catch (Exception $e) {
374+
echo 'Exception when calling OrganizationApi->removeOrganizationUser: ', $e->getMessage(), PHP_EOL;
375+
}
376+
?>
377+
```
378+
379+
### Parameters
380+
381+
Name | Type | Description | Notes
382+
------------- | ------------- | ------------- | -------------
383+
**user** | **string**| Unique identifier of the Flat account |
384+
**convertToIndividual** | **bool**| If &#x60;true&#x60;, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. | [optional]
385+
386+
### Return type
387+
388+
void (empty response body)
389+
390+
### Authorization
391+
392+
[OAuth2](../../README.md#OAuth2)
393+
394+
### HTTP request headers
395+
396+
- **Content-Type**: application/json
397+
- **Accept**: application/json
398+
399+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
400+
346401
# **revokeLtiCredentials**
347402
> revokeLtiCredentials($credentials)
348403
@@ -388,3 +443,51 @@ void (empty response body)
388443

389444
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
390445

446+
# **updateOrganizationUser**
447+
> \Flat\APIClient\Model\UserDetailsAdmin updateOrganizationUser($user, $body)
448+
449+
Update account information
450+
451+
### Example
452+
```php
453+
<?php
454+
require_once(__DIR__ . '/vendor/autoload.php');
455+
456+
// Configure OAuth2 access token for authorization: OAuth2
457+
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
458+
459+
$api_instance = new Flat\APIClient\Api\OrganizationApi();
460+
$user = "user_example"; // string | Unique identifier of the Flat account
461+
$body = new \Flat\APIClient\Model\UserAdminUpdate(); // \Flat\APIClient\Model\UserAdminUpdate |
462+
463+
try {
464+
$result = $api_instance->updateOrganizationUser($user, $body);
465+
print_r($result);
466+
} catch (Exception $e) {
467+
echo 'Exception when calling OrganizationApi->updateOrganizationUser: ', $e->getMessage(), PHP_EOL;
468+
}
469+
?>
470+
```
471+
472+
### Parameters
473+
474+
Name | Type | Description | Notes
475+
------------- | ------------- | ------------- | -------------
476+
**user** | **string**| Unique identifier of the Flat account |
477+
**body** | [**\Flat\APIClient\Model\UserAdminUpdate**](../Model/UserAdminUpdate.md)| |
478+
479+
### Return type
480+
481+
[**\Flat\APIClient\Model\UserDetailsAdmin**](../Model/UserDetailsAdmin.md)
482+
483+
### Authorization
484+
485+
[OAuth2](../../README.md#OAuth2)
486+
487+
### HTTP request headers
488+
489+
- **Content-Type**: application/json
490+
- **Accept**: application/json
491+
492+
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
493+

docs/Model/ClassDetails.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Name | Type | Description | Notes
2020
**googleDrive** | [**\Flat\APIClient\Model\ClassDetailsGoogleDrive**](ClassDetailsGoogleDrive.md) | | [optional]
2121
**lti** | [**\Flat\APIClient\Model\ClassDetailsLti**](ClassDetailsLti.md) | | [optional]
2222
**canvas** | [**\Flat\APIClient\Model\ClassDetailsCanvas**](ClassDetailsCanvas.md) | | [optional]
23+
**clever** | [**\Flat\APIClient\Model\ClassDetailsClever**](ClassDetailsClever.md) | | [optional]
2324

2425
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
2526

docs/Model/ClassDetailsCanvas.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**id** | **string** | Unique identifier of the course on Canvas | [optional]
7+
**domain** | **string** | Canvas instance domain (e.g. \&quot;canvas.instructure.com\&quot;) | [optional]
78

89
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
910

0 commit comments

Comments
 (0)