diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ff63512..a07d7d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ For public Changelog covering all changes done to Pipedrive’s API, webhooks an ## [Unreleased] +## 14.0.0 +### Changed +- Moved `v1/teams*` endpoints to `v1/legacyTeams*` as they're being deprecated because we are preparing for an upgraded version of the Teams API, which requires migrating the current functionality to a new path URL `v1/legacyTeams*`. + The functionality and [OAuth scopes](https://pipedrive.readme.io/docs/marketplace-scopes-and-permissions-explanations) of all the Teams API endpoints will remain the same. + ## 13.3.4 ### Changed - Updated `PUT /productFields/{id}`: parameter `name` is not diff --git a/README.md b/README.md index e6316327..612a43c4 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,10 @@ Class | Method | HTTP request | Description *Pipedrive.CallLogsApi* | [**deleteCallLog**](docs/CallLogsApi.md#deleteCallLog) | **DELETE** /callLogs/{id} | Delete a call log *Pipedrive.CallLogsApi* | [**getCallLog**](docs/CallLogsApi.md#getCallLog) | **GET** /callLogs/{id} | Get details of a call log *Pipedrive.CallLogsApi* | [**getUserCallLogs**](docs/CallLogsApi.md#getUserCallLogs) | **GET** /callLogs | Get all call logs assigned to a particular user +*Pipedrive.ChannelsApi* | [**addChannel**](docs/ChannelsApi.md#addChannel) | **POST** /channels | Add a channel +*Pipedrive.ChannelsApi* | [**deleteChannel**](docs/ChannelsApi.md#deleteChannel) | **DELETE** /channels/{id} | Delete a channel +*Pipedrive.ChannelsApi* | [**deleteConversation**](docs/ChannelsApi.md#deleteConversation) | **DELETE** /channels/{channel-id}/conversations/{conversation-id} | Delete a conversation +*Pipedrive.ChannelsApi* | [**receiveMessage**](docs/ChannelsApi.md#receiveMessage) | **POST** /channels/messages/receive | Receives an incoming message *Pipedrive.CurrenciesApi* | [**getCurrencies**](docs/CurrenciesApi.md#getCurrencies) | **GET** /currencies | Get all supported currencies *Pipedrive.DealFieldsApi* | [**addDealField**](docs/DealFieldsApi.md#addDealField) | **POST** /dealFields | Add a new deal field *Pipedrive.DealFieldsApi* | [**deleteDealField**](docs/DealFieldsApi.md#deleteDealField) | **DELETE** /dealFields/{id} | Delete a deal field @@ -351,6 +355,14 @@ Class | Method | HTTP request | Description *Pipedrive.LeadsApi* | [**getLeads**](docs/LeadsApi.md#getLeads) | **GET** /leads | Get all leads *Pipedrive.LeadsApi* | [**searchLeads**](docs/LeadsApi.md#searchLeads) | **GET** /leads/search | Search leads *Pipedrive.LeadsApi* | [**updateLead**](docs/LeadsApi.md#updateLead) | **PATCH** /leads/{id} | Update a lead +*Pipedrive.LegacyTeamsApi* | [**addTeam**](docs/LegacyTeamsApi.md#addTeam) | **POST** /legacyTeams | Add a new team +*Pipedrive.LegacyTeamsApi* | [**addTeamUser**](docs/LegacyTeamsApi.md#addTeamUser) | **POST** /legacyTeams/{id}/users | Add users to a team +*Pipedrive.LegacyTeamsApi* | [**deleteTeamUser**](docs/LegacyTeamsApi.md#deleteTeamUser) | **DELETE** /legacyTeams/{id}/users | Delete users from a team +*Pipedrive.LegacyTeamsApi* | [**getTeam**](docs/LegacyTeamsApi.md#getTeam) | **GET** /legacyTeams/{id} | Get a single team +*Pipedrive.LegacyTeamsApi* | [**getTeamUsers**](docs/LegacyTeamsApi.md#getTeamUsers) | **GET** /legacyTeams/{id}/users | Get all users in a team +*Pipedrive.LegacyTeamsApi* | [**getTeams**](docs/LegacyTeamsApi.md#getTeams) | **GET** /legacyTeams | Get all teams +*Pipedrive.LegacyTeamsApi* | [**getUserTeams**](docs/LegacyTeamsApi.md#getUserTeams) | **GET** /legacyTeams/user/{id} | Get all teams of a user +*Pipedrive.LegacyTeamsApi* | [**updateTeam**](docs/LegacyTeamsApi.md#updateTeam) | **PUT** /legacyTeams/{id} | Update a team *Pipedrive.MailboxApi* | [**deleteMailThread**](docs/MailboxApi.md#deleteMailThread) | **DELETE** /mailbox/mailThreads/{id} | Delete mail thread *Pipedrive.MailboxApi* | [**getMailMessage**](docs/MailboxApi.md#getMailMessage) | **GET** /mailbox/mailMessages/{id} | Get one mail message *Pipedrive.MailboxApi* | [**getMailThread**](docs/MailboxApi.md#getMailThread) | **GET** /mailbox/mailThreads/{id} | Get one mail thread @@ -480,14 +492,6 @@ Class | Method | HTTP request | Description *Pipedrive.SubscriptionsApi* | [**getSubscriptionPayments**](docs/SubscriptionsApi.md#getSubscriptionPayments) | **GET** /subscriptions/{id}/payments | Get all payments of a subscription *Pipedrive.SubscriptionsApi* | [**updateRecurringSubscription**](docs/SubscriptionsApi.md#updateRecurringSubscription) | **PUT** /subscriptions/recurring/{id} | Update a recurring subscription *Pipedrive.SubscriptionsApi* | [**updateSubscriptionInstallment**](docs/SubscriptionsApi.md#updateSubscriptionInstallment) | **PUT** /subscriptions/installment/{id} | Update an installment subscription -*Pipedrive.TeamsApi* | [**addTeam**](docs/TeamsApi.md#addTeam) | **POST** /teams | Add a new team -*Pipedrive.TeamsApi* | [**addTeamUser**](docs/TeamsApi.md#addTeamUser) | **POST** /teams/{id}/users | Add users to a team -*Pipedrive.TeamsApi* | [**deleteTeamUser**](docs/TeamsApi.md#deleteTeamUser) | **DELETE** /teams/{id}/users | Delete users from a team -*Pipedrive.TeamsApi* | [**getTeam**](docs/TeamsApi.md#getTeam) | **GET** /teams/{id} | Get a single team -*Pipedrive.TeamsApi* | [**getTeamUsers**](docs/TeamsApi.md#getTeamUsers) | **GET** /teams/{id}/users | Get all users in a team -*Pipedrive.TeamsApi* | [**getTeams**](docs/TeamsApi.md#getTeams) | **GET** /teams | Get all teams -*Pipedrive.TeamsApi* | [**getUserTeams**](docs/TeamsApi.md#getUserTeams) | **GET** /teams/user/{id} | Get all teams of a user -*Pipedrive.TeamsApi* | [**updateTeam**](docs/TeamsApi.md#updateTeam) | **PUT** /teams/{id} | Update a team *Pipedrive.UserConnectionsApi* | [**getUserConnections**](docs/UserConnectionsApi.md#getUserConnections) | **GET** /userConnections | Get all user connections *Pipedrive.UserSettingsApi* | [**getUserSettings**](docs/UserSettingsApi.md#getUserSettings) | **GET** /userSettings | List settings of an authorized user *Pipedrive.UsersApi* | [**addUser**](docs/UsersApi.md#addUser) | **POST** /users | Add a new user @@ -631,6 +635,9 @@ Class | Method | HTTP request | Description - [Pipedrive.CallLogResponse409](docs/CallLogResponse409.md) - [Pipedrive.CallLogResponse410](docs/CallLogResponse410.md) - [Pipedrive.CallLogResponse500](docs/CallLogResponse500.md) + - [Pipedrive.ChannelObject](docs/ChannelObject.md) + - [Pipedrive.ChannelObjectResponse](docs/ChannelObjectResponse.md) + - [Pipedrive.ChannelObjectResponseData](docs/ChannelObjectResponseData.md) - [Pipedrive.CommentPostPutObject](docs/CommentPostPutObject.md) - [Pipedrive.CommonMailThread](docs/CommonMailThread.md) - [Pipedrive.CreateRemoteFileAndLinkItToItem](docs/CreateRemoteFileAndLinkItToItem.md) @@ -695,7 +702,9 @@ Class | Method | HTTP request | Description - [Pipedrive.DeleteActivitiesResponse200Data](docs/DeleteActivitiesResponse200Data.md) - [Pipedrive.DeleteActivityResponse200](docs/DeleteActivityResponse200.md) - [Pipedrive.DeleteActivityResponse200Data](docs/DeleteActivityResponse200Data.md) + - [Pipedrive.DeleteChannelSuccess](docs/DeleteChannelSuccess.md) - [Pipedrive.DeleteComment](docs/DeleteComment.md) + - [Pipedrive.DeleteConversationSuccess](docs/DeleteConversationSuccess.md) - [Pipedrive.DeleteDeal](docs/DeleteDeal.md) - [Pipedrive.DeleteDealData](docs/DeleteDealData.md) - [Pipedrive.DeleteDealFollower](docs/DeleteDealFollower.md) @@ -857,6 +866,16 @@ Class | Method | HTTP request | Description - [Pipedrive.GoalType](docs/GoalType.md) - [Pipedrive.GoalsResponseComponent](docs/GoalsResponseComponent.md) - [Pipedrive.IconKey](docs/IconKey.md) + - [Pipedrive.InlineResponse400](docs/InlineResponse400.md) + - [Pipedrive.InlineResponse4001](docs/InlineResponse4001.md) + - [Pipedrive.InlineResponse4001AdditionalData](docs/InlineResponse4001AdditionalData.md) + - [Pipedrive.InlineResponse400AdditionalData](docs/InlineResponse400AdditionalData.md) + - [Pipedrive.InlineResponse403](docs/InlineResponse403.md) + - [Pipedrive.InlineResponse4031](docs/InlineResponse4031.md) + - [Pipedrive.InlineResponse4031AdditionalData](docs/InlineResponse4031AdditionalData.md) + - [Pipedrive.InlineResponse403AdditionalData](docs/InlineResponse403AdditionalData.md) + - [Pipedrive.InlineResponse404](docs/InlineResponse404.md) + - [Pipedrive.InlineResponse404AdditionalData](docs/InlineResponse404AdditionalData.md) - [Pipedrive.ItemSearchAdditionalData](docs/ItemSearchAdditionalData.md) - [Pipedrive.ItemSearchAdditionalDataPagination](docs/ItemSearchAdditionalDataPagination.md) - [Pipedrive.ItemSearchFieldResponse](docs/ItemSearchFieldResponse.md) @@ -942,6 +961,8 @@ Class | Method | HTTP request | Description - [Pipedrive.MergePersonsRequest](docs/MergePersonsRequest.md) - [Pipedrive.MergePersonsResponse](docs/MergePersonsResponse.md) - [Pipedrive.MergePersonsResponseAllOf](docs/MergePersonsResponseAllOf.md) + - [Pipedrive.MessageObject](docs/MessageObject.md) + - [Pipedrive.MessageObjectAttachments](docs/MessageObjectAttachments.md) - [Pipedrive.NewDeal](docs/NewDeal.md) - [Pipedrive.NewDealAllOf](docs/NewDealAllOf.md) - [Pipedrive.NewDealProduct](docs/NewDealProduct.md) @@ -1240,7 +1261,7 @@ Class | Method | HTTP request | Description - mail:full: Read, update and delete mail threads. Also grants read access to mail messages. - products:read: Read products, its fields, files, followers and products connected to a deal. - products:full: Create, read, update and delete products and its fields; add products to deals - - users:read: Read data about users (people with access to a Pipedrive account), their permissions, roles and followers, as well as about teams. + - users:read: Read data about users (people with access to a Pipedrive account), their permissions, roles and followers, as well as about legacy teams. - base: Read settings of the authorized user and currencies in an account. - phone-integration: Create, read and delete call logs and its audio recordings. diff --git a/docs/ChannelObject.md b/docs/ChannelObject.md new file mode 100644 index 00000000..f817cf48 --- /dev/null +++ b/docs/ChannelObject.md @@ -0,0 +1,26 @@ +# Pipedrive.ChannelObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the channel | +**providerChannelId** | **String** | The channel ID | +**avatarUrl** | **String** | The URL for an icon that represents your channel | [optional] +**templateSupport** | **Boolean** | If true, enables templates logic on UI. Requires getTemplates endpoint implemented. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension). | [optional] [default to false] +**providerType** | **String** | It controls the icons (like the icon next to the conversation) | [optional] [default to 'other'] + + + +## Enum: ProviderTypeEnum + + +* `facebook` (value: `"facebook"`) + +* `whatsapp` (value: `"whatsapp"`) + +* `other` (value: `"other"`) + + + + diff --git a/docs/ChannelObjectResponse.md b/docs/ChannelObjectResponse.md new file mode 100644 index 00000000..335d27e2 --- /dev/null +++ b/docs/ChannelObjectResponse.md @@ -0,0 +1,10 @@ +# Pipedrive.ChannelObjectResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**data** | [**[ChannelObjectResponseData]**](ChannelObjectResponseData.md) | | [optional] + + diff --git a/docs/ChannelObjectResponseData.md b/docs/ChannelObjectResponseData.md new file mode 100644 index 00000000..36f2d195 --- /dev/null +++ b/docs/ChannelObjectResponseData.md @@ -0,0 +1,31 @@ +# Pipedrive.ChannelObjectResponseData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The unique channel ID used internally in omnichannel-api and the frontend of the extension | [optional] +**name** | **String** | The name of the channel | [optional] +**avatarUrl** | **String** | The URL for an icon that represents your channel | [optional] +**providerChannelId** | **String** | The channel ID you specified while creating the channel | [optional] +**marketplaceClientId** | **String** | The client_id of your app in Pipedrive marketplace | [optional] +**pdCompanyId** | **Number** | The ID of the user's company in Pipedrive | [optional] +**pdUserId** | **Number** | The ID of the user in Pipedrive | [optional] +**createdAt** | **Date** | The date and time when your channel was created in the API | [optional] +**providerType** | **String** | Value of the provider_type sent to this endpoint | [optional] +**templateSupport** | **Boolean** | Value of the template_support sent to this endpoint | [optional] + + + +## Enum: ProviderTypeEnum + + +* `facebook` (value: `"facebook"`) + +* `whatsapp` (value: `"whatsapp"`) + +* `other` (value: `"other"`) + + + + diff --git a/docs/ChannelsApi.md b/docs/ChannelsApi.md new file mode 100644 index 00000000..d9b235b8 --- /dev/null +++ b/docs/ChannelsApi.md @@ -0,0 +1,230 @@ +# Pipedrive.ChannelsApi + +All URIs are relative to *https://api.pipedrive.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addChannel**](ChannelsApi.md#addChannel) | **POST** /channels | Add a channel +[**deleteChannel**](ChannelsApi.md#deleteChannel) | **DELETE** /channels/{id} | Delete a channel +[**deleteConversation**](ChannelsApi.md#deleteConversation) | **DELETE** /channels/{channel-id}/conversations/{conversation-id} | Delete a conversation +[**receiveMessage**](ChannelsApi.md#receiveMessage) | **POST** /channels/messages/receive | Receives an incoming message + + + +## addChannel + +> ChannelObjectResponse addChannel(opts) + +Add a channel + +Adds a new messaging, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. Read more in [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.ChannelsApi(); +let opts = Pipedrive.ChannelObject.constructFromObject({ + // Properties that you want to update +}); +apiInstance.addChannel(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **channelObject** | [**ChannelObject**](ChannelObject.md)| | [optional] + +### Return type + +[**ChannelObjectResponse**](ChannelObjectResponse.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## deleteChannel + +> DeleteChannelSuccess deleteChannel(id) + +Delete a channel + +Deletes an existing messengers channel and all related entities (conversations and messages). + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.ChannelsApi(); +let id = "id_example"; // String | The ID of the channel provided by the integration +apiInstance.deleteChannel(id).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **String**| The ID of the channel provided by the integration | + +### Return type + +[**DeleteChannelSuccess**](DeleteChannelSuccess.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## deleteConversation + +> DeleteConversationSuccess deleteConversation(channelId, conversationId) + +Delete a conversation + +Deletes an existing conversation. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.ChannelsApi(); +let channelId = "channelId_example"; // String | The ID of the channel provided by the integration +let conversationId = "conversationId_example"; // String | The ID of the conversation provided by the integration +apiInstance.deleteConversation(channelId, conversationId).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **channelId** | **String**| The ID of the channel provided by the integration | + **conversationId** | **String**| The ID of the conversation provided by the integration | + +### Return type + +[**DeleteConversationSuccess**](DeleteConversationSuccess.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## receiveMessage + +> MessageObject receiveMessage(opts) + +Receives an incoming message + +Adds a message to a conversation. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.ChannelsApi(); +let opts = Pipedrive.MessageObject.constructFromObject({ + // Properties that you want to update +}); +apiInstance.receiveMessage(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **messageObject** | [**MessageObject**](MessageObject.md)| | [optional] + +### Return type + +[**MessageObject**](MessageObject.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/DeleteChannelSuccess.md b/docs/DeleteChannelSuccess.md new file mode 100644 index 00000000..982e4fdf --- /dev/null +++ b/docs/DeleteChannelSuccess.md @@ -0,0 +1,9 @@ +# Pipedrive.DeleteChannelSuccess + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] + + diff --git a/docs/DeleteConversationSuccess.md b/docs/DeleteConversationSuccess.md new file mode 100644 index 00000000..dbb573cc --- /dev/null +++ b/docs/DeleteConversationSuccess.md @@ -0,0 +1,9 @@ +# Pipedrive.DeleteConversationSuccess + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] + + diff --git a/docs/InlineResponse400.md b/docs/InlineResponse400.md new file mode 100644 index 00000000..562846ec --- /dev/null +++ b/docs/InlineResponse400.md @@ -0,0 +1,12 @@ +# Pipedrive.InlineResponse400 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**error** | **String** | The error description | [optional] +**errorInfo** | **String** | | [optional] +**additionalData** | [**InlineResponse400AdditionalData**](InlineResponse400AdditionalData.md) | | [optional] + + diff --git a/docs/InlineResponse4001.md b/docs/InlineResponse4001.md new file mode 100644 index 00000000..e55170d3 --- /dev/null +++ b/docs/InlineResponse4001.md @@ -0,0 +1,12 @@ +# Pipedrive.InlineResponse4001 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**error** | **String** | The error description | [optional] +**errorInfo** | **String** | | [optional] +**additionalData** | [**InlineResponse4001AdditionalData**](InlineResponse4001AdditionalData.md) | | [optional] + + diff --git a/docs/InlineResponse4001AdditionalData.md b/docs/InlineResponse4001AdditionalData.md new file mode 100644 index 00000000..1095ea13 --- /dev/null +++ b/docs/InlineResponse4001AdditionalData.md @@ -0,0 +1,9 @@ +# Pipedrive.InlineResponse4001AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | An error code sent by the API | [optional] + + diff --git a/docs/InlineResponse400AdditionalData.md b/docs/InlineResponse400AdditionalData.md new file mode 100644 index 00000000..baf83f20 --- /dev/null +++ b/docs/InlineResponse400AdditionalData.md @@ -0,0 +1,9 @@ +# Pipedrive.InlineResponse400AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | An error code sent by the API | [optional] + + diff --git a/docs/InlineResponse403.md b/docs/InlineResponse403.md new file mode 100644 index 00000000..42363f38 --- /dev/null +++ b/docs/InlineResponse403.md @@ -0,0 +1,12 @@ +# Pipedrive.InlineResponse403 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**error** | **String** | The error description | [optional] +**errorInfo** | **String** | | [optional] +**additionalData** | [**InlineResponse403AdditionalData**](InlineResponse403AdditionalData.md) | | [optional] + + diff --git a/docs/InlineResponse4031.md b/docs/InlineResponse4031.md new file mode 100644 index 00000000..7485660e --- /dev/null +++ b/docs/InlineResponse4031.md @@ -0,0 +1,12 @@ +# Pipedrive.InlineResponse4031 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**error** | **String** | The error description | [optional] +**errorInfo** | **String** | | [optional] +**additionalData** | [**InlineResponse4031AdditionalData**](InlineResponse4031AdditionalData.md) | | [optional] + + diff --git a/docs/InlineResponse4031AdditionalData.md b/docs/InlineResponse4031AdditionalData.md new file mode 100644 index 00000000..a280c644 --- /dev/null +++ b/docs/InlineResponse4031AdditionalData.md @@ -0,0 +1,9 @@ +# Pipedrive.InlineResponse4031AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | An error code sent by the API | [optional] + + diff --git a/docs/InlineResponse403AdditionalData.md b/docs/InlineResponse403AdditionalData.md new file mode 100644 index 00000000..40a12637 --- /dev/null +++ b/docs/InlineResponse403AdditionalData.md @@ -0,0 +1,9 @@ +# Pipedrive.InlineResponse403AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | An error code sent by the API | [optional] + + diff --git a/docs/InlineResponse404.md b/docs/InlineResponse404.md new file mode 100644 index 00000000..2cb2fa40 --- /dev/null +++ b/docs/InlineResponse404.md @@ -0,0 +1,12 @@ +# Pipedrive.InlineResponse404 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **Boolean** | | [optional] +**error** | **String** | The error description | [optional] +**errorInfo** | **String** | | [optional] +**additionalData** | [**InlineResponse404AdditionalData**](InlineResponse404AdditionalData.md) | | [optional] + + diff --git a/docs/InlineResponse404AdditionalData.md b/docs/InlineResponse404AdditionalData.md new file mode 100644 index 00000000..02f949c4 --- /dev/null +++ b/docs/InlineResponse404AdditionalData.md @@ -0,0 +1,9 @@ +# Pipedrive.InlineResponse404AdditionalData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | An error code sent by the API | [optional] + + diff --git a/docs/LegacyTeamsApi.md b/docs/LegacyTeamsApi.md new file mode 100644 index 00000000..0cfe3e4f --- /dev/null +++ b/docs/LegacyTeamsApi.md @@ -0,0 +1,468 @@ +# Pipedrive.LegacyTeamsApi + +All URIs are relative to *https://api.pipedrive.com/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addTeam**](LegacyTeamsApi.md#addTeam) | **POST** /legacyTeams | Add a new team +[**addTeamUser**](LegacyTeamsApi.md#addTeamUser) | **POST** /legacyTeams/{id}/users | Add users to a team +[**deleteTeamUser**](LegacyTeamsApi.md#deleteTeamUser) | **DELETE** /legacyTeams/{id}/users | Delete users from a team +[**getTeam**](LegacyTeamsApi.md#getTeam) | **GET** /legacyTeams/{id} | Get a single team +[**getTeamUsers**](LegacyTeamsApi.md#getTeamUsers) | **GET** /legacyTeams/{id}/users | Get all users in a team +[**getTeams**](LegacyTeamsApi.md#getTeams) | **GET** /legacyTeams | Get all teams +[**getUserTeams**](LegacyTeamsApi.md#getUserTeams) | **GET** /legacyTeams/user/{id} | Get all teams of a user +[**updateTeam**](LegacyTeamsApi.md#updateTeam) | **PUT** /legacyTeams/{id} | Update a team + + + +## addTeam + +> Team addTeam(opts) + +Add a new team + +Adds a new team to the company and returns the created object. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let opts = Pipedrive.CreateTeam.constructFromObject({ + // Properties that you want to update +}); +apiInstance.addTeam(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createTeam** | [**CreateTeam**](CreateTeam.md)| | [optional] + +### Return type + +[**Team**](Team.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## addTeamUser + +> UserIDs addTeamUser(id, opts) + +Add users to a team + +Adds users to an existing team. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let id = 56; // Number | The ID of the team +let opts = Pipedrive.AddTeamUserRequest.constructFromObject({ + // Properties that you want to update +}); +apiInstance.addTeamUser(id, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Number**| The ID of the team | + **addTeamUserRequest** | [**AddTeamUserRequest**](AddTeamUserRequest.md)| | [optional] + +### Return type + +[**UserIDs**](UserIDs.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## deleteTeamUser + +> UserIDs deleteTeamUser(id, opts) + +Delete users from a team + +Deletes users from an existing team. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let id = 56; // Number | The ID of the team +let opts = Pipedrive.DeleteTeamUserRequest.constructFromObject({ + // Properties that you want to update +}); +apiInstance.deleteTeamUser(id, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Number**| The ID of the team | + **deleteTeamUserRequest** | [**DeleteTeamUserRequest**](DeleteTeamUserRequest.md)| | [optional] + +### Return type + +[**UserIDs**](UserIDs.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## getTeam + +> Team getTeam(id, opts) + +Get a single team + +Returns data about a specific team. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let id = 56; // Number | The ID of the team +let opts = { + 'skipUsers': new Pipedrive.NumberBooleanDefault0() // NumberBooleanDefault0 | When enabled, the teams will not include IDs of member users +}; +apiInstance.getTeam(id, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Number**| The ID of the team | + **skipUsers** | [**NumberBooleanDefault0**](.md)| When enabled, the teams will not include IDs of member users | [optional] + +### Return type + +[**Team**](Team.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getTeamUsers + +> UserIDs getTeamUsers(id) + +Get all users in a team + +Returns a list of all user IDs within a team. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let id = 56; // Number | The ID of the team +apiInstance.getTeamUsers(id).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Number**| The ID of the team | + +### Return type + +[**UserIDs**](UserIDs.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getTeams + +> Teams getTeams(opts) + +Get all teams + +Returns data about teams within the company. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let opts = { + 'orderBy': "'id'", // String | The field name to sort returned teams by + 'skipUsers': new Pipedrive.NumberBooleanDefault0() // NumberBooleanDefault0 | When enabled, the teams will not include IDs of member users +}; +apiInstance.getTeams(opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderBy** | **String**| The field name to sort returned teams by | [optional] [default to 'id'] + **skipUsers** | [**NumberBooleanDefault0**](.md)| When enabled, the teams will not include IDs of member users | [optional] + +### Return type + +[**Teams**](Teams.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getUserTeams + +> Teams getUserTeams(id, opts) + +Get all teams of a user + +Returns data about all teams which have the specified user as a member. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let id = 56; // Number | The ID of the user +let opts = { + 'orderBy': "'id'", // String | The field name to sort returned teams by + 'skipUsers': new Pipedrive.NumberBooleanDefault0() // NumberBooleanDefault0 | When enabled, the teams will not include IDs of member users +}; +apiInstance.getUserTeams(id, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Number**| The ID of the user | + **orderBy** | **String**| The field name to sort returned teams by | [optional] [default to 'id'] + **skipUsers** | [**NumberBooleanDefault0**](.md)| When enabled, the teams will not include IDs of member users | [optional] + +### Return type + +[**Teams**](Teams.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## updateTeam + +> Team updateTeam(id, opts) + +Update a team + +Updates an existing team and returns the updated object. + +### Example + +```javascript +import Pipedrive from 'pipedrive'; +let defaultClient = Pipedrive.ApiClient.instance; +// Configure API key authorization: api_key +let api_key = defaultClient.authentications['api_key']; +api_key.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//api_key.apiKeyPrefix = 'Token'; +// Configure OAuth2 access token for authorization: oauth2 +let oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +let apiInstance = new Pipedrive.LegacyTeamsApi(); +let id = 56; // Number | The ID of the team +let opts = Pipedrive.UpdateTeam.constructFromObject({ + // Properties that you want to update +}); +apiInstance.updateTeam(id, opts).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **Number**| The ID of the team | + **updateTeam** | [**UpdateTeam**](UpdateTeam.md)| | [optional] + +### Return type + +[**Team**](Team.md) + +### Authorization + +[api_key](../README.md#api_key), [oauth2](../README.md#oauth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/MessageObject.md b/docs/MessageObject.md new file mode 100644 index 00000000..64c3d3d1 --- /dev/null +++ b/docs/MessageObject.md @@ -0,0 +1,33 @@ +# Pipedrive.MessageObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The ID of the message | +**channelId** | **String** | The channel ID as in the provider | +**senderId** | **String** | The ID of the provider's user that sent the message | +**conversationId** | **String** | The ID of the conversation | +**message** | **String** | The body of the message | +**status** | **String** | The status of the message | +**createdAt** | **Date** | The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM | +**replyBy** | **Date** | The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM | [optional] +**conversationLink** | **String** | A URL that can open the conversation in the provider's side | [optional] +**attachments** | [**[MessageObjectAttachments]**](MessageObjectAttachments.md) | The list of attachments available in the message | [optional] + + + +## Enum: StatusEnum + + +* `sent` (value: `"sent"`) + +* `delivered` (value: `"delivered"`) + +* `read` (value: `"read"`) + +* `failed` (value: `"failed"`) + + + + diff --git a/docs/MessageObjectAttachments.md b/docs/MessageObjectAttachments.md new file mode 100644 index 00000000..8c1b9229 --- /dev/null +++ b/docs/MessageObjectAttachments.md @@ -0,0 +1,15 @@ +# Pipedrive.MessageObjectAttachments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The ID of the attachment | +**type** | **String** | The mime-type of the attachment | +**name** | **String** | The name of the attachment | [optional] +**size** | **Number** | The size of the attachment | [optional] +**url** | **String** | A URL to the file | +**previewUrl** | **String** | A URL to a preview picture of the file | [optional] +**linkExpires** | **Boolean** | If true, it will use the getMessageById endpoint for fetching updated attachment's urls. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension) | [optional] [default to false] + + diff --git a/src/api/ChannelsApi.js b/src/api/ChannelsApi.js new file mode 100644 index 00000000..07773d11 --- /dev/null +++ b/src/api/ChannelsApi.js @@ -0,0 +1,340 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import ChannelObject from '../model/ChannelObject'; +import ChannelObjectResponse from '../model/ChannelObjectResponse'; +import DeleteChannelSuccess from '../model/DeleteChannelSuccess'; +import DeleteConversationSuccess from '../model/DeleteConversationSuccess'; +import InlineResponse400 from '../model/InlineResponse400'; +import InlineResponse4001 from '../model/InlineResponse4001'; +import InlineResponse403 from '../model/InlineResponse403'; +import InlineResponse4031 from '../model/InlineResponse4031'; +import InlineResponse404 from '../model/InlineResponse404'; +import MessageObject from '../model/MessageObject'; + +/** +* Channels service. +* @module api/ChannelsApi +* @version 1.0.0 +*/ +export default class ChannelsApi { + + /** + * Constructs a new ChannelsApi. + * @alias module:api/ChannelsApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * Add a channel + * Adds a new messaging, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. Read more in [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + * @param {Object} opts Optional parameters + * @param {module:model/ChannelObject} opts.channelObject + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ChannelObjectResponse} and HTTP response + */ + addChannelWithHttpInfo(opts) { + opts = opts || {}; + let postBody = opts['channelObject']; + + if (opts['name'] === undefined || opts['name'] === null) { + throw new Error("Missing the required parameter 'name' when calling addChannel"); + } + if (opts['provider_channel_id'] === undefined || opts['provider_channel_id'] === null) { + throw new Error("Missing the required parameter 'provider_channel_id' when calling addChannel"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = ['application/json', ]; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = ChannelObjectResponse; + return this.apiClient.callApi( + '/channels', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Add a channel + * Adds a new messaging, only admins are able to register new channels. It will use the getConversations endpoint to fetch conversations, participants and messages afterward. Read more in [Messaging app extension](https://pipedrive.readme.io/docs/messaging-app-extension). + * @param {Object} opts Optional parameters + * @param {module:model/ChannelObject} opts.channelObject + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ChannelObjectResponse} + */ + addChannel(opts) { + return this.addChannelWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Delete a channel + * Deletes an existing messengers channel and all related entities (conversations and messages). + * @param {String} id The ID of the channel provided by the integration + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteChannelSuccess} and HTTP response + */ + deleteChannelWithHttpInfo(id) { + const opts = {} + let postBody = null; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling deleteChannel"); + } + + let pathParams = { + 'id': id, + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = []; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = DeleteChannelSuccess; + return this.apiClient.callApi( + '/channels/{id}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Delete a channel + * Deletes an existing messengers channel and all related entities (conversations and messages). + * @param {String} id The ID of the channel provided by the integration + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteChannelSuccess} + */ + deleteChannel(id) { + return this.deleteChannelWithHttpInfo(id) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Delete a conversation + * Deletes an existing conversation. + * @param {String} channelId The ID of the channel provided by the integration + * @param {String} conversationId The ID of the conversation provided by the integration + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteConversationSuccess} and HTTP response + */ + deleteConversationWithHttpInfo(channelId, conversationId) { + const opts = {} + let postBody = null; + + // verify the required parameter 'channelId' is set + if (channelId === undefined || channelId === null) { + throw new Error("Missing the required parameter 'channelId' when calling deleteConversation"); + } + + // verify the required parameter 'conversationId' is set + if (conversationId === undefined || conversationId === null) { + throw new Error("Missing the required parameter 'conversationId' when calling deleteConversation"); + } + + let pathParams = { + 'channel-id': channelId, + 'conversation-id': conversationId, + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = []; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = DeleteConversationSuccess; + return this.apiClient.callApi( + '/channels/{channel-id}/conversations/{conversation-id}', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Delete a conversation + * Deletes an existing conversation. + * @param {String} channelId The ID of the channel provided by the integration + * @param {String} conversationId The ID of the conversation provided by the integration + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteConversationSuccess} + */ + deleteConversation(channelId, conversationId) { + return this.deleteConversationWithHttpInfo(channelId, conversationId) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Receives an incoming message + * Adds a message to a conversation. + * @param {Object} opts Optional parameters + * @param {module:model/MessageObject} opts.messageObject + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/MessageObject} and HTTP response + */ + receiveMessageWithHttpInfo(opts) { + opts = opts || {}; + let postBody = opts['messageObject']; + + if (opts['id'] === undefined || opts['id'] === null) { + throw new Error("Missing the required parameter 'id' when calling receiveMessage"); + } + if (opts['channel_id'] === undefined || opts['channel_id'] === null) { + throw new Error("Missing the required parameter 'channel_id' when calling receiveMessage"); + } + if (opts['sender_id'] === undefined || opts['sender_id'] === null) { + throw new Error("Missing the required parameter 'sender_id' when calling receiveMessage"); + } + if (opts['conversation_id'] === undefined || opts['conversation_id'] === null) { + throw new Error("Missing the required parameter 'conversation_id' when calling receiveMessage"); + } + if (opts['message'] === undefined || opts['message'] === null) { + throw new Error("Missing the required parameter 'message' when calling receiveMessage"); + } + if (opts['status'] === undefined || opts['status'] === null) { + throw new Error("Missing the required parameter 'status' when calling receiveMessage"); + } + if (opts['created_at'] === undefined || opts['created_at'] === null) { + throw new Error("Missing the required parameter 'created_at' when calling receiveMessage"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = ['application/json', ]; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = MessageObject; + return this.apiClient.callApi( + '/channels/messages/receive', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Receives an incoming message + * Adds a message to a conversation. + * @param {Object} opts Optional parameters + * @param {module:model/MessageObject} opts.messageObject + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/MessageObject} + */ + receiveMessage(opts) { + return this.receiveMessageWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + +} diff --git a/src/api/LegacyTeamsApi.js b/src/api/LegacyTeamsApi.js new file mode 100644 index 00000000..a7ceed05 --- /dev/null +++ b/src/api/LegacyTeamsApi.js @@ -0,0 +1,616 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import AddTeamUserRequest from '../model/AddTeamUserRequest'; +import CreateTeam from '../model/CreateTeam'; +import DeleteTeamUserRequest from '../model/DeleteTeamUserRequest'; +import FailResponse from '../model/FailResponse'; +import NumberBooleanDefault0 from '../model/NumberBooleanDefault0'; +import Team from '../model/Team'; +import Teams from '../model/Teams'; +import UpdateTeam from '../model/UpdateTeam'; +import UserIDs from '../model/UserIDs'; + +/** +* LegacyTeams service. +* @module api/LegacyTeamsApi +* @version 1.0.0 +*/ +export default class LegacyTeamsApi { + + /** + * Constructs a new LegacyTeamsApi. + * @alias module:api/LegacyTeamsApi + * @class + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * Add a new team + * Adds a new team to the company and returns the created object. + * @param {Object} opts Optional parameters + * @param {module:model/CreateTeam} opts.createTeam + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Team} and HTTP response + */ + addTeamWithHttpInfo(opts) { + opts = opts || {}; + let postBody = opts['createTeam']; + + if (opts['name'] === undefined || opts['name'] === null) { + throw new Error("Missing the required parameter 'name' when calling addTeam"); + } + if (opts['manager_id'] === undefined || opts['manager_id'] === null) { + throw new Error("Missing the required parameter 'manager_id' when calling addTeam"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = ['application/json', ]; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = Team; + return this.apiClient.callApi( + '/legacyTeams', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Add a new team + * Adds a new team to the company and returns the created object. + * @param {Object} opts Optional parameters + * @param {module:model/CreateTeam} opts.createTeam + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Team} + */ + addTeam(opts) { + return this.addTeamWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Add users to a team + * Adds users to an existing team. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/AddTeamUserRequest} opts.addTeamUserRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserIDs} and HTTP response + */ + addTeamUserWithHttpInfo(id, opts) { + opts = opts || {}; + let postBody = opts['addTeamUserRequest']; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling addTeamUser"); + } + + if (opts['users'] === undefined || opts['users'] === null) { + throw new Error("Missing the required parameter 'users' when calling addTeamUser"); + } + + let pathParams = { + 'id': id, + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = ['application/json', ]; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = UserIDs; + return this.apiClient.callApi( + '/legacyTeams/{id}/users', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Add users to a team + * Adds users to an existing team. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/AddTeamUserRequest} opts.addTeamUserRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserIDs} + */ + addTeamUser(id, opts) { + return this.addTeamUserWithHttpInfo(id, opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Delete users from a team + * Deletes users from an existing team. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/DeleteTeamUserRequest} opts.deleteTeamUserRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserIDs} and HTTP response + */ + deleteTeamUserWithHttpInfo(id, opts) { + opts = opts || {}; + let postBody = opts['deleteTeamUserRequest']; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling deleteTeamUser"); + } + + if (opts['users'] === undefined || opts['users'] === null) { + throw new Error("Missing the required parameter 'users' when calling deleteTeamUser"); + } + + let pathParams = { + 'id': id, + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = ['application/json', ]; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = UserIDs; + return this.apiClient.callApi( + '/legacyTeams/{id}/users', 'DELETE', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Delete users from a team + * Deletes users from an existing team. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/DeleteTeamUserRequest} opts.deleteTeamUserRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserIDs} + */ + deleteTeamUser(id, opts) { + return this.deleteTeamUserWithHttpInfo(id, opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Get a single team + * Returns data about a specific team. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Team} and HTTP response + */ + getTeamWithHttpInfo(id, opts) { + opts = opts || {}; + let postBody = null; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling getTeam"); + } + + + let pathParams = { + 'id': id, + }; + let queryParams = { + 'skip_users': opts['skipUsers'], + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = []; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = Team; + return this.apiClient.callApi( + '/legacyTeams/{id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get a single team + * Returns data about a specific team. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Team} + */ + getTeam(id, opts) { + return this.getTeamWithHttpInfo(id, opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Get all users in a team + * Returns a list of all user IDs within a team. + * @param {Number} id The ID of the team + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UserIDs} and HTTP response + */ + getTeamUsersWithHttpInfo(id) { + const opts = {} + let postBody = null; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling getTeamUsers"); + } + + let pathParams = { + 'id': id, + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = []; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = UserIDs; + return this.apiClient.callApi( + '/legacyTeams/{id}/users', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get all users in a team + * Returns a list of all user IDs within a team. + * @param {Number} id The ID of the team + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UserIDs} + */ + getTeamUsers(id) { + return this.getTeamUsersWithHttpInfo(id) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Get all teams + * Returns data about teams within the company. + * @param {Object} opts Optional parameters + * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id') + * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Teams} and HTTP response + */ + getTeamsWithHttpInfo(opts) { + opts = opts || {}; + let postBody = null; + + + + let pathParams = { + }; + let queryParams = { + 'order_by': opts['orderBy'], + 'skip_users': opts['skipUsers'], + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = []; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = Teams; + return this.apiClient.callApi( + '/legacyTeams', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get all teams + * Returns data about teams within the company. + * @param {Object} opts Optional parameters + * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id') + * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Teams} + */ + getTeams(opts) { + return this.getTeamsWithHttpInfo(opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Get all teams of a user + * Returns data about all teams which have the specified user as a member. + * @param {Number} id The ID of the user + * @param {Object} opts Optional parameters + * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id') + * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Teams} and HTTP response + */ + getUserTeamsWithHttpInfo(id, opts) { + opts = opts || {}; + let postBody = null; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling getUserTeams"); + } + + + + let pathParams = { + 'id': id, + }; + let queryParams = { + 'order_by': opts['orderBy'], + 'skip_users': opts['skipUsers'], + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = []; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = Teams; + return this.apiClient.callApi( + '/legacyTeams/user/{id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Get all teams of a user + * Returns data about all teams which have the specified user as a member. + * @param {Number} id The ID of the user + * @param {Object} opts Optional parameters + * @param {module:model/String} opts.orderBy The field name to sort returned teams by (default to 'id') + * @param {module:model/NumberBooleanDefault0} opts.skipUsers When enabled, the teams will not include IDs of member users + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Teams} + */ + getUserTeams(id, opts) { + return this.getUserTeamsWithHttpInfo(id, opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + + /** + * Update a team + * Updates an existing team and returns the updated object. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/UpdateTeam} opts.updateTeam + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Team} and HTTP response + */ + updateTeamWithHttpInfo(id, opts) { + opts = opts || {}; + let postBody = opts['updateTeam']; + + // verify the required parameter 'id' is set + if (id === undefined || id === null) { + throw new Error("Missing the required parameter 'id' when calling updateTeam"); + } + + + let pathParams = { + 'id': id, + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let formParamArray = [ + ]; + + let contentTypes = ['application/json', ]; + const isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded'); + const isJSON = contentTypes.includes('application/json'); + + if (isJSON) { + postBody = { ...postBody, ...opts }; + } else if (isURLEncoded) { + for (let key in opts) { + if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) { + formParams[key] = opts[key]; + } + } + } + + let authNames = ['api_key', 'oauth2', ]; + let accepts = ['application/json', ]; + let returnType = Team; + return this.apiClient.callApi( + '/legacyTeams/{id}', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Update a team + * Updates an existing team and returns the updated object. + * @param {Number} id The ID of the team + * @param {Object} opts Optional parameters + * @param {module:model/UpdateTeam} opts.updateTeam + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Team} + */ + updateTeam(id, opts) { + return this.updateTeamWithHttpInfo(id, opts) + .then(function(response_and_data) { + return response_and_data; + }); + } + + +} diff --git a/src/index.js b/src/index.js index d4f56e8d..fbcc644b 100644 --- a/src/index.js +++ b/src/index.js @@ -135,6 +135,9 @@ import CallLogResponse404 from './model/CallLogResponse404'; import CallLogResponse409 from './model/CallLogResponse409'; import CallLogResponse410 from './model/CallLogResponse410'; import CallLogResponse500 from './model/CallLogResponse500'; +import ChannelObject from './model/ChannelObject'; +import ChannelObjectResponse from './model/ChannelObjectResponse'; +import ChannelObjectResponseData from './model/ChannelObjectResponseData'; import CommentPostPutObject from './model/CommentPostPutObject'; import CommonMailThread from './model/CommonMailThread'; import CreateRemoteFileAndLinkItToItem from './model/CreateRemoteFileAndLinkItToItem'; @@ -199,7 +202,9 @@ import DeleteActivitiesResponse200 from './model/DeleteActivitiesResponse200'; import DeleteActivitiesResponse200Data from './model/DeleteActivitiesResponse200Data'; import DeleteActivityResponse200 from './model/DeleteActivityResponse200'; import DeleteActivityResponse200Data from './model/DeleteActivityResponse200Data'; +import DeleteChannelSuccess from './model/DeleteChannelSuccess'; import DeleteComment from './model/DeleteComment'; +import DeleteConversationSuccess from './model/DeleteConversationSuccess'; import DeleteDeal from './model/DeleteDeal'; import DeleteDealData from './model/DeleteDealData'; import DeleteDealFollower from './model/DeleteDealFollower'; @@ -361,6 +366,16 @@ import GoalResults from './model/GoalResults'; import GoalType from './model/GoalType'; import GoalsResponseComponent from './model/GoalsResponseComponent'; import IconKey from './model/IconKey'; +import InlineResponse400 from './model/InlineResponse400'; +import InlineResponse4001 from './model/InlineResponse4001'; +import InlineResponse4001AdditionalData from './model/InlineResponse4001AdditionalData'; +import InlineResponse400AdditionalData from './model/InlineResponse400AdditionalData'; +import InlineResponse403 from './model/InlineResponse403'; +import InlineResponse4031 from './model/InlineResponse4031'; +import InlineResponse4031AdditionalData from './model/InlineResponse4031AdditionalData'; +import InlineResponse403AdditionalData from './model/InlineResponse403AdditionalData'; +import InlineResponse404 from './model/InlineResponse404'; +import InlineResponse404AdditionalData from './model/InlineResponse404AdditionalData'; import ItemSearchAdditionalData from './model/ItemSearchAdditionalData'; import ItemSearchAdditionalDataPagination from './model/ItemSearchAdditionalDataPagination'; import ItemSearchFieldResponse from './model/ItemSearchFieldResponse'; @@ -446,6 +461,8 @@ import MergePersonItem from './model/MergePersonItem'; import MergePersonsRequest from './model/MergePersonsRequest'; import MergePersonsResponse from './model/MergePersonsResponse'; import MergePersonsResponseAllOf from './model/MergePersonsResponseAllOf'; +import MessageObject from './model/MessageObject'; +import MessageObjectAttachments from './model/MessageObjectAttachments'; import NewDeal from './model/NewDeal'; import NewDealAllOf from './model/NewDealAllOf'; import NewDealProduct from './model/NewDealProduct'; @@ -710,6 +727,7 @@ import ActivityFieldsApi from './api/ActivityFieldsApi'; import ActivityTypesApi from './api/ActivityTypesApi'; import BillingApi from './api/BillingApi'; import CallLogsApi from './api/CallLogsApi'; +import ChannelsApi from './api/ChannelsApi'; import CurrenciesApi from './api/CurrenciesApi'; import DealFieldsApi from './api/DealFieldsApi'; import DealsApi from './api/DealsApi'; @@ -721,6 +739,7 @@ import ItemSearchApi from './api/ItemSearchApi'; import LeadLabelsApi from './api/LeadLabelsApi'; import LeadSourcesApi from './api/LeadSourcesApi'; import LeadsApi from './api/LeadsApi'; +import LegacyTeamsApi from './api/LegacyTeamsApi'; import MailboxApi from './api/MailboxApi'; import NoteFieldsApi from './api/NoteFieldsApi'; import NotesApi from './api/NotesApi'; @@ -737,7 +756,6 @@ import RecentsApi from './api/RecentsApi'; import RolesApi from './api/RolesApi'; import StagesApi from './api/StagesApi'; import SubscriptionsApi from './api/SubscriptionsApi'; -import TeamsApi from './api/TeamsApi'; import UserConnectionsApi from './api/UserConnectionsApi'; import UserSettingsApi from './api/UserSettingsApi'; import UsersApi from './api/UsersApi'; @@ -1514,6 +1532,24 @@ export { */ CallLogResponse500, + /** + * The ChannelObject model constructor. + * @property {module:model/ChannelObject} + */ + ChannelObject, + + /** + * The ChannelObjectResponse model constructor. + * @property {module:model/ChannelObjectResponse} + */ + ChannelObjectResponse, + + /** + * The ChannelObjectResponseData model constructor. + * @property {module:model/ChannelObjectResponseData} + */ + ChannelObjectResponseData, + /** * The CommentPostPutObject model constructor. * @property {module:model/CommentPostPutObject} @@ -1898,12 +1934,24 @@ export { */ DeleteActivityResponse200Data, + /** + * The DeleteChannelSuccess model constructor. + * @property {module:model/DeleteChannelSuccess} + */ + DeleteChannelSuccess, + /** * The DeleteComment model constructor. * @property {module:model/DeleteComment} */ DeleteComment, + /** + * The DeleteConversationSuccess model constructor. + * @property {module:model/DeleteConversationSuccess} + */ + DeleteConversationSuccess, + /** * The DeleteDeal model constructor. * @property {module:model/DeleteDeal} @@ -2870,6 +2918,66 @@ export { */ IconKey, + /** + * The InlineResponse400 model constructor. + * @property {module:model/InlineResponse400} + */ + InlineResponse400, + + /** + * The InlineResponse4001 model constructor. + * @property {module:model/InlineResponse4001} + */ + InlineResponse4001, + + /** + * The InlineResponse4001AdditionalData model constructor. + * @property {module:model/InlineResponse4001AdditionalData} + */ + InlineResponse4001AdditionalData, + + /** + * The InlineResponse400AdditionalData model constructor. + * @property {module:model/InlineResponse400AdditionalData} + */ + InlineResponse400AdditionalData, + + /** + * The InlineResponse403 model constructor. + * @property {module:model/InlineResponse403} + */ + InlineResponse403, + + /** + * The InlineResponse4031 model constructor. + * @property {module:model/InlineResponse4031} + */ + InlineResponse4031, + + /** + * The InlineResponse4031AdditionalData model constructor. + * @property {module:model/InlineResponse4031AdditionalData} + */ + InlineResponse4031AdditionalData, + + /** + * The InlineResponse403AdditionalData model constructor. + * @property {module:model/InlineResponse403AdditionalData} + */ + InlineResponse403AdditionalData, + + /** + * The InlineResponse404 model constructor. + * @property {module:model/InlineResponse404} + */ + InlineResponse404, + + /** + * The InlineResponse404AdditionalData model constructor. + * @property {module:model/InlineResponse404AdditionalData} + */ + InlineResponse404AdditionalData, + /** * The ItemSearchAdditionalData model constructor. * @property {module:model/ItemSearchAdditionalData} @@ -3380,6 +3488,18 @@ export { */ MergePersonsResponseAllOf, + /** + * The MessageObject model constructor. + * @property {module:model/MessageObject} + */ + MessageObject, + + /** + * The MessageObjectAttachments model constructor. + * @property {module:model/MessageObjectAttachments} + */ + MessageObjectAttachments, + /** * The NewDeal model constructor. * @property {module:model/NewDeal} @@ -4964,6 +5084,12 @@ export { */ CallLogsApi, + /** + * The ChannelsApi service constructor. + * @property {module:api/ChannelsApi} + */ + ChannelsApi, + /** * The CurrenciesApi service constructor. * @property {module:api/CurrenciesApi} @@ -5030,6 +5156,12 @@ export { */ LeadsApi, + /** + * The LegacyTeamsApi service constructor. + * @property {module:api/LegacyTeamsApi} + */ + LegacyTeamsApi, + /** * The MailboxApi service constructor. * @property {module:api/MailboxApi} @@ -5126,12 +5258,6 @@ export { */ SubscriptionsApi, - /** - * The TeamsApi service constructor. - * @property {module:api/TeamsApi} - */ - TeamsApi, - /** * The UserConnectionsApi service constructor. * @property {module:api/UserConnectionsApi} diff --git a/src/model/ChannelObject.js b/src/model/ChannelObject.js new file mode 100644 index 00000000..1eabcb89 --- /dev/null +++ b/src/model/ChannelObject.js @@ -0,0 +1,156 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The ChannelObject model module. + * @module model/ChannelObject + * @version 1.0.0 + */ +class ChannelObject { + /** + * Constructs a new ChannelObject. + * @alias module:model/ChannelObject + * @param name {String} The name of the channel + * @param providerChannelId {String} The channel ID + */ + constructor(name, providerChannelId) { + + ChannelObject.initialize(this, name, providerChannelId); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, providerChannelId) { + obj['name'] = name; + obj['provider_channel_id'] = providerChannelId; + } + + /** + * Constructs a ChannelObject from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ChannelObject} obj Optional instance to populate. + * @return {module:model/ChannelObject} The populated ChannelObject instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ChannelObject(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + + delete data['name']; + } + if (data.hasOwnProperty('provider_channel_id')) { + obj['provider_channel_id'] = ApiClient.convertToType(data['provider_channel_id'], 'String'); + + delete data['provider_channel_id']; + } + if (data.hasOwnProperty('avatar_url')) { + obj['avatar_url'] = ApiClient.convertToType(data['avatar_url'], 'String'); + + delete data['avatar_url']; + } + if (data.hasOwnProperty('template_support')) { + obj['template_support'] = ApiClient.convertToType(data['template_support'], 'Boolean'); + + delete data['template_support']; + } + if (data.hasOwnProperty('provider_type')) { + obj['provider_type'] = ApiClient.convertToType(data['provider_type'], 'String'); + + delete data['provider_type']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * The name of the channel + * @member {String} name + */ +ChannelObject.prototype['name'] = undefined; + +/** + * The channel ID + * @member {String} provider_channel_id + */ +ChannelObject.prototype['provider_channel_id'] = undefined; + +/** + * The URL for an icon that represents your channel + * @member {String} avatar_url + */ +ChannelObject.prototype['avatar_url'] = undefined; + +/** + * If true, enables templates logic on UI. Requires getTemplates endpoint implemented. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension). + * @member {Boolean} template_support + * @default false + */ +ChannelObject.prototype['template_support'] = false; + +/** + * It controls the icons (like the icon next to the conversation) + * @member {module:model/ChannelObject.ProviderTypeEnum} provider_type + * @default 'other' + */ +ChannelObject.prototype['provider_type'] = 'other'; + + + + + +/** + * Allowed values for the provider_type property. + * @enum {String} + * @readonly + */ +ChannelObject['ProviderTypeEnum'] = { + + /** + * value: "facebook" + * @const + */ + "facebook": "facebook", + + /** + * value: "whatsapp" + * @const + */ + "whatsapp": "whatsapp", + + /** + * value: "other" + * @const + */ + "other": "other" +}; + + + +export default ChannelObject; + diff --git a/src/model/ChannelObjectResponse.js b/src/model/ChannelObjectResponse.js new file mode 100644 index 00000000..a7cc62d9 --- /dev/null +++ b/src/model/ChannelObjectResponse.js @@ -0,0 +1,89 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import ChannelObjectResponseData from './ChannelObjectResponseData'; + +/** + * The ChannelObjectResponse model module. + * @module model/ChannelObjectResponse + * @version 1.0.0 + */ +class ChannelObjectResponse { + /** + * Constructs a new ChannelObjectResponse. + * @alias module:model/ChannelObjectResponse + */ + constructor() { + + ChannelObjectResponse.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ChannelObjectResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ChannelObjectResponse} obj Optional instance to populate. + * @return {module:model/ChannelObjectResponse} The populated ChannelObjectResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ChannelObjectResponse(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + if (data.hasOwnProperty('data')) { + obj['data'] = ApiClient.convertToType(data['data'], [ChannelObjectResponseData]); + + delete data['data']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +ChannelObjectResponse.prototype['success'] = undefined; + +/** + * @member {Array.} data + */ +ChannelObjectResponse.prototype['data'] = undefined; + + + + + + +export default ChannelObjectResponse; + diff --git a/src/model/ChannelObjectResponseData.js b/src/model/ChannelObjectResponseData.js new file mode 100644 index 00000000..cca22633 --- /dev/null +++ b/src/model/ChannelObjectResponseData.js @@ -0,0 +1,205 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The ChannelObjectResponseData model module. + * @module model/ChannelObjectResponseData + * @version 1.0.0 + */ +class ChannelObjectResponseData { + /** + * Constructs a new ChannelObjectResponseData. + * @alias module:model/ChannelObjectResponseData + */ + constructor() { + + ChannelObjectResponseData.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a ChannelObjectResponseData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/ChannelObjectResponseData} obj Optional instance to populate. + * @return {module:model/ChannelObjectResponseData} The populated ChannelObjectResponseData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new ChannelObjectResponseData(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + + delete data['id']; + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + + delete data['name']; + } + if (data.hasOwnProperty('avatar_url')) { + obj['avatar_url'] = ApiClient.convertToType(data['avatar_url'], 'String'); + + delete data['avatar_url']; + } + if (data.hasOwnProperty('provider_channel_id')) { + obj['provider_channel_id'] = ApiClient.convertToType(data['provider_channel_id'], 'String'); + + delete data['provider_channel_id']; + } + if (data.hasOwnProperty('marketplace_client_id')) { + obj['marketplace_client_id'] = ApiClient.convertToType(data['marketplace_client_id'], 'String'); + + delete data['marketplace_client_id']; + } + if (data.hasOwnProperty('pd_company_id')) { + obj['pd_company_id'] = ApiClient.convertToType(data['pd_company_id'], 'Number'); + + delete data['pd_company_id']; + } + if (data.hasOwnProperty('pd_user_id')) { + obj['pd_user_id'] = ApiClient.convertToType(data['pd_user_id'], 'Number'); + + delete data['pd_user_id']; + } + if (data.hasOwnProperty('created_at')) { + obj['created_at'] = ApiClient.convertToType(data['created_at'], 'Date'); + + delete data['created_at']; + } + if (data.hasOwnProperty('provider_type')) { + obj['provider_type'] = ApiClient.convertToType(data['provider_type'], 'String'); + + delete data['provider_type']; + } + if (data.hasOwnProperty('template_support')) { + obj['template_support'] = ApiClient.convertToType(data['template_support'], 'Boolean'); + + delete data['template_support']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * The unique channel ID used internally in omnichannel-api and the frontend of the extension + * @member {String} id + */ +ChannelObjectResponseData.prototype['id'] = undefined; + +/** + * The name of the channel + * @member {String} name + */ +ChannelObjectResponseData.prototype['name'] = undefined; + +/** + * The URL for an icon that represents your channel + * @member {String} avatar_url + */ +ChannelObjectResponseData.prototype['avatar_url'] = undefined; + +/** + * The channel ID you specified while creating the channel + * @member {String} provider_channel_id + */ +ChannelObjectResponseData.prototype['provider_channel_id'] = undefined; + +/** + * The client_id of your app in Pipedrive marketplace + * @member {String} marketplace_client_id + */ +ChannelObjectResponseData.prototype['marketplace_client_id'] = undefined; + +/** + * The ID of the user's company in Pipedrive + * @member {Number} pd_company_id + */ +ChannelObjectResponseData.prototype['pd_company_id'] = undefined; + +/** + * The ID of the user in Pipedrive + * @member {Number} pd_user_id + */ +ChannelObjectResponseData.prototype['pd_user_id'] = undefined; + +/** + * The date and time when your channel was created in the API + * @member {Date} created_at + */ +ChannelObjectResponseData.prototype['created_at'] = undefined; + +/** + * Value of the provider_type sent to this endpoint + * @member {module:model/ChannelObjectResponseData.ProviderTypeEnum} provider_type + */ +ChannelObjectResponseData.prototype['provider_type'] = undefined; + +/** + * Value of the template_support sent to this endpoint + * @member {Boolean} template_support + */ +ChannelObjectResponseData.prototype['template_support'] = undefined; + + + + + +/** + * Allowed values for the provider_type property. + * @enum {String} + * @readonly + */ +ChannelObjectResponseData['ProviderTypeEnum'] = { + + /** + * value: "facebook" + * @const + */ + "facebook": "facebook", + + /** + * value: "whatsapp" + * @const + */ + "whatsapp": "whatsapp", + + /** + * value: "other" + * @const + */ + "other": "other" +}; + + + +export default ChannelObjectResponseData; + diff --git a/src/model/DeleteChannelSuccess.js b/src/model/DeleteChannelSuccess.js new file mode 100644 index 00000000..553551ee --- /dev/null +++ b/src/model/DeleteChannelSuccess.js @@ -0,0 +1,78 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The DeleteChannelSuccess model module. + * @module model/DeleteChannelSuccess + * @version 1.0.0 + */ +class DeleteChannelSuccess { + /** + * Constructs a new DeleteChannelSuccess. + * @alias module:model/DeleteChannelSuccess + */ + constructor() { + + DeleteChannelSuccess.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a DeleteChannelSuccess from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/DeleteChannelSuccess} obj Optional instance to populate. + * @return {module:model/DeleteChannelSuccess} The populated DeleteChannelSuccess instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new DeleteChannelSuccess(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +DeleteChannelSuccess.prototype['success'] = undefined; + + + + + + +export default DeleteChannelSuccess; + diff --git a/src/model/DeleteConversationSuccess.js b/src/model/DeleteConversationSuccess.js new file mode 100644 index 00000000..f117391c --- /dev/null +++ b/src/model/DeleteConversationSuccess.js @@ -0,0 +1,78 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The DeleteConversationSuccess model module. + * @module model/DeleteConversationSuccess + * @version 1.0.0 + */ +class DeleteConversationSuccess { + /** + * Constructs a new DeleteConversationSuccess. + * @alias module:model/DeleteConversationSuccess + */ + constructor() { + + DeleteConversationSuccess.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a DeleteConversationSuccess from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/DeleteConversationSuccess} obj Optional instance to populate. + * @return {module:model/DeleteConversationSuccess} The populated DeleteConversationSuccess instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new DeleteConversationSuccess(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +DeleteConversationSuccess.prototype['success'] = undefined; + + + + + + +export default DeleteConversationSuccess; + diff --git a/src/model/InlineResponse400.js b/src/model/InlineResponse400.js new file mode 100644 index 00000000..f1149cf5 --- /dev/null +++ b/src/model/InlineResponse400.js @@ -0,0 +1,110 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import InlineResponse400AdditionalData from './InlineResponse400AdditionalData'; + +/** + * The InlineResponse400 model module. + * @module model/InlineResponse400 + * @version 1.0.0 + */ +class InlineResponse400 { + /** + * Constructs a new InlineResponse400. + * @alias module:model/InlineResponse400 + */ + constructor() { + + InlineResponse400.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse400 from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse400} obj Optional instance to populate. + * @return {module:model/InlineResponse400} The populated InlineResponse400 instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse400(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + if (data.hasOwnProperty('error')) { + obj['error'] = ApiClient.convertToType(data['error'], 'String'); + + delete data['error']; + } + if (data.hasOwnProperty('error_info')) { + obj['error_info'] = ApiClient.convertToType(data['error_info'], 'String'); + + delete data['error_info']; + } + if (data.hasOwnProperty('additional_data')) { + obj['additional_data'] = InlineResponse400AdditionalData.constructFromObject(data['additional_data']); + + delete data['additional_data']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +InlineResponse400.prototype['success'] = undefined; + +/** + * The error description + * @member {String} error + */ +InlineResponse400.prototype['error'] = undefined; + +/** + * @member {String} error_info + */ +InlineResponse400.prototype['error_info'] = undefined; + +/** + * @member {module:model/InlineResponse400AdditionalData} additional_data + */ +InlineResponse400.prototype['additional_data'] = undefined; + + + + + + +export default InlineResponse400; + diff --git a/src/model/InlineResponse4001.js b/src/model/InlineResponse4001.js new file mode 100644 index 00000000..dd09ed27 --- /dev/null +++ b/src/model/InlineResponse4001.js @@ -0,0 +1,110 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import InlineResponse4001AdditionalData from './InlineResponse4001AdditionalData'; + +/** + * The InlineResponse4001 model module. + * @module model/InlineResponse4001 + * @version 1.0.0 + */ +class InlineResponse4001 { + /** + * Constructs a new InlineResponse4001. + * @alias module:model/InlineResponse4001 + */ + constructor() { + + InlineResponse4001.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse4001 from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse4001} obj Optional instance to populate. + * @return {module:model/InlineResponse4001} The populated InlineResponse4001 instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse4001(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + if (data.hasOwnProperty('error')) { + obj['error'] = ApiClient.convertToType(data['error'], 'String'); + + delete data['error']; + } + if (data.hasOwnProperty('error_info')) { + obj['error_info'] = ApiClient.convertToType(data['error_info'], 'String'); + + delete data['error_info']; + } + if (data.hasOwnProperty('additional_data')) { + obj['additional_data'] = InlineResponse4001AdditionalData.constructFromObject(data['additional_data']); + + delete data['additional_data']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +InlineResponse4001.prototype['success'] = undefined; + +/** + * The error description + * @member {String} error + */ +InlineResponse4001.prototype['error'] = undefined; + +/** + * @member {String} error_info + */ +InlineResponse4001.prototype['error_info'] = undefined; + +/** + * @member {module:model/InlineResponse4001AdditionalData} additional_data + */ +InlineResponse4001.prototype['additional_data'] = undefined; + + + + + + +export default InlineResponse4001; + diff --git a/src/model/InlineResponse4001AdditionalData.js b/src/model/InlineResponse4001AdditionalData.js new file mode 100644 index 00000000..4bf79c67 --- /dev/null +++ b/src/model/InlineResponse4001AdditionalData.js @@ -0,0 +1,79 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The InlineResponse4001AdditionalData model module. + * @module model/InlineResponse4001AdditionalData + * @version 1.0.0 + */ +class InlineResponse4001AdditionalData { + /** + * Constructs a new InlineResponse4001AdditionalData. + * @alias module:model/InlineResponse4001AdditionalData + */ + constructor() { + + InlineResponse4001AdditionalData.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse4001AdditionalData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse4001AdditionalData} obj Optional instance to populate. + * @return {module:model/InlineResponse4001AdditionalData} The populated InlineResponse4001AdditionalData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse4001AdditionalData(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'String'); + + delete data['code']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * An error code sent by the API + * @member {String} code + */ +InlineResponse4001AdditionalData.prototype['code'] = undefined; + + + + + + +export default InlineResponse4001AdditionalData; + diff --git a/src/model/InlineResponse400AdditionalData.js b/src/model/InlineResponse400AdditionalData.js new file mode 100644 index 00000000..0feab592 --- /dev/null +++ b/src/model/InlineResponse400AdditionalData.js @@ -0,0 +1,79 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The InlineResponse400AdditionalData model module. + * @module model/InlineResponse400AdditionalData + * @version 1.0.0 + */ +class InlineResponse400AdditionalData { + /** + * Constructs a new InlineResponse400AdditionalData. + * @alias module:model/InlineResponse400AdditionalData + */ + constructor() { + + InlineResponse400AdditionalData.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse400AdditionalData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse400AdditionalData} obj Optional instance to populate. + * @return {module:model/InlineResponse400AdditionalData} The populated InlineResponse400AdditionalData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse400AdditionalData(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'String'); + + delete data['code']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * An error code sent by the API + * @member {String} code + */ +InlineResponse400AdditionalData.prototype['code'] = undefined; + + + + + + +export default InlineResponse400AdditionalData; + diff --git a/src/model/InlineResponse403.js b/src/model/InlineResponse403.js new file mode 100644 index 00000000..559ab2c6 --- /dev/null +++ b/src/model/InlineResponse403.js @@ -0,0 +1,110 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import InlineResponse403AdditionalData from './InlineResponse403AdditionalData'; + +/** + * The InlineResponse403 model module. + * @module model/InlineResponse403 + * @version 1.0.0 + */ +class InlineResponse403 { + /** + * Constructs a new InlineResponse403. + * @alias module:model/InlineResponse403 + */ + constructor() { + + InlineResponse403.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse403 from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse403} obj Optional instance to populate. + * @return {module:model/InlineResponse403} The populated InlineResponse403 instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse403(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + if (data.hasOwnProperty('error')) { + obj['error'] = ApiClient.convertToType(data['error'], 'String'); + + delete data['error']; + } + if (data.hasOwnProperty('error_info')) { + obj['error_info'] = ApiClient.convertToType(data['error_info'], 'String'); + + delete data['error_info']; + } + if (data.hasOwnProperty('additional_data')) { + obj['additional_data'] = InlineResponse403AdditionalData.constructFromObject(data['additional_data']); + + delete data['additional_data']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +InlineResponse403.prototype['success'] = undefined; + +/** + * The error description + * @member {String} error + */ +InlineResponse403.prototype['error'] = undefined; + +/** + * @member {String} error_info + */ +InlineResponse403.prototype['error_info'] = undefined; + +/** + * @member {module:model/InlineResponse403AdditionalData} additional_data + */ +InlineResponse403.prototype['additional_data'] = undefined; + + + + + + +export default InlineResponse403; + diff --git a/src/model/InlineResponse4031.js b/src/model/InlineResponse4031.js new file mode 100644 index 00000000..7c825aa0 --- /dev/null +++ b/src/model/InlineResponse4031.js @@ -0,0 +1,110 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import InlineResponse4031AdditionalData from './InlineResponse4031AdditionalData'; + +/** + * The InlineResponse4031 model module. + * @module model/InlineResponse4031 + * @version 1.0.0 + */ +class InlineResponse4031 { + /** + * Constructs a new InlineResponse4031. + * @alias module:model/InlineResponse4031 + */ + constructor() { + + InlineResponse4031.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse4031 from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse4031} obj Optional instance to populate. + * @return {module:model/InlineResponse4031} The populated InlineResponse4031 instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse4031(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + if (data.hasOwnProperty('error')) { + obj['error'] = ApiClient.convertToType(data['error'], 'String'); + + delete data['error']; + } + if (data.hasOwnProperty('error_info')) { + obj['error_info'] = ApiClient.convertToType(data['error_info'], 'String'); + + delete data['error_info']; + } + if (data.hasOwnProperty('additional_data')) { + obj['additional_data'] = InlineResponse4031AdditionalData.constructFromObject(data['additional_data']); + + delete data['additional_data']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +InlineResponse4031.prototype['success'] = undefined; + +/** + * The error description + * @member {String} error + */ +InlineResponse4031.prototype['error'] = undefined; + +/** + * @member {String} error_info + */ +InlineResponse4031.prototype['error_info'] = undefined; + +/** + * @member {module:model/InlineResponse4031AdditionalData} additional_data + */ +InlineResponse4031.prototype['additional_data'] = undefined; + + + + + + +export default InlineResponse4031; + diff --git a/src/model/InlineResponse4031AdditionalData.js b/src/model/InlineResponse4031AdditionalData.js new file mode 100644 index 00000000..04b996ab --- /dev/null +++ b/src/model/InlineResponse4031AdditionalData.js @@ -0,0 +1,79 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The InlineResponse4031AdditionalData model module. + * @module model/InlineResponse4031AdditionalData + * @version 1.0.0 + */ +class InlineResponse4031AdditionalData { + /** + * Constructs a new InlineResponse4031AdditionalData. + * @alias module:model/InlineResponse4031AdditionalData + */ + constructor() { + + InlineResponse4031AdditionalData.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse4031AdditionalData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse4031AdditionalData} obj Optional instance to populate. + * @return {module:model/InlineResponse4031AdditionalData} The populated InlineResponse4031AdditionalData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse4031AdditionalData(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'String'); + + delete data['code']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * An error code sent by the API + * @member {String} code + */ +InlineResponse4031AdditionalData.prototype['code'] = undefined; + + + + + + +export default InlineResponse4031AdditionalData; + diff --git a/src/model/InlineResponse403AdditionalData.js b/src/model/InlineResponse403AdditionalData.js new file mode 100644 index 00000000..726c8507 --- /dev/null +++ b/src/model/InlineResponse403AdditionalData.js @@ -0,0 +1,79 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The InlineResponse403AdditionalData model module. + * @module model/InlineResponse403AdditionalData + * @version 1.0.0 + */ +class InlineResponse403AdditionalData { + /** + * Constructs a new InlineResponse403AdditionalData. + * @alias module:model/InlineResponse403AdditionalData + */ + constructor() { + + InlineResponse403AdditionalData.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse403AdditionalData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse403AdditionalData} obj Optional instance to populate. + * @return {module:model/InlineResponse403AdditionalData} The populated InlineResponse403AdditionalData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse403AdditionalData(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'String'); + + delete data['code']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * An error code sent by the API + * @member {String} code + */ +InlineResponse403AdditionalData.prototype['code'] = undefined; + + + + + + +export default InlineResponse403AdditionalData; + diff --git a/src/model/InlineResponse404.js b/src/model/InlineResponse404.js new file mode 100644 index 00000000..fa4d657d --- /dev/null +++ b/src/model/InlineResponse404.js @@ -0,0 +1,110 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import InlineResponse404AdditionalData from './InlineResponse404AdditionalData'; + +/** + * The InlineResponse404 model module. + * @module model/InlineResponse404 + * @version 1.0.0 + */ +class InlineResponse404 { + /** + * Constructs a new InlineResponse404. + * @alias module:model/InlineResponse404 + */ + constructor() { + + InlineResponse404.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse404 from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse404} obj Optional instance to populate. + * @return {module:model/InlineResponse404} The populated InlineResponse404 instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse404(); + + if (data.hasOwnProperty('success')) { + obj['success'] = ApiClient.convertToType(data['success'], 'Boolean'); + + delete data['success']; + } + if (data.hasOwnProperty('error')) { + obj['error'] = ApiClient.convertToType(data['error'], 'String'); + + delete data['error']; + } + if (data.hasOwnProperty('error_info')) { + obj['error_info'] = ApiClient.convertToType(data['error_info'], 'String'); + + delete data['error_info']; + } + if (data.hasOwnProperty('additional_data')) { + obj['additional_data'] = InlineResponse404AdditionalData.constructFromObject(data['additional_data']); + + delete data['additional_data']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * @member {Boolean} success + */ +InlineResponse404.prototype['success'] = undefined; + +/** + * The error description + * @member {String} error + */ +InlineResponse404.prototype['error'] = undefined; + +/** + * @member {String} error_info + */ +InlineResponse404.prototype['error_info'] = undefined; + +/** + * @member {module:model/InlineResponse404AdditionalData} additional_data + */ +InlineResponse404.prototype['additional_data'] = undefined; + + + + + + +export default InlineResponse404; + diff --git a/src/model/InlineResponse404AdditionalData.js b/src/model/InlineResponse404AdditionalData.js new file mode 100644 index 00000000..d93926d2 --- /dev/null +++ b/src/model/InlineResponse404AdditionalData.js @@ -0,0 +1,79 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The InlineResponse404AdditionalData model module. + * @module model/InlineResponse404AdditionalData + * @version 1.0.0 + */ +class InlineResponse404AdditionalData { + /** + * Constructs a new InlineResponse404AdditionalData. + * @alias module:model/InlineResponse404AdditionalData + */ + constructor() { + + InlineResponse404AdditionalData.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a InlineResponse404AdditionalData from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/InlineResponse404AdditionalData} obj Optional instance to populate. + * @return {module:model/InlineResponse404AdditionalData} The populated InlineResponse404AdditionalData instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new InlineResponse404AdditionalData(); + + if (data.hasOwnProperty('code')) { + obj['code'] = ApiClient.convertToType(data['code'], 'String'); + + delete data['code']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * An error code sent by the API + * @member {String} code + */ +InlineResponse404AdditionalData.prototype['code'] = undefined; + + + + + + +export default InlineResponse404AdditionalData; + diff --git a/src/model/MessageObject.js b/src/model/MessageObject.js new file mode 100644 index 00000000..f34d3f3e --- /dev/null +++ b/src/model/MessageObject.js @@ -0,0 +1,226 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import MessageObjectAttachments from './MessageObjectAttachments'; + +/** + * The MessageObject model module. + * @module model/MessageObject + * @version 1.0.0 + */ +class MessageObject { + /** + * Constructs a new MessageObject. + * @alias module:model/MessageObject + * @param id {String} The ID of the message + * @param channelId {String} The channel ID as in the provider + * @param senderId {String} The ID of the provider's user that sent the message + * @param conversationId {String} The ID of the conversation + * @param message {String} The body of the message + * @param status {module:model/MessageObject.StatusEnum} The status of the message + * @param createdAt {Date} The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM + */ + constructor(id, channelId, senderId, conversationId, message, status, createdAt) { + + MessageObject.initialize(this, id, channelId, senderId, conversationId, message, status, createdAt); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, id, channelId, senderId, conversationId, message, status, createdAt) { + obj['id'] = id; + obj['channel_id'] = channelId; + obj['sender_id'] = senderId; + obj['conversation_id'] = conversationId; + obj['message'] = message; + obj['status'] = status; + obj['created_at'] = createdAt; + } + + /** + * Constructs a MessageObject from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MessageObject} obj Optional instance to populate. + * @return {module:model/MessageObject} The populated MessageObject instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new MessageObject(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + + delete data['id']; + } + if (data.hasOwnProperty('channel_id')) { + obj['channel_id'] = ApiClient.convertToType(data['channel_id'], 'String'); + + delete data['channel_id']; + } + if (data.hasOwnProperty('sender_id')) { + obj['sender_id'] = ApiClient.convertToType(data['sender_id'], 'String'); + + delete data['sender_id']; + } + if (data.hasOwnProperty('conversation_id')) { + obj['conversation_id'] = ApiClient.convertToType(data['conversation_id'], 'String'); + + delete data['conversation_id']; + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + + delete data['message']; + } + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + + delete data['status']; + } + if (data.hasOwnProperty('created_at')) { + obj['created_at'] = ApiClient.convertToType(data['created_at'], 'Date'); + + delete data['created_at']; + } + if (data.hasOwnProperty('reply_by')) { + obj['reply_by'] = ApiClient.convertToType(data['reply_by'], 'Date'); + + delete data['reply_by']; + } + if (data.hasOwnProperty('conversation_link')) { + obj['conversation_link'] = ApiClient.convertToType(data['conversation_link'], 'String'); + + delete data['conversation_link']; + } + if (data.hasOwnProperty('attachments')) { + obj['attachments'] = ApiClient.convertToType(data['attachments'], [MessageObjectAttachments]); + + delete data['attachments']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * The ID of the message + * @member {String} id + */ +MessageObject.prototype['id'] = undefined; + +/** + * The channel ID as in the provider + * @member {String} channel_id + */ +MessageObject.prototype['channel_id'] = undefined; + +/** + * The ID of the provider's user that sent the message + * @member {String} sender_id + */ +MessageObject.prototype['sender_id'] = undefined; + +/** + * The ID of the conversation + * @member {String} conversation_id + */ +MessageObject.prototype['conversation_id'] = undefined; + +/** + * The body of the message + * @member {String} message + */ +MessageObject.prototype['message'] = undefined; + +/** + * The status of the message + * @member {module:model/MessageObject.StatusEnum} status + */ +MessageObject.prototype['status'] = undefined; + +/** + * The date and time when the message was created in the provider, in UTC. Format: YYYY-MM-DD HH:MM + * @member {Date} created_at + */ +MessageObject.prototype['created_at'] = undefined; + +/** + * The date and time when the message can no longer receive a reply, in UTC. Format: YYYY-MM-DD HH:MM + * @member {Date} reply_by + */ +MessageObject.prototype['reply_by'] = undefined; + +/** + * A URL that can open the conversation in the provider's side + * @member {String} conversation_link + */ +MessageObject.prototype['conversation_link'] = undefined; + +/** + * The list of attachments available in the message + * @member {Array.} attachments + */ +MessageObject.prototype['attachments'] = undefined; + + + + + +/** + * Allowed values for the status property. + * @enum {String} + * @readonly + */ +MessageObject['StatusEnum'] = { + + /** + * value: "sent" + * @const + */ + "sent": "sent", + + /** + * value: "delivered" + * @const + */ + "delivered": "delivered", + + /** + * value: "read" + * @const + */ + "read": "read", + + /** + * value: "failed" + * @const + */ + "failed": "failed" +}; + + + +export default MessageObject; + diff --git a/src/model/MessageObjectAttachments.js b/src/model/MessageObjectAttachments.js new file mode 100644 index 00000000..5bc4316a --- /dev/null +++ b/src/model/MessageObjectAttachments.js @@ -0,0 +1,152 @@ +/** + * Pipedrive API v1 + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The MessageObjectAttachments model module. + * @module model/MessageObjectAttachments + * @version 1.0.0 + */ +class MessageObjectAttachments { + /** + * Constructs a new MessageObjectAttachments. + * @alias module:model/MessageObjectAttachments + * @param id {String} The ID of the attachment + * @param type {String} The mime-type of the attachment + * @param url {String} A URL to the file + */ + constructor(id, type, url) { + + MessageObjectAttachments.initialize(this, id, type, url); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, id, type, url) { + obj['id'] = id; + obj['type'] = type; + obj['url'] = url; + } + + /** + * Constructs a MessageObjectAttachments from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:model/MessageObjectAttachments} obj Optional instance to populate. + * @return {module:model/MessageObjectAttachments} The populated MessageObjectAttachments instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new MessageObjectAttachments(); + + if (data.hasOwnProperty('id')) { + obj['id'] = ApiClient.convertToType(data['id'], 'String'); + + delete data['id']; + } + if (data.hasOwnProperty('type')) { + obj['type'] = ApiClient.convertToType(data['type'], 'String'); + + delete data['type']; + } + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + + delete data['name']; + } + if (data.hasOwnProperty('size')) { + obj['size'] = ApiClient.convertToType(data['size'], 'Number'); + + delete data['size']; + } + if (data.hasOwnProperty('url')) { + obj['url'] = ApiClient.convertToType(data['url'], 'String'); + + delete data['url']; + } + if (data.hasOwnProperty('preview_url')) { + obj['preview_url'] = ApiClient.convertToType(data['preview_url'], 'String'); + + delete data['preview_url']; + } + if (data.hasOwnProperty('link_expires')) { + obj['link_expires'] = ApiClient.convertToType(data['link_expires'], 'Boolean'); + + delete data['link_expires']; + } + + if (Object.keys(data).length > 0) { + Object.assign(obj, data); + } + + } + return obj; + } + + +} + +/** + * The ID of the attachment + * @member {String} id + */ +MessageObjectAttachments.prototype['id'] = undefined; + +/** + * The mime-type of the attachment + * @member {String} type + */ +MessageObjectAttachments.prototype['type'] = undefined; + +/** + * The name of the attachment + * @member {String} name + */ +MessageObjectAttachments.prototype['name'] = undefined; + +/** + * The size of the attachment + * @member {Number} size + */ +MessageObjectAttachments.prototype['size'] = undefined; + +/** + * A URL to the file + * @member {String} url + */ +MessageObjectAttachments.prototype['url'] = undefined; + +/** + * A URL to a preview picture of the file + * @member {String} preview_url + */ +MessageObjectAttachments.prototype['preview_url'] = undefined; + +/** + * If true, it will use the getMessageById endpoint for fetching updated attachment's urls. Find out more [here](https://pipedrive.readme.io/docs/implementing-messaging-app-extension) + * @member {Boolean} link_expires + * @default false + */ +MessageObjectAttachments.prototype['link_expires'] = false; + + + + + + +export default MessageObjectAttachments; +