Skip to content

Commit

Permalink
Add updates from recent API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
siirimangus committed Aug 15, 2023
1 parent b1b68de commit d0883ed
Show file tree
Hide file tree
Showing 43 changed files with 5,081 additions and 129 deletions.
11 changes: 11 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gitignore
.openapi-generator-ignore
.php_cs
.travis.yml
MIGRATION-5.x.md
Expand Down Expand Up @@ -405,6 +406,8 @@ docs/Model/GoalType.md
docs/Model/GoalsResponseComponent.md
docs/Model/IconKey.md
docs/Model/InlineResponse200.md
docs/Model/InlineResponse2001.md
docs/Model/InlineResponse2002.md
docs/Model/InlineResponse400.md
docs/Model/InlineResponse4001.md
docs/Model/InlineResponse4001AdditionalData.md
Expand Down Expand Up @@ -577,6 +580,8 @@ docs/Model/OrganizationSearchResponseAllOf.md
docs/Model/OrganizationSearchResponseAllOfData.md
docs/Model/OrganizationUpdateResponse.md
docs/Model/OrganizationUpdateResponseAllOf.md
docs/Model/OrganizationsCollectionResponseObject.md
docs/Model/OrganizationsCollectionResponseObjectAllOf.md
docs/Model/OrganizationsDeleteResponse.md
docs/Model/OrganizationsDeleteResponseData.md
docs/Model/OrganizationsMergeResponse.md
Expand Down Expand Up @@ -617,6 +622,7 @@ docs/Model/PersonSearchItemItemOwner.md
docs/Model/PersonSearchResponse.md
docs/Model/PersonSearchResponseAllOf.md
docs/Model/PersonSearchResponseAllOfData.md
docs/Model/PersonsCollectionResponseObject.md
docs/Model/PictureData.md
docs/Model/PictureDataPictures.md
docs/Model/PictureDataWithID.md
Expand Down Expand Up @@ -1181,6 +1187,8 @@ lib/Model/GoalType.php
lib/Model/GoalsResponseComponent.php
lib/Model/IconKey.php
lib/Model/InlineResponse200.php
lib/Model/InlineResponse2001.php
lib/Model/InlineResponse2002.php
lib/Model/InlineResponse400.php
lib/Model/InlineResponse4001.php
lib/Model/InlineResponse4001AdditionalData.php
Expand Down Expand Up @@ -1354,6 +1362,8 @@ lib/Model/OrganizationSearchResponseAllOf.php
lib/Model/OrganizationSearchResponseAllOfData.php
lib/Model/OrganizationUpdateResponse.php
lib/Model/OrganizationUpdateResponseAllOf.php
lib/Model/OrganizationsCollectionResponseObject.php
lib/Model/OrganizationsCollectionResponseObjectAllOf.php
lib/Model/OrganizationsDeleteResponse.php
lib/Model/OrganizationsDeleteResponseData.php
lib/Model/OrganizationsMergeResponse.php
Expand Down Expand Up @@ -1394,6 +1404,7 @@ lib/Model/PersonSearchItemItemOwner.php
lib/Model/PersonSearchResponse.php
lib/Model/PersonSearchResponseAllOf.php
lib/Model/PersonSearchResponseAllOfData.php
lib/Model/PersonsCollectionResponseObject.php
lib/Model/PictureData.php
lib/Model/PictureDataPictures.php
lib/Model/PictureDataWithID.php
Expand Down
23 changes: 23 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRules([
'@PSR2' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'array_syntax' => [ 'syntax' => 'short' ],
'strict_comparison' => true,
'strict_param' => true,
'no_trailing_whitespace' => false,
'no_trailing_whitespace_in_comment' => false,
'braces' => false,
'single_blank_line_at_eof' => false,
'blank_line_after_namespace' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('test')
->exclude('tests')
->in(__DIR__)
);
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: php
# Bionic environment has preinstalled PHP from 7.1 to 7.4
# https://docs.travis-ci.com/user/reference/bionic/#php-support
dist: bionic
php:
- 7.3
- 7.4
before_install: "composer install"
script: "vendor/bin/phpunit"
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ Class | Method | HTTP request | Description
*OrganizationsApi* | [**getOrganizationUpdates**](docs/Api/OrganizationsApi.md#getorganizationupdates) | **GET** /organizations/{id}/flow | List updates about an organization
*OrganizationsApi* | [**getOrganizationUsers**](docs/Api/OrganizationsApi.md#getorganizationusers) | **GET** /organizations/{id}/permittedUsers | List permitted users
*OrganizationsApi* | [**getOrganizations**](docs/Api/OrganizationsApi.md#getorganizations) | **GET** /organizations | Get all organizations
*OrganizationsApi* | [**getOrganizationsCollection**](docs/Api/OrganizationsApi.md#getorganizationscollection) | **GET** /organizations/collection | Get all organizations (BETA)
*OrganizationsApi* | [**mergeOrganizations**](docs/Api/OrganizationsApi.md#mergeorganizations) | **PUT** /organizations/{id}/merge | Merge two organizations
*OrganizationsApi* | [**searchOrganization**](docs/Api/OrganizationsApi.md#searchorganization) | **GET** /organizations/search | Search organizations
*OrganizationsApi* | [**updateOrganization**](docs/Api/OrganizationsApi.md#updateorganization) | **PUT** /organizations/{id} | Update an organization
Expand Down Expand Up @@ -488,6 +489,7 @@ Class | Method | HTTP request | Description
*PersonsApi* | [**getPersonUpdates**](docs/Api/PersonsApi.md#getpersonupdates) | **GET** /persons/{id}/flow | List updates about a person
*PersonsApi* | [**getPersonUsers**](docs/Api/PersonsApi.md#getpersonusers) | **GET** /persons/{id}/permittedUsers | List permitted users
*PersonsApi* | [**getPersons**](docs/Api/PersonsApi.md#getpersons) | **GET** /persons | Get all persons
*PersonsApi* | [**getPersonsCollection**](docs/Api/PersonsApi.md#getpersonscollection) | **GET** /persons/collection | Get all persons (BETA)
*PersonsApi* | [**mergePersons**](docs/Api/PersonsApi.md#mergepersons) | **PUT** /persons/{id}/merge | Merge two persons
*PersonsApi* | [**searchPersons**](docs/Api/PersonsApi.md#searchpersons) | **GET** /persons/search | Search persons
*PersonsApi* | [**updatePerson**](docs/Api/PersonsApi.md#updateperson) | **PUT** /persons/{id} | Update a person
Expand Down Expand Up @@ -929,6 +931,8 @@ Class | Method | HTTP request | Description
- [GoalsResponseComponent](docs/Model/GoalsResponseComponent.md)
- [IconKey](docs/Model/IconKey.md)
- [InlineResponse200](docs/Model/InlineResponse200.md)
- [InlineResponse2001](docs/Model/InlineResponse2001.md)
- [InlineResponse2002](docs/Model/InlineResponse2002.md)
- [InlineResponse400](docs/Model/InlineResponse400.md)
- [InlineResponse4001](docs/Model/InlineResponse4001.md)
- [InlineResponse4001AdditionalData](docs/Model/InlineResponse4001AdditionalData.md)
Expand Down Expand Up @@ -1101,6 +1105,8 @@ Class | Method | HTTP request | Description
- [OrganizationSearchResponseAllOfData](docs/Model/OrganizationSearchResponseAllOfData.md)
- [OrganizationUpdateResponse](docs/Model/OrganizationUpdateResponse.md)
- [OrganizationUpdateResponseAllOf](docs/Model/OrganizationUpdateResponseAllOf.md)
- [OrganizationsCollectionResponseObject](docs/Model/OrganizationsCollectionResponseObject.md)
- [OrganizationsCollectionResponseObjectAllOf](docs/Model/OrganizationsCollectionResponseObjectAllOf.md)
- [OrganizationsDeleteResponse](docs/Model/OrganizationsDeleteResponse.md)
- [OrganizationsDeleteResponseData](docs/Model/OrganizationsDeleteResponseData.md)
- [OrganizationsMergeResponse](docs/Model/OrganizationsMergeResponse.md)
Expand Down Expand Up @@ -1141,6 +1147,7 @@ Class | Method | HTTP request | Description
- [PersonSearchResponse](docs/Model/PersonSearchResponse.md)
- [PersonSearchResponseAllOf](docs/Model/PersonSearchResponseAllOf.md)
- [PersonSearchResponseAllOfData](docs/Model/PersonSearchResponseAllOfData.md)
- [PersonsCollectionResponseObject](docs/Model/PersonsCollectionResponseObject.md)
- [PictureData](docs/Model/PictureData.md)
- [PictureDataPictures](docs/Model/PictureDataPictures.md)
- [PictureDataWithID](docs/Model/PictureDataWithID.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/Api/ActivitiesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ $limit = 100; // int | For pagination, the limit of entries to be returned. If n
$since = 'since_example'; // string | The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
$until = 'until_example'; // string | The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
$user_id = 56; // int | The ID of the user whose activities will be fetched. If omitted, all activities are returned.
$done = new \Pipedrive\Model\\Pipedrive\Model\NumberBoolean(); // \Pipedrive\Model\NumberBoolean | Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted, returns both done and not done activities.
$done = True; // bool | Whether the activity is done or not. `false` = Not done, `true` = Done. If omitted, returns both done and not done activities.
$type = 'type_example'; // string | The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the `key_string` parameter of ActivityTypes.

try {
Expand All @@ -344,7 +344,7 @@ Name | Type | Description | Notes
**since** | **string**| The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the &#x60;update_time&#x60; field. | [optional]
**until** | **string**| The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the &#x60;update_time&#x60; field. | [optional]
**user_id** | **int**| The ID of the user whose activities will be fetched. If omitted, all activities are returned. | [optional]
**done** | [**\Pipedrive\Model\NumberBoolean**](../Model/.md)| Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted, returns both done and not done activities. | [optional]
**done** | **bool**| Whether the activity is done or not. &#x60;false&#x60; &#x3D; Not done, &#x60;true&#x60; &#x3D; Done. If omitted, returns both done and not done activities. | [optional]
**type** | **string**| The type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the &#x60;key_string&#x60; parameter of ActivityTypes. | [optional]

### Return type
Expand Down
80 changes: 78 additions & 2 deletions docs/Api/OrganizationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Method | HTTP request | Description
[**getOrganizationUpdates()**](OrganizationsApi.md#getOrganizationUpdates) | **GET** /organizations/{id}/flow | List updates about an organization
[**getOrganizationUsers()**](OrganizationsApi.md#getOrganizationUsers) | **GET** /organizations/{id}/permittedUsers | List permitted users
[**getOrganizations()**](OrganizationsApi.md#getOrganizations) | **GET** /organizations | Get all organizations
[**getOrganizationsCollection()**](OrganizationsApi.md#getOrganizationsCollection) | **GET** /organizations/collection | Get all organizations (BETA)
[**mergeOrganizations()**](OrganizationsApi.md#mergeOrganizations) | **PUT** /organizations/{id}/merge | Merge two organizations
[**searchOrganization()**](OrganizationsApi.md#searchOrganization) | **GET** /organizations/search | Search organizations
[**updateOrganization()**](OrganizationsApi.md#updateOrganization) | **PUT** /organizations/{id} | Update an organization
Expand Down Expand Up @@ -1006,7 +1007,7 @@ $apiInstance = new Pipedrive\Api\OrganizationsApi(
);
$user_id = 56; // int | If supplied, only organizations owned by the given user will be returned. However, `filter_id` takes precedence over `user_id` when both are supplied.
$filter_id = 56; // int | The ID of the filter to use
$first_char = 'first_char_example'; // string | If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive)
$first_char = 'first_char_example'; // string | If supplied, only organizations whose name starts with the specified letter will be returned (case-insensitive)
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page
$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys).
Expand All @@ -1025,7 +1026,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_id** | **int**| If supplied, only organizations owned by the given user will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;user_id&#x60; when both are supplied. | [optional]
**filter_id** | **int**| The ID of the filter to use | [optional]
**first_char** | **string**| If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive) | [optional]
**first_char** | **string**| If supplied, only organizations whose name starts with the specified letter will be returned (case-insensitive) | [optional]
**start** | **int**| Pagination start | [optional] [default to 0]
**limit** | **int**| Items shown per page | [optional]
**sort** | **string**| The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys). | [optional]
Expand All @@ -1047,6 +1048,81 @@ Name | Type | Description | Notes
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getOrganizationsCollection()`

```php
getOrganizationsCollection($cursor, $limit, $since, $until, $owner_id, $first_char): \Pipedrive\Model\InlineResponse2001
```

Get all organizations (BETA)

Returns all organizations. This is a cursor-paginated endpoint that is currently in BETA. For more information, please refer to our documentation on <a href=\"https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=\"_blank\" rel=\"noopener noreferrer\">pagination</a>. Please note that only global admins (those with global permissions) can access these endpoints. Users with regular permissions will receive a 403 response. Read more about global permissions <a href=\"https://support.pipedrive.com/en/article/global-user-management\" target=\"_blank\" rel=\"noopener noreferrer\">here</a>.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: api_key
$config = (new Pipedrive\Configuration())->setApiKey('api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\Configuration())->setApiKeyPrefix('api_token', 'Bearer');

// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Pipedrive\Api\OrganizationsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page
$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
$since = 'since_example'; // string | The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
$until = 'until_example'; // string | The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the `update_time` field.
$owner_id = 56; // int | If supplied, only organizations owned by the given user will be returned
$first_char = 'first_char_example'; // string | If supplied, only organizations whose name starts with the specified letter will be returned (case-insensitive)

try {
$result = $apiInstance->getOrganizationsCollection($cursor, $limit, $since, $until, $owner_id, $first_char);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrganizationsApi->getOrganizationsCollection: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**cursor** | **string**| For pagination, the marker (an opaque string value) representing the first item on the next page | [optional]
**limit** | **int**| For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional]
**since** | **string**| The time boundary that points to the start of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the &#x60;update_time&#x60; field. | [optional]
**until** | **string**| The time boundary that points to the end of the range of data. Datetime in ISO 8601 format. E.g. 2022-11-01 08:55:59. Operates on the &#x60;update_time&#x60; field. | [optional]
**owner_id** | **int**| If supplied, only organizations owned by the given user will be returned | [optional]
**first_char** | **string**| If supplied, only organizations whose name starts with the specified letter will be returned (case-insensitive) | [optional]

### Return type

[**\Pipedrive\Model\InlineResponse2001**](../Model/InlineResponse2001.md)

### Authorization

[api_key](../../README.md#api_key), [oauth2](../../README.md#oauth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `mergeOrganizations()`

```php
Expand Down
Loading

0 comments on commit d0883ed

Please sign in to comment.