@dynamic-labs/sdk-api 0.0.879 → 0.0.880

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-api",
3
- "version": "0.0.879",
3
+ "version": "0.0.880",
4
4
  "author": "Dynamic Labs",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
@@ -163,6 +163,43 @@ class OrganizationsApi extends runtime.BaseAPI {
163
163
  return yield response.value();
164
164
  });
165
165
  }
166
+ /**
167
+ * Schedules the subscription for cancellation at the end of the current billing period. The subscription remains active until then.
168
+ * Cancel subscription at period end
169
+ */
170
+ cancelSubscriptionForOrganizationRaw(requestParameters, initOverrides) {
171
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
172
+ if (requestParameters.organizationId === null || requestParameters.organizationId === undefined) {
173
+ throw new runtime.RequiredError('organizationId', 'Required parameter requestParameters.organizationId was null or undefined when calling cancelSubscriptionForOrganization.');
174
+ }
175
+ const queryParameters = {};
176
+ const headerParameters = {};
177
+ if (this.configuration && this.configuration.accessToken) {
178
+ const token = this.configuration.accessToken;
179
+ const tokenString = yield token("bearerAuth", []);
180
+ if (tokenString) {
181
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
182
+ }
183
+ }
184
+ const response = yield this.request({
185
+ path: `/organizations/{organizationId}/billing/subscription/cancel`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters.organizationId))),
186
+ method: 'POST',
187
+ headers: headerParameters,
188
+ query: queryParameters,
189
+ }, initOverrides);
190
+ return new runtime.JSONApiResponse(response, (jsonValue) => BillingSubscription.BillingSubscriptionFromJSON(jsonValue));
191
+ });
192
+ }
193
+ /**
194
+ * Schedules the subscription for cancellation at the end of the current billing period. The subscription remains active until then.
195
+ * Cancel subscription at period end
196
+ */
197
+ cancelSubscriptionForOrganization(requestParameters, initOverrides) {
198
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
199
+ const response = yield this.cancelSubscriptionForOrganizationRaw(requestParameters, initOverrides);
200
+ return yield response.value();
201
+ });
202
+ }
166
203
  /**
167
204
  * Creates a new organization.
168
205
  * Create an organization
@@ -15,6 +15,9 @@ export interface ApplyCouponForSubscriptionRequest {
15
15
  organizationId: string;
16
16
  billingSubscriptionCoupon: BillingSubscriptionCoupon;
17
17
  }
18
+ export interface CancelSubscriptionForOrganizationRequest {
19
+ organizationId: string;
20
+ }
18
21
  export interface CreateOrganizationRequest {
19
22
  organizationRequest: OrganizationRequest;
20
23
  }
@@ -65,6 +68,16 @@ export declare class OrganizationsApi extends runtime.BaseAPI {
65
68
  * Add coupon to subscription
66
69
  */
67
70
  applyCouponForSubscription(requestParameters: ApplyCouponForSubscriptionRequest, initOverrides?: RequestInit): Promise<BillingSubscription>;
