Skip to content

Commit

Permalink
feat(api): entitlement value check for Customer (#2133)
Browse files Browse the repository at this point in the history
Co-authored-by: Andras Toth <[email protected]>
  • Loading branch information
GAlexIHU and tothandras authored Jan 22, 2025
1 parent acc207f commit ddb6177
Show file tree
Hide file tree
Showing 27 changed files with 3,080 additions and 2,156 deletions.
1,573 changes: 820 additions & 753 deletions api/api.gen.go

Large diffs are not rendered by default.

908 changes: 556 additions & 352 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

128 changes: 124 additions & 4 deletions api/client/node/schemas/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,26 @@ export interface paths {
patch?: never
trace?: never
}
'/api/v1/customers/{customerId}/entitlements/{featureKey}/value': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
/**
* Get entitlement value
* @description Checks customer access to a given feature (by key). All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
*/
get: operations['getCustomerEntitlementValue']
put?: never
post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/api/v1/customers/{id}': {
parameters: {
query?: never
Expand Down Expand Up @@ -6101,7 +6121,11 @@ export interface components {
* Price
* @description The price of the rate card.
* When null, the feature or service is free.
* @example {}
* @example {
* "type": "flat",
* "amount": "100",
* "paymentTerm": "in_arrears"
* }
*/
price: components['schemas']['FlatPriceWithPaymentTerm'] | null
}
Expand Down Expand Up @@ -6627,7 +6651,9 @@ export interface components {
* @example Customer Name
*/
displayName?: string | null
/** @example {} */
/** @example {
* "hubspotId": "123456"
* } */
metadata?: {
[key: string]: unknown
} | null
Expand Down Expand Up @@ -6670,7 +6696,9 @@ export interface components {
* @example Customer Name
*/
displayName?: string | null
/** @example {} */
/** @example {
* "hubspotId": "123456"
* } */
metadata?: {
[key: string]: unknown
} | null
Expand Down Expand Up @@ -6943,7 +6971,11 @@ export interface components {
* Price
* @description The price of the rate card.
* When null, the feature or service is free.
* @example {}
* @example {
* "type": "flat",
* "amount": "100",
* "paymentTerm": "in_arrears"
* }
*/
price:
| (components['schemas']['FlatPriceWithPaymentTerm'] | null)
Expand Down Expand Up @@ -10517,6 +10549,94 @@ export interface operations {
}
}
}
getCustomerEntitlementValue: {
parameters: {
query?: {
time?: string
}
header?: never
path: {
customerId: string
featureKey: string
}
cookie?: never
}
requestBody?: never
responses: {
/** @description The request has succeeded. */
200: {
headers: {
[name: string]: unknown
}
content: {
'application/json': components['schemas']['EntitlementValue']
}
}
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
400: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['BadRequestProblemResponse']
}
}
/** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
401: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnauthorizedProblemResponse']
}
}
/** @description The server understood the request but refuses to authorize it. */
403: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ForbiddenProblemResponse']
}
}
/** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
404: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['NotFoundProblemResponse']
}
}
/** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
500: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['InternalServerErrorProblemResponse']
}
}
/** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
503: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse']
}
}
/** @description An unexpected error response. */
default: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnexpectedProblemResponse']
}
}
}
}
getCustomer: {
parameters: {
query?: never
Expand Down
128 changes: 124 additions & 4 deletions api/client/web/src/client/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,26 @@ export interface paths {
patch?: never
trace?: never
}
'/api/v1/customers/{customerId}/entitlements/{featureKey}/value': {
parameters: {
query?: never
header?: never
path?: never
cookie?: never
}
/**
* Get entitlement value
* @description Checks customer access to a given feature (by key). All entitlement types share the hasAccess property in their value response, but multiple other properties are returned based on the entitlement type.
*/
get: operations['getCustomerEntitlementValue']
put?: never
post?: never
delete?: never
options?: never
head?: never
patch?: never
trace?: never
}
'/api/v1/customers/{id}': {
parameters: {
query?: never
Expand Down Expand Up @@ -6104,7 +6124,11 @@ export interface components {
* Price
* @description The price of the rate card.
* When null, the feature or service is free.
* @example {}
* @example {
* "type": "flat",
* "amount": "100",
* "paymentTerm": "in_arrears"
* }
*/
price: components['schemas']['FlatPriceWithPaymentTerm'] | null
}
Expand Down Expand Up @@ -6636,7 +6660,9 @@ export interface components {
* @example Customer Name
*/
displayName?: string | null
/** @example {} */
/** @example {
* "hubspotId": "123456"
* } */
metadata?: {
[key: string]: unknown
} | null
Expand Down Expand Up @@ -6679,7 +6705,9 @@ export interface components {
* @example Customer Name
*/
displayName?: string | null
/** @example {} */
/** @example {
* "hubspotId": "123456"
* } */
metadata?: {
[key: string]: unknown
} | null
Expand Down Expand Up @@ -6952,7 +6980,11 @@ export interface components {
* Price
* @description The price of the rate card.
* When null, the feature or service is free.
* @example {}
* @example {
* "type": "flat",
* "amount": "100",
* "paymentTerm": "in_arrears"
* }
*/
price:
| (components['schemas']['FlatPriceWithPaymentTerm'] | null)
Expand Down Expand Up @@ -10526,6 +10558,94 @@ export interface operations {
}
}
}
getCustomerEntitlementValue: {
parameters: {
query?: {
time?: string
}
header?: never
path: {
customerId: string
featureKey: string
}
cookie?: never
}
requestBody?: never
responses: {
/** @description The request has succeeded. */
200: {
headers: {
[name: string]: unknown
}
content: {
'application/json': components['schemas']['EntitlementValue']
}
}
/** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */
400: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['BadRequestProblemResponse']
}
}
/** @description The request has not been applied because it lacks valid authentication credentials for the target resource. */
401: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnauthorizedProblemResponse']
}
}
/** @description The server understood the request but refuses to authorize it. */
403: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ForbiddenProblemResponse']
}
}
/** @description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. */
404: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['NotFoundProblemResponse']
}
}
/** @description The server encountered an unexpected condition that prevented it from fulfilling the request. */
500: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['InternalServerErrorProblemResponse']
}
}
/** @description The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. */
503: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['ServiceUnavailableProblemResponse']
}
}
/** @description An unexpected error response. */
default: {
headers: {
[name: string]: unknown
}
content: {
'application/problem+json': components['schemas']['UnexpectedProblemResponse']
}
}
}
}
getCustomer: {
parameters: {
query?: never
Expand Down
Loading

0 comments on commit ddb6177

Please sign in to comment.