Projekt

Obecné

Profil

Stáhnout (3.3 KB) Statistiky
| Větev: | Tag: | Revize:
1
/* eslint-disable */
2
/* tslint:disable */
3
/*
4
 * ---------------------------------------------------------------
5
 * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API        ##
6
 * ##                                                           ##
7
 * ## AUTHOR: acacode                                           ##
8
 * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9
 * ---------------------------------------------------------------
10
 */
11

    
12
import { PasswordDto, PermissionDto, UserDto } from "./data-contracts";
13
import { ContentType, HttpClient, RequestParams } from "./http-client";
14

    
15
export class Users<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
16
  /**
17
   * No description
18
   *
19
   * @tags user-controller
20
   * @name GetAllUsers
21
   * @summary returns all users
22
   * @request GET:/users
23
   */
24
  getAllUsers = (params: RequestParams = {}) =>
25
    this.request<UserDto[], any>({
26
      path: `/users`,
27
      method: "GET",
28
      ...params,
29
    });
30
  /**
31
   * No description
32
   *
33
   * @tags user-controller
34
   * @name RegisterNewUser
35
   * @summary registers new user
36
   * @request POST:/users
37
   */
38
  registerNewUser = (data: UserDto, params: RequestParams = {}) =>
39
    this.request<void, any>({
40
      path: `/users`,
41
      method: "POST",
42
      body: data,
43
      type: ContentType.Json,
44
      ...params,
45
    });
46
  /**
47
   * No description
48
   *
49
   * @tags user-controller
50
   * @name UpdatePermissions
51
   * @summary changes permissions to given user
52
   * @request PATCH:/users/{username}/permissions
53
   */
54
  updatePermissions = (username: string, data: PermissionDto, params: RequestParams = {}) =>
55
    this.request<void, any>({
56
      path: `/users/${username}/permissions`,
57
      method: "PATCH",
58
      body: data,
59
      type: ContentType.Json,
60
      ...params,
61
    });
62
  /**
63
   * No description
64
   *
65
   * @tags user-controller
66
   * @name ResetPassword
67
   * @summary changes password to given user
68
   * @request PATCH:/users/{username}/password
69
   */
70
  resetPassword = (username: string, data: PasswordDto, params: RequestParams = {}) =>
71
    this.request<void, any>({
72
      path: `/users/${username}/password`,
73
      method: "PATCH",
74
      body: data,
75
      type: ContentType.Json,
76
      ...params,
77
    });
78
  /**
79
   * No description
80
   *
81
   * @tags user-controller
82
   * @name ChangePassword
83
   * @summary changes password to logged-in user
84
   * @request PATCH:/users/password
85
   */
86
  changePassword = (query: { oldPassword: string }, data: PasswordDto, params: RequestParams = {}) =>
87
    this.request<void, any>({
88
      path: `/users/password`,
89
      method: "PATCH",
90
      query: query,
91
      body: data,
92
      type: ContentType.Json,
93
      ...params,
94
    });
95
  /**
96
   * No description
97
   *
98
   * @tags user-controller
99
   * @name RefreshToken
100
   * @summary returns a new access token and a refresh token to user
101
   * @request GET:/users/token
102
   */
103
  refreshToken = (params: RequestParams = {}) =>
104
    this.request<void, any>({
105
      path: `/users/token`,
106
      method: "GET",
107
      ...params,
108
    });
109
  /**
110
   * No description
111
   *
112
   * @tags user-controller
113
   * @name DeleteUser
114
   * @summary deletes user with given username
115
   * @request DELETE:/users/{username}
116
   */
117
  deleteUser = (username: string, params: RequestParams = {}) =>
118
    this.request<void, any>({
119
      path: `/users/${username}`,
120
      method: "DELETE",
121
      ...params,
122
    });
123
}
(6-6/8)