71
+ /**
72
+ * Schedules the subscription for cancellation at the end of the current billing period. The subscription remains active until then.
73
+ * Cancel subscription at period end
74
+ */
75
+ cancelSubscriptionForOrganizationRaw(requestParameters: CancelSubscriptionForOrganizationRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<BillingSubscription>>;
76
+ /**
77
+ * Schedules the subscription for cancellation at the end of the current billing period. The subscription remains active until then.
78
+ * Cancel subscription at period end
79
+ */
80
+ cancelSubscriptionForOrganization(requestParameters: CancelSubscriptionForOrganizationRequest, initOverrides?: RequestInit): Promise<BillingSubscription>;
68
81
  /**
69
82
  * Creates a new organization.
70
83
  * Create an organization
@@ -159,6 +159,43 @@ class OrganizationsApi extends BaseAPI {
159
159
  return yield response.value();
160
160
  });
161
161
  }
162
+ /**
163
+ * Schedules the subscription for cancellation at the end of the current billing period. The subscription remains active until then.
164
+ * Cancel subscription at period end
165
+ */
166
+ cancelSubscriptionForOrganizationRaw(requestParameters, initOverrides) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ if (requestParameters.organizationId === null || requestParameters.organizationId === undefined) {
169
+ throw new RequiredError('organizationId', 'Required parameter requestParameters.organizationId was null or undefined when calling cancelSubscriptionForOrganization.');
170
+ }
171
+ const queryParameters = {};
172
+ const headerParameters = {};
173
+ if (this.configuration && this.configuration.accessToken) {
174
+ const token = this.configuration.accessToken;
175
+ const tokenString = yield token("bearerAuth", []);
176
+ if (tokenString) {
177
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
178
+ }
179
+ }
180
+ const response = yield this.request({
181
+ path: `/organizations/{organizationId}/billing/subscription/cancel`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters.organizationId))),
182
+ method: 'POST',
183
+ headers: headerParameters,
184
+ query: queryParameters,
185
+ }, initOverrides);
186
+ return new JSONApiResponse(response, (jsonValue) => BillingSubscriptionFromJSON(jsonValue));
187
+ });
188
+ }
189
+ /**
190
+ * Schedules the subscription for cancellation at the end of the current billing period. The subscription remains active until then.
191
+ * Cancel subscription at period end
192
+ */
193
+ cancelSubscriptionForOrganization(requestParameters, initOverrides) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ const response = yield this.cancelSubscriptionForOrganizationRaw(requestParameters, initOverrides);
196
+ return yield response.value();
197
+ });
198
+ }
162
199
  /**
163
200
  * Creates a new organization.
164
201
  * Create an organization
@@ -18,6 +18,7 @@ function BillingSubscriptionFromJSONTyped(json, ignoreDiscriminator) {
18
18
  return {
19
19
  'billingPortalUrl': !runtime.exists(json, 'billingPortalUrl') ? undefined : json['billingPortalUrl'],
20
20
  'billingPortalAddPaymentMethodUrl': !runtime.exists(json, 'billingPortalAddPaymentMethodUrl') ? undefined : json['billingPortalAddPaymentMethodUrl'],
21
+ 'cancelAtPeriodEnd': !runtime.exists(json, 'cancelAtPeriodEnd') ? undefined : json['cancelAtPeriodEnd'],
21
22
  'hasPaymentMethod': json['hasPaymentMethod'],
22
23
  'planType': BillingSubscriptionPlanTypeEnum.BillingSubscriptionPlanTypeEnumFromJSON(json['planType']),
23
24
  'inTrial': json['inTrial'],
@@ -41,6 +42,7 @@ function BillingSubscriptionToJSON(value) {
41
42
  return {
42
43
  'billingPortalUrl': value.billingPortalUrl,
43
44
  'billingPortalAddPaymentMethodUrl': value.billingPortalAddPaymentMethodUrl,
45
+ 'cancelAtPeriodEnd': value.cancelAtPeriodEnd,
44
46
  'hasPaymentMethod': value.hasPaymentMethod,
45
47
  'planType': BillingSubscriptionPlanTypeEnum.BillingSubscriptionPlanTypeEnumToJSON(value.planType),
46
48
  'inTrial': value.inTrial,
@@ -30,6 +30,12 @@ export interface BillingSubscription {
30
30
  * @memberof BillingSubscription
31
31
  */
32
32
  billingPortalAddPaymentMethodUrl?: string;
33
+ /**
34
+ *
35
+ * @type {boolean}
36
+ * @memberof BillingSubscription
37
+ */
38
+ cancelAtPeriodEnd?: boolean;
33
39
  /**
34
40
  *
35
41
  * @type {boolean}
@@ -14,6 +14,7 @@ function BillingSubscriptionFromJSONTyped(json, ignoreDiscriminator) {
14
14
  return {
15
15
  'billingPortalUrl': !exists(json, 'billingPortalUrl') ? undefined : json['billingPortalUrl'],
16
16
  'billingPortalAddPaymentMethodUrl': !exists(json, 'billingPortalAddPaymentMethodUrl') ? undefined : json['billingPortalAddPaymentMethodUrl'],
17
+ 'cancelAtPeriodEnd': !exists(json, 'cancelAtPeriodEnd') ? undefined : json['cancelAtPeriodEnd'],
17
18
  'hasPaymentMethod': json['hasPaymentMethod'],
18
19
  'planType': BillingSubscriptionPlanTypeEnumFromJSON(json['planType']),
19
20
  'inTrial': json['inTrial'],
@@ -37,6 +38,7 @@ function BillingSubscriptionToJSON(value) {
37
38
  return {
38
39
  'billingPortalUrl': value.billingPortalUrl,
39
40
  'billingPortalAddPaymentMethodUrl': value.billingPortalAddPaymentMethodUrl,
41
+ 'cancelAtPeriodEnd': value.cancelAtPeriodEnd,
40
42
  'hasPaymentMethod': value.hasPaymentMethod,
41
43
  'planType': BillingSubscriptionPlanTypeEnumToJSON(value.planType),
42
44
  'inTrial': value.inTrial,