|
2 | 2 | * Segment Public API
|
3 | 3 | * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API.
|
4 | 4 | *
|
5 |
| - * The version of the OpenAPI document: 60.0.0 |
| 5 | + * The version of the OpenAPI document: 60.1.0 |
6 | 6 |
|
7 | 7 | *
|
8 | 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
@@ -40,6 +40,7 @@ import { ListAudiencesPaginationInput } from '../model/listAudiencesPaginationIn
|
40 | 40 | import { PaginationInput } from '../model/paginationInput';
|
41 | 41 | import { RemoveAudienceFromSpace200Response } from '../model/removeAudienceFromSpace200Response';
|
42 | 42 | import { RemoveAudienceFromSpace200Response1 } from '../model/removeAudienceFromSpace200Response1';
|
| 43 | +import { RemoveAudienceScheduleFromAudience200Response } from '../model/removeAudienceScheduleFromAudience200Response'; |
43 | 44 | import { RequestErrorEnvelope } from '../model/requestErrorEnvelope';
|
44 | 45 | import { UpdateAudienceForSpace200Response } from '../model/updateAudienceForSpace200Response';
|
45 | 46 | import { UpdateAudienceForSpace200Response1 } from '../model/updateAudienceForSpace200Response1';
|
@@ -1644,6 +1645,147 @@ export class AudiencesApi {
|
1644 | 1645 | });
|
1645 | 1646 | });
|
1646 | 1647 | }
|
| 1648 | + /** |
| 1649 | + * Deletes an audience schedule for a Linked Audience (audienceType = LINKED). • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. |
| 1650 | + * @summary Remove Audience Schedule from Audience |
| 1651 | + * @param spaceId |
| 1652 | + * @param id |
| 1653 | + * @param scheduleId |
| 1654 | + */ |
| 1655 | + public async removeAudienceScheduleFromAudience( |
| 1656 | + spaceId: string, |
| 1657 | + id: string, |
| 1658 | + scheduleId: string, |
| 1659 | + options: { headers: { [name: string]: string } } = { headers: {} } |
| 1660 | + ): Promise<{ |
| 1661 | + response: http.IncomingMessage; |
| 1662 | + body: RemoveAudienceScheduleFromAudience200Response; |
| 1663 | + }> { |
| 1664 | + const localVarPath = |
| 1665 | + this.basePath + |
| 1666 | + '/spaces/{spaceId}/audiences/{id}/schedules/{scheduleId}' |
| 1667 | + .replace( |
| 1668 | + '{' + 'spaceId' + '}', |
| 1669 | + encodeURIComponent(String(spaceId)) |
| 1670 | + ) |
| 1671 | + .replace('{' + 'id' + '}', encodeURIComponent(String(id))) |
| 1672 | + .replace( |
| 1673 | + '{' + 'scheduleId' + '}', |
| 1674 | + encodeURIComponent(String(scheduleId)) |
| 1675 | + ); |
| 1676 | + let localVarQueryParameters: any = {}; |
| 1677 | + let localVarHeaderParams: any = (<any>Object).assign( |
| 1678 | + {}, |
| 1679 | + this._defaultHeaders |
| 1680 | + ); |
| 1681 | + const produces = [ |
| 1682 | + 'application/vnd.segment.v1alpha+json', |
| 1683 | + 'application/json', |
| 1684 | + ]; |
| 1685 | + // give precedence to 'application/json' |
| 1686 | + if (produces.indexOf('application/json') >= 0) { |
| 1687 | + localVarHeaderParams.Accept = 'application/json'; |
| 1688 | + } else { |
| 1689 | + localVarHeaderParams.Accept = produces.join(','); |
| 1690 | + } |
| 1691 | + let localVarFormParams: any = {}; |
| 1692 | + |
| 1693 | + // verify required parameter 'spaceId' is not null or undefined |
| 1694 | + if (spaceId === null || spaceId === undefined) { |
| 1695 | + throw new Error( |
| 1696 | + 'Required parameter spaceId was null or undefined when calling removeAudienceScheduleFromAudience.' |
| 1697 | + ); |
| 1698 | + } |
| 1699 | + |
| 1700 | + // verify required parameter 'id' is not null or undefined |
| 1701 | + if (id === null || id === undefined) { |
| 1702 | + throw new Error( |
| 1703 | + 'Required parameter id was null or undefined when calling removeAudienceScheduleFromAudience.' |
| 1704 | + ); |
| 1705 | + } |
| 1706 | + |
| 1707 | + // verify required parameter 'scheduleId' is not null or undefined |
| 1708 | + if (scheduleId === null || scheduleId === undefined) { |
| 1709 | + throw new Error( |
| 1710 | + 'Required parameter scheduleId was null or undefined when calling removeAudienceScheduleFromAudience.' |
| 1711 | + ); |
| 1712 | + } |
| 1713 | + |
| 1714 | + (<any>Object).assign(localVarHeaderParams, options.headers); |
| 1715 | + |
| 1716 | + let localVarUseFormData = false; |
| 1717 | + |
| 1718 | + let localVarRequestOptions: localVarRequest.Options = { |
| 1719 | + method: 'DELETE', |
| 1720 | + qs: localVarQueryParameters, |
| 1721 | + headers: localVarHeaderParams, |
| 1722 | + uri: localVarPath, |
| 1723 | + useQuerystring: this._useQuerystring, |
| 1724 | + json: true, |
| 1725 | + }; |
| 1726 | + |
| 1727 | + let authenticationPromise = Promise.resolve(); |
| 1728 | + if (this.authentications.token.accessToken) { |
| 1729 | + authenticationPromise = authenticationPromise.then(() => |
| 1730 | + this.authentications.token.applyToRequest( |
| 1731 | + localVarRequestOptions |
| 1732 | + ) |
| 1733 | + ); |
| 1734 | + } |
| 1735 | + authenticationPromise = authenticationPromise.then(() => |
| 1736 | + this.authentications.default.applyToRequest(localVarRequestOptions) |
| 1737 | + ); |
| 1738 | + |
| 1739 | + let interceptorPromise = authenticationPromise; |
| 1740 | + for (const interceptor of this.interceptors) { |
| 1741 | + interceptorPromise = interceptorPromise.then(() => |
| 1742 | + interceptor(localVarRequestOptions) |
| 1743 | + ); |
| 1744 | + } |
| 1745 | + |
| 1746 | + return interceptorPromise.then(() => { |
| 1747 | + if (Object.keys(localVarFormParams).length) { |
| 1748 | + if (localVarUseFormData) { |
| 1749 | + (<any>localVarRequestOptions).formData = localVarFormParams; |
| 1750 | + } else { |
| 1751 | + localVarRequestOptions.form = localVarFormParams; |
| 1752 | + } |
| 1753 | + } |
| 1754 | + return new Promise<{ |
| 1755 | + response: http.IncomingMessage; |
| 1756 | + body: RemoveAudienceScheduleFromAudience200Response; |
| 1757 | + }>((resolve, reject) => { |
| 1758 | + localVarRequest( |
| 1759 | + localVarRequestOptions, |
| 1760 | + (error, response, body) => { |
| 1761 | + if (error) { |
| 1762 | + reject(error); |
| 1763 | + } else { |
| 1764 | + if ( |
| 1765 | + response.statusCode && |
| 1766 | + response.statusCode >= 200 && |
| 1767 | + response.statusCode <= 299 |
| 1768 | + ) { |
| 1769 | + body = ObjectSerializer.deserialize( |
| 1770 | + body, |
| 1771 | + 'RemoveAudienceScheduleFromAudience200Response' |
| 1772 | + ); |
| 1773 | + resolve({ response: response, body: body }); |
| 1774 | + } else { |
| 1775 | + reject( |
| 1776 | + new HttpError( |
| 1777 | + response, |
| 1778 | + body, |
| 1779 | + response.statusCode |
| 1780 | + ) |
| 1781 | + ); |
| 1782 | + } |
| 1783 | + } |
| 1784 | + } |
| 1785 | + ); |
| 1786 | + }); |
| 1787 | + }); |
| 1788 | + } |
1647 | 1789 | /**
|
1648 | 1790 | * Updates the Audience. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Audience Modified` event in the [audit trail](/tag/Audit-Trail). • Note that when an Audience is updated, the Audience will be locked from future edits until the changes have been incorporated. You can find more information [in the Segment docs](https://segment-docs.netlify.app/docs/engage/audiences/#editing-realtime-audiences-and-traits). Note: The definition for an Audience updated using the API is not editable through the Segment App. The rate limit for this endpoint is 10 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
1649 | 1791 | * @summary Update Audience for Space
|
|
0 commit comments