UNPKG

wallee

Version:
159 lines (158 loc) 7.29 kB
import http = require("http"); import Promise = require("bluebird"); import { Authentication } from '../auth/Authentication'; import { EntityQuery } from '../models/EntityQuery'; import { EntityQueryFilter } from '../models/EntityQueryFilter'; import { Subscription } from '../models/Subscription'; import { SubscriptionChangeRequest } from '../models/SubscriptionChangeRequest'; import { SubscriptionCharge } from '../models/SubscriptionCharge'; import { SubscriptionCreateRequest } from '../models/SubscriptionCreateRequest'; import { SubscriptionUpdateRequest } from '../models/SubscriptionUpdateRequest'; import { SubscriptionVersion } from '../models/SubscriptionVersion'; import { TransactionInvoice } from '../models/TransactionInvoice'; declare class SubscriptionService { protected _basePath: string; protected _defaultHeaders: any; protected _useQuerystring: boolean; protected _timeout: number; protected _defaultAuthentication: Authentication; constructor(configuration: any); /** * Set timeout in seconds. Default timeout: 25 seconds * @param {number} timeout */ set timeout(timeout: number); private setTimeout; set basePath(basePath: string); get basePath(): string; protected setDefaultAuthentication(auth: Authentication): void; private getVersion; /** * This operation allows to apply changes on a subscription. * @summary apply changes * @param spaceId * @param request * @param {*} [options] Override http request options. */ applyChanges(spaceId: number, request: SubscriptionChangeRequest, options?: any): Promise<{ response: http.IncomingMessage; body: SubscriptionVersion; }>; /** * Counts the number of items in the database as restricted by the given filter. * @summary Count * @param spaceId * @param filter The filter which restricts the entities which are used to calculate the count. * @param {*} [options] Override http request options. */ count(spaceId: number, filter?: EntityQueryFilter, options?: any): Promise<{ response: http.IncomingMessage; body: number; }>; /** * The create operation creates a new subscription and a corresponding subscription version. * @summary Create * @param spaceId * @param createRequest * @param {*} [options] Override http request options. */ create(spaceId: number, createRequest: SubscriptionCreateRequest, options?: any): Promise<{ response: http.IncomingMessage; body: SubscriptionVersion; }>; /** * The initialize operation initializes a subscription. This method uses charge flows to carry out the transaction. * @summary initialize * @param spaceId * @param subscriptionId The provided subscription id will be used to lookup the subscription which should be initialized. * @param {*} [options] Override http request options. */ initialize(spaceId: number, subscriptionId: number, options?: any): Promise<{ response: http.IncomingMessage; body: SubscriptionCharge; }>; /** * The initialize operation initializes a subscription when the subscriber is present. The method will initialize a transaction which has to be completed by using the transaction service. * @summary initializeSubscriberPresent * @param spaceId * @param subscriptionId * @param successUrl The subscriber will be redirected to the success URL when the transaction is successful. * @param failedUrl The subscriber will be redirected to the fail URL when the transaction fails. * @param {*} [options] Override http request options. */ initializeSubscriberPresent(spaceId: number, subscriptionId: number, successUrl?: string, failedUrl?: string, options?: any): Promise<{ response: http.IncomingMessage; body: SubscriptionCharge; }>; /** * Reads the entity with the given 'id' and returns it. * @summary Read * @param spaceId * @param id The id of the subscription which should be returned. * @param {*} [options] Override http request options. */ read(spaceId: number, id: number, options?: any): Promise<{ response: http.IncomingMessage; body: Subscription; }>; /** * Searches for the entities as specified by the given query. * @summary Search * @param spaceId * @param query The query restricts the subscriptions which are returned by the search. * @param {*} [options] Override http request options. */ search(spaceId: number, query: EntityQuery, options?: any): Promise<{ response: http.IncomingMessage; body: Array<Subscription>; }>; /** * This operation allows to search for subscription invoices. * @summary Search Subscription Invoices * @param spaceId * @param subscriptionId The id of the subscription for which the invoices should be searched for. * @param query The query restricts the invoices which are returned by the search. * @param {*} [options] Override http request options. */ searchSubscriptionInvoices(spaceId: number, subscriptionId: number, query: EntityQuery, options?: any): Promise<{ response: http.IncomingMessage; body: Array<TransactionInvoice>; }>; /** * This operation allows to terminate a subscription. * @summary terminate * @param spaceId * @param subscriptionId The subscription id identifies the subscription which should be terminated. * @param respectTerminationPeriod The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. * @param {*} [options] Override http request options. */ terminate(spaceId: number, subscriptionId: number, respectTerminationPeriod: boolean, options?: any): Promise<{ response: http.IncomingMessage; body?: any; }>; /** * This operation allows to update the subscription. * @summary update * @param spaceId * @param subscriptionId * @param request * @param {*} [options] Override http request options. */ update(spaceId: number, subscriptionId: number, request: SubscriptionUpdateRequest, options?: any): Promise<{ response: http.IncomingMessage; body: Subscription; }>; /** * The update product version operation updates the product version of the subscription to the latest active product version. * @summary update product version * @param spaceId * @param subscriptionId The subscription id identifies the subscription which should be updated to the latest version. * @param respectTerminationPeriod The subscription version may be retired. The respect termination period controls whether the termination period configured on the product version should be respected or if the operation should take effect immediately. * @param {*} [options] Override http request options. */ updateProductVersion(spaceId: number, subscriptionId: number, respectTerminationPeriod: boolean, options?: any): Promise<{ response: http.IncomingMessage; body: SubscriptionVersion; }>; } export { SubscriptionService };