UNPKG

@oystehr/sdk

Version:

Oystehr SDK

80 lines (77 loc) 4.13 kB
import { SDKResource } from '../../client/client.js'; // AUTOGENERATED -- DO NOT EDIT class M2m extends SDKResource { constructor(config) { super(config); } #baseUrlThunk() { return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1'; } /** * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead. * * Get a list of all M2M Clients. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:ListAllM2MClients` * Access Policy Resource: `IAM:M2MClient` */ list(request) { return this.request('/m2m', 'get', this.#baseUrlThunk.bind(this))(request); } /** * Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:CreateM2MClient` * Access Policy Resource: `IAM:M2MClient` */ create(params, request) { return this.request('/m2m', 'post', this.#baseUrlThunk.bind(this))(params, request); } /** * Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:GetM2MClient` * Access Policy Resource: `IAM:M2MClient` */ get(params, request) { return this.request('/m2m/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request); } /** * Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:UpdateM2MClient` * Access Policy Resource: `IAM:M2MClient` */ update(params, request) { return this.request('/m2m/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request); } /** * Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:DeleteM2MClient` * Access Policy Resource: `IAM:M2MClient` */ delete(params, request) { return this.request('/m2m/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request); } /** * Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:RotateM2MClientSecret` * Access Policy Resource: `IAM:M2MClient` */ rotateSecret(params, request) { return this.request('/m2m/{id}/rotate-secret', 'post', this.#baseUrlThunk.bind(this))(params, request); } /** * Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda). * * Access Policy Action: `App:ListAllM2MClients` * Access Policy Resource: `IAM:M2MClient` */ listV2(params, request) { return this.request('/m2m/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request); } } export { M2m }; //# sourceMappingURL=m2m.js.map