11import WarrantModule from "./WarrantModule" ;
22import WarrantClient from "../WarrantClient" ;
33import { CreateFeatureParams , ListFeatureOptions } from "../types/Feature" ;
4- import { UserRequestOptions } from "../types/Params " ;
4+ import { WarrantRequestOptions } from "../types/WarrantRequestOptions " ;
55import Warrant , { WarrantObject } from "../types/Warrant" ;
66import { ObjectType } from "../types/ObjectType" ;
77
@@ -15,7 +15,7 @@ export default class Feature implements WarrantObject {
1515 //
1616 // Static methods
1717 //
18- public static async create ( feature : CreateFeatureParams , options : UserRequestOptions = { } ) : Promise < Feature > {
18+ public static async create ( feature : CreateFeatureParams , options : WarrantRequestOptions = { } ) : Promise < Feature > {
1919 try {
2020 const response = await WarrantClient . httpClient . post ( {
2121 url : "/v1/features" ,
@@ -29,7 +29,7 @@ export default class Feature implements WarrantObject {
2929 }
3030 }
3131
32- public static async get ( featureId : string , options : UserRequestOptions = { } ) : Promise < Feature > {
32+ public static async get ( featureId : string , options : WarrantRequestOptions = { } ) : Promise < Feature > {
3333 try {
3434 const response = await WarrantClient . httpClient . get ( {
3535 url : `/v1/features/${ featureId } ` ,
@@ -42,7 +42,7 @@ export default class Feature implements WarrantObject {
4242 }
4343 }
4444
45- public static async delete ( featureId : string , options : UserRequestOptions = { } ) : Promise < void > {
45+ public static async delete ( featureId : string , options : WarrantRequestOptions = { } ) : Promise < void > {
4646 try {
4747 return await WarrantClient . httpClient . delete ( {
4848 url : `/v1/features/${ featureId } ` ,
@@ -53,7 +53,7 @@ export default class Feature implements WarrantObject {
5353 }
5454 }
5555
56- public static async listFeatures ( listOptions : ListFeatureOptions = { } , options : UserRequestOptions = { } ) : Promise < Feature [ ] > {
56+ public static async listFeatures ( listOptions : ListFeatureOptions = { } , options : WarrantRequestOptions = { } ) : Promise < Feature [ ] > {
5757 try {
5858 const response = await WarrantClient . httpClient . get ( {
5959 url : "/v1/features" ,
@@ -67,7 +67,7 @@ export default class Feature implements WarrantObject {
6767 }
6868 }
6969
70- public static async listFeaturesForPricingTier ( pricingTierId : string , listOptions : ListFeatureOptions = { } , options : UserRequestOptions = { } ) : Promise < Feature [ ] > {
70+ public static async listFeaturesForPricingTier ( pricingTierId : string , listOptions : ListFeatureOptions = { } , options : WarrantRequestOptions = { } ) : Promise < Feature [ ] > {
7171 try {
7272 const response = await WarrantClient . httpClient . get ( {
7373 url : `/v1/pricing-tiers/${ pricingTierId } /features` ,
@@ -81,7 +81,7 @@ export default class Feature implements WarrantObject {
8181 }
8282 }
8383
84- public static async assignFeatureToPricingTier ( pricingTierId : string , featureId : string , options : UserRequestOptions = { } ) : Promise < Warrant > {
84+ public static async assignFeatureToPricingTier ( pricingTierId : string , featureId : string , options : WarrantRequestOptions = { } ) : Promise < Warrant > {
8585 return WarrantModule . create ( {
8686 object : {
8787 objectType : ObjectType . Feature ,
@@ -95,7 +95,7 @@ export default class Feature implements WarrantObject {
9595 } , options ) ;
9696 }
9797
98- public static async removeFeatureFromPricingTier ( pricingTierId : string , featureId : string , options : UserRequestOptions = { } ) : Promise < void > {
98+ public static async removeFeatureFromPricingTier ( pricingTierId : string , featureId : string , options : WarrantRequestOptions = { } ) : Promise < void > {
9999 return WarrantModule . delete ( {
100100 object : {
101101 objectType : ObjectType . Feature ,
@@ -109,7 +109,7 @@ export default class Feature implements WarrantObject {
109109 } , options ) ;
110110 }
111111
112- public static async listFeaturesForTenant ( tenantId : string , listOptions : ListFeatureOptions = { } , options : UserRequestOptions = { } ) : Promise < Feature [ ] > {
112+ public static async listFeaturesForTenant ( tenantId : string , listOptions : ListFeatureOptions = { } , options : WarrantRequestOptions = { } ) : Promise < Feature [ ] > {
113113 try {
114114 const response = await WarrantClient . httpClient . get ( {
115115 url : `/v1/tenants/${ tenantId } /features` ,
@@ -123,7 +123,7 @@ export default class Feature implements WarrantObject {
123123 }
124124 }
125125
126- public static async assignFeatureToTenant ( tenantId : string , featureId : string , options : UserRequestOptions = { } ) : Promise < Warrant > {
126+ public static async assignFeatureToTenant ( tenantId : string , featureId : string , options : WarrantRequestOptions = { } ) : Promise < Warrant > {
127127 return WarrantModule . create ( {
128128 object : {
129129 objectType : ObjectType . Feature ,
@@ -137,7 +137,7 @@ export default class Feature implements WarrantObject {
137137 } , options ) ;
138138 }
139139
140- public static async removeFeatureFromTenant ( tenantId : string , featureId : string , options : UserRequestOptions = { } ) : Promise < void > {
140+ public static async removeFeatureFromTenant ( tenantId : string , featureId : string , options : WarrantRequestOptions = { } ) : Promise < void > {
141141 return WarrantModule . delete ( {
142142 object : {
143143 objectType : ObjectType . Feature ,
@@ -151,7 +151,7 @@ export default class Feature implements WarrantObject {
151151 } , options ) ;
152152 }
153153
154- public static async listFeaturesForUser ( userId : string , listOptions : ListFeatureOptions = { } , options : UserRequestOptions = { } ) : Promise < Feature [ ] > {
154+ public static async listFeaturesForUser ( userId : string , listOptions : ListFeatureOptions = { } , options : WarrantRequestOptions = { } ) : Promise < Feature [ ] > {
155155 try {
156156 const response = await WarrantClient . httpClient . get ( {
157157 url : `/v1/users/${ userId } /features` ,
@@ -165,7 +165,7 @@ export default class Feature implements WarrantObject {
165165 }
166166 }
167167
168- public static async assignFeatureToUser ( userId : string , featureId : string , options : UserRequestOptions = { } ) : Promise < Warrant > {
168+ public static async assignFeatureToUser ( userId : string , featureId : string , options : WarrantRequestOptions = { } ) : Promise < Warrant > {
169169 return WarrantModule . create ( {
170170 object : {
171171 objectType : ObjectType . Feature ,
@@ -179,7 +179,7 @@ export default class Feature implements WarrantObject {
179179 } , options ) ;
180180 }
181181
182- public static async removeFeatureFromUser ( userId : string , featureId : string , options : UserRequestOptions = { } ) : Promise < void > {
182+ public static async removeFeatureFromUser ( userId : string , featureId : string , options : WarrantRequestOptions = { } ) : Promise < void > {
183183 return WarrantModule . delete ( {
184184 object : {
185185 objectType : ObjectType . Feature ,
0 commit comments