{"version":3,"file":"user.cjs","sources":["../../../../src/resources/classes/user.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n  OystehrClientRequest,\n  UserDeleteParams,\n  UserGetParams,\n  UserGetResponse,\n  UserInviteParams,\n  UserInviteResponse,\n  UserListResponse,\n  UserListV2Params,\n  UserListV2Response,\n  UserMeResponse,\n  UserResetMfaParams,\n  UserUpdateParams,\n  UserUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class User 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   * Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.\n   */\n  me(request?: OystehrClientRequest): Promise<UserMeResponse> {\n    return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);\n  }\n  /**\n   * Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `App:GetUser`\n   * Access Policy Resource: `App:User`\n   */\n  get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {\n    return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n  }\n  /**\n   * Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `App:UpdateUser`\n   * Access Policy Resource: `App:User`\n   */\n  update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {\n    return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n  }\n  /**\n   * Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `App:DeleteUser`\n   * Access Policy Resource: `App:User`\n   */\n  delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {\n    return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n  }\n  /**\n   * Reset MFA for the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `App:ResetUserMFA`\n   * Access Policy Resource: `App:User`\n   */\n  resetMfa(params: UserResetMfaParams, request?: OystehrClientRequest): Promise<void> {\n    return this.request('/user/{id}/reset-mfa', 'post', this.#baseUrlThunk.bind(this))(params, request);\n  }\n  /**\n   * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `App:CreateUser`\n   * Access Policy Resource: `App:User`\n   */\n  invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {\n    return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);\n  }\n  /**\n   * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.\n   *\n   * Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `App:ListAllUsers`\n   * Access Policy Resource: `App:User`\n   */\n  list(request?: OystehrClientRequest): Promise<UserListResponse> {\n    return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);\n  }\n  /**\n   * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `Project:ListAllUsers`\n   * Access Policy Resource: `Project:Settings`\n   */\n  listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response>;\n  /**\n   * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `Project:ListAllUsers`\n   * Access Policy Resource: `Project:Settings`\n   */\n  listV2(request?: OystehrClientRequest): Promise<UserListV2Response>;\n  /**\n   * Get Users in the Project with pagination, sort, sort order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n   *\n   * Access Policy Action: `Project:ListAllUsers`\n   * Access Policy Resource: `Project:Settings`\n   */\n  listV2(\n    params?: UserListV2Params | OystehrClientRequest,\n    request?: OystehrClientRequest\n  ): Promise<UserListV2Response> {\n    return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n  }\n}\n"],"names":["SDKResource"],"mappings":";;;;AAAA;AAoBM,MAAO,IAAK,SAAQA,kBAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;KACf;IACD,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,eAAe,CAAC,IAAI,mCAAmC,CAAC;KACvF;AACD;;;;AAIG;AACH,IAAA,EAAE,CAAC,OAA8B,EAAA;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,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