@oystehr/sdk
Version:
Oystehr SDK
1 lines • 8.14 kB
Source Map (JSON)
{"version":3,"file":"m2m.cjs","sources":["../../../../src/resources/classes/m2m.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n M2mCreateParams,\n M2mCreateResponse,\n M2mDeleteParams,\n M2mGetParams,\n M2mGetResponse,\n M2mListResponse,\n M2mListV2Params,\n M2mListV2Response,\n M2mMeResponse,\n M2mRotateSecretParams,\n M2mRotateSecretResponse,\n M2mUpdateParams,\n M2mUpdateResponse,\n OystehrClientRequest,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class M2m extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.\n *\n * 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).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n list(request?: OystehrClientRequest): Promise<M2mListResponse> {\n return this.request('/m2m', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * 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).\n *\n * Access Policy Action: `App:CreateM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n create(params: M2mCreateParams, request?: OystehrClientRequest): Promise<M2mCreateResponse> {\n return this.request('/m2m', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get information about the calling 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).\n *\n * Access Policy Action: `App:GetM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n me(request?: OystehrClientRequest): Promise<M2mMeResponse> {\n return this.request('/m2m/me', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * 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).\n *\n * Access Policy Action: `App:GetM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n get(params: M2mGetParams, request?: OystehrClientRequest): Promise<M2mGetResponse> {\n return this.request('/m2m/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * 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).\n *\n * Access Policy Action: `App:UpdateM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n update(params: M2mUpdateParams, request?: OystehrClientRequest): Promise<M2mUpdateResponse> {\n return this.request('/m2m/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * 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).\n *\n * Access Policy Action: `App:DeleteM2MClient`\n * Access Policy Resource: `IAM:M2MClient`\n */\n delete(params: M2mDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/m2m/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * 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).\n *\n * Access Policy Action: `App:RotateM2MClientSecret`\n * Access Policy Resource: `IAM:M2MClient`\n */\n rotateSecret(params: M2mRotateSecretParams, request?: OystehrClientRequest): Promise<M2mRotateSecretResponse> {\n return this.request('/m2m/{id}/rotate-secret', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * 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).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(params: M2mListV2Params, request?: OystehrClientRequest): Promise<M2mListV2Response>;\n /**\n * 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).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(request?: OystehrClientRequest): Promise<M2mListV2Response>;\n /**\n * 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).\n *\n * Access Policy Action: `App:ListAllM2MClients`\n * Access Policy Resource: `IAM:M2MClient`\n */\n listV2(params?: M2mListV2Params | OystehrClientRequest, request?: OystehrClientRequest): Promise<M2mListV2Response> {\n return this.request('/m2m/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAqBM,MAAO,GAAI,SAAQA,kBAAW,CAAA;AAClC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,C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