@tennac-booking/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +17 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/apis/AuthApi.ts +157 -0
- package/apis/UsersApi.ts +56 -0
- package/apis/index.ts +4 -0
- package/dist/apis/AuthApi.d.ts +39 -0
- package/dist/apis/AuthApi.js +117 -0
- package/dist/apis/UsersApi.d.ts +26 -0
- package/dist/apis/UsersApi.js +58 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/esm/apis/AuthApi.d.ts +39 -0
- package/dist/esm/apis/AuthApi.js +113 -0
- package/dist/esm/apis/UsersApi.d.ts +26 -0
- package/dist/esm/apis/UsersApi.js +54 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +4 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/Booking.d.ts +87 -0
- package/dist/esm/models/Booking.js +82 -0
- package/dist/esm/models/Court.d.ts +76 -0
- package/dist/esm/models/Court.js +72 -0
- package/dist/esm/models/Slot.d.ts +44 -0
- package/dist/esm/models/Slot.js +51 -0
- package/dist/esm/models/SlotException.d.ts +50 -0
- package/dist/esm/models/SlotException.js +55 -0
- package/dist/esm/models/User.d.ts +92 -0
- package/dist/esm/models/User.js +69 -0
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +7 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/esm/src/apis/AuthApi.d.ts +39 -0
- package/dist/esm/src/apis/AuthApi.js +113 -0
- package/dist/esm/src/apis/UsersApi.d.ts +26 -0
- package/dist/esm/src/apis/UsersApi.js +54 -0
- package/dist/esm/src/apis/index.d.ts +2 -0
- package/dist/esm/src/apis/index.js +4 -0
- package/dist/esm/src/index.d.ts +3 -0
- package/dist/esm/src/index.js +5 -0
- package/dist/esm/src/models/Booking.d.ts +87 -0
- package/dist/esm/src/models/Booking.js +82 -0
- package/dist/esm/src/models/Court.d.ts +76 -0
- package/dist/esm/src/models/Court.js +72 -0
- package/dist/esm/src/models/Slot.d.ts +44 -0
- package/dist/esm/src/models/Slot.js +51 -0
- package/dist/esm/src/models/SlotException.d.ts +50 -0
- package/dist/esm/src/models/SlotException.js +55 -0
- package/dist/esm/src/models/User.d.ts +92 -0
- package/dist/esm/src/models/User.js +69 -0
- package/dist/esm/src/models/index.d.ts +5 -0
- package/dist/esm/src/models/index.js +7 -0
- package/dist/esm/src/runtime.d.ts +184 -0
- package/dist/esm/src/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Booking.d.ts +87 -0
- package/dist/models/Booking.js +90 -0
- package/dist/models/Court.d.ts +76 -0
- package/dist/models/Court.js +80 -0
- package/dist/models/Slot.d.ts +44 -0
- package/dist/models/Slot.js +58 -0
- package/dist/models/SlotException.d.ts +50 -0
- package/dist/models/SlotException.js +62 -0
- package/dist/models/User.d.ts +92 -0
- package/dist/models/User.js +76 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +23 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/dist/src/apis/AuthApi.d.ts +39 -0
- package/dist/src/apis/AuthApi.js +117 -0
- package/dist/src/apis/UsersApi.d.ts +26 -0
- package/dist/src/apis/UsersApi.js +58 -0
- package/dist/src/apis/index.d.ts +2 -0
- package/dist/src/apis/index.js +20 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +21 -0
- package/dist/src/models/Booking.d.ts +87 -0
- package/dist/src/models/Booking.js +90 -0
- package/dist/src/models/Court.d.ts +76 -0
- package/dist/src/models/Court.js +80 -0
- package/dist/src/models/Slot.d.ts +44 -0
- package/dist/src/models/Slot.js +58 -0
- package/dist/src/models/SlotException.d.ts +50 -0
- package/dist/src/models/SlotException.js +62 -0
- package/dist/src/models/User.d.ts +92 -0
- package/dist/src/models/User.js +76 -0
- package/dist/src/models/index.d.ts +5 -0
- package/dist/src/models/index.js +23 -0
- package/dist/src/runtime.d.ts +184 -0
- package/dist/src/runtime.js +350 -0
- package/index.ts +5 -0
- package/models/Booking.ts +142 -0
- package/models/Court.ts +130 -0
- package/models/Slot.ts +84 -0
- package/models/SlotException.ts +93 -0
- package/models/User.ts +149 -0
- package/models/index.ts +7 -0
- package/package.json +20 -0
- package/runtime.ts +432 -0
- package/src/apis/AuthApi.ts +157 -0
- package/src/apis/UsersApi.ts +56 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/Booking.ts +142 -0
- package/src/models/Court.ts +130 -0
- package/src/models/Slot.ts +84 -0
- package/src/models/SlotException.ts +93 -0
- package/src/models/User.ts +149 -0
- package/src/models/index.ts +7 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
User,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
UserFromJSON,
|
|
22
|
+
UserToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
export interface ApiAuthRegisterPostRequest {
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string;
|
|
28
|
+
email: string;
|
|
29
|
+
password: string;
|
|
30
|
+
username?: string;
|
|
31
|
+
isAccountVerified?: boolean;
|
|
32
|
+
level?: string;
|
|
33
|
+
stripeCustomerId?: string;
|
|
34
|
+
phone?: string;
|
|
35
|
+
profilePicture?: string;
|
|
36
|
+
isAdmin?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
export class AuthApi extends runtime.BaseAPI {
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Register a new user
|
|
46
|
+
*/
|
|
47
|
+
async apiAuthRegisterPostRaw(requestParameters: ApiAuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<User>> {
|
|
48
|
+
if (requestParameters['firstName'] == null) {
|
|
49
|
+
throw new runtime.RequiredError(
|
|
50
|
+
'firstName',
|
|
51
|
+
'Required parameter "firstName" was null or undefined when calling apiAuthRegisterPost().'
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (requestParameters['lastName'] == null) {
|
|
56
|
+
throw new runtime.RequiredError(
|
|
57
|
+
'lastName',
|
|
58
|
+
'Required parameter "lastName" was null or undefined when calling apiAuthRegisterPost().'
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (requestParameters['email'] == null) {
|
|
63
|
+
throw new runtime.RequiredError(
|
|
64
|
+
'email',
|
|
65
|
+
'Required parameter "email" was null or undefined when calling apiAuthRegisterPost().'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (requestParameters['password'] == null) {
|
|
70
|
+
throw new runtime.RequiredError(
|
|
71
|
+
'password',
|
|
72
|
+
'Required parameter "password" was null or undefined when calling apiAuthRegisterPost().'
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const queryParameters: any = {};
|
|
77
|
+
|
|
78
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
79
|
+
|
|
80
|
+
const consumes: runtime.Consume[] = [
|
|
81
|
+
{ contentType: 'multipart/form-data' },
|
|
82
|
+
];
|
|
83
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
84
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
85
|
+
|
|
86
|
+
let formParams: { append(param: string, value: any): any };
|
|
87
|
+
let useForm = false;
|
|
88
|
+
if (useForm) {
|
|
89
|
+
formParams = new FormData();
|
|
90
|
+
} else {
|
|
91
|
+
formParams = new URLSearchParams();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (requestParameters['username'] != null) {
|
|
95
|
+
formParams.append('username', requestParameters['username'] as any);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (requestParameters['firstName'] != null) {
|
|
99
|
+
formParams.append('firstName', requestParameters['firstName'] as any);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (requestParameters['lastName'] != null) {
|
|
103
|
+
formParams.append('lastName', requestParameters['lastName'] as any);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (requestParameters['email'] != null) {
|
|
107
|
+
formParams.append('email', requestParameters['email'] as any);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (requestParameters['isAccountVerified'] != null) {
|
|
111
|
+
formParams.append('isAccountVerified', requestParameters['isAccountVerified'] as any);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (requestParameters['level'] != null) {
|
|
115
|
+
formParams.append('level', requestParameters['level'] as any);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (requestParameters['stripeCustomerId'] != null) {
|
|
119
|
+
formParams.append('stripeCustomerId', requestParameters['stripeCustomerId'] as any);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (requestParameters['phone'] != null) {
|
|
123
|
+
formParams.append('phone', requestParameters['phone'] as any);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (requestParameters['password'] != null) {
|
|
127
|
+
formParams.append('password', requestParameters['password'] as any);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (requestParameters['profilePicture'] != null) {
|
|
131
|
+
formParams.append('profilePicture', requestParameters['profilePicture'] as any);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (requestParameters['isAdmin'] != null) {
|
|
135
|
+
formParams.append('isAdmin', requestParameters['isAdmin'] as any);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const response = await this.request({
|
|
139
|
+
path: `/api/auth/register`,
|
|
140
|
+
method: 'POST',
|
|
141
|
+
headers: headerParameters,
|
|
142
|
+
query: queryParameters,
|
|
143
|
+
body: formParams,
|
|
144
|
+
}, initOverrides);
|
|
145
|
+
|
|
146
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Register a new user
|
|
151
|
+
*/
|
|
152
|
+
async apiAuthRegisterPost(requestParameters: ApiAuthRegisterPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<User> {
|
|
153
|
+
const response = await this.apiAuthRegisterPostRaw(requestParameters, initOverrides);
|
|
154
|
+
return await response.value();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
User,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
UserFromJSON,
|
|
22
|
+
UserToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class UsersApi extends runtime.BaseAPI {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve all users
|
|
32
|
+
*/
|
|
33
|
+
async apiUsersGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<User>>> {
|
|
34
|
+
const queryParameters: any = {};
|
|
35
|
+
|
|
36
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
37
|
+
|
|
38
|
+
const response = await this.request({
|
|
39
|
+
path: `/api/users`,
|
|
40
|
+
method: 'GET',
|
|
41
|
+
headers: headerParameters,
|
|
42
|
+
query: queryParameters,
|
|
43
|
+
}, initOverrides);
|
|
44
|
+
|
|
45
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserFromJSON));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve all users
|
|
50
|
+
*/
|
|
51
|
+
async apiUsersGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<User>> {
|
|
52
|
+
const response = await this.apiUsersGetRaw(initOverrides);
|
|
53
|
+
return await response.value();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Booking
|
|
20
|
+
*/
|
|
21
|
+
export interface Booking {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof Booking
|
|
26
|
+
*/
|
|
27
|
+
userId: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {Array<string>}
|
|
31
|
+
* @memberof Booking
|
|
32
|
+
*/
|
|
33
|
+
playersIds?: Array<string>;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof Booking
|
|
38
|
+
*/
|
|
39
|
+
status: BookingStatusEnum;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof Booking
|
|
44
|
+
*/
|
|
45
|
+
stripeStatus: BookingStripeStatusEnum;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof Booking
|
|
50
|
+
*/
|
|
51
|
+
stripePaymentIntentId: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof Booking
|
|
56
|
+
*/
|
|
57
|
+
totalPrice: number;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof Booking
|
|
62
|
+
*/
|
|
63
|
+
slotId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @export
|
|
69
|
+
*/
|
|
70
|
+
export const BookingStatusEnum = {
|
|
71
|
+
Active: 'active',
|
|
72
|
+
Inactive: 'inactive'
|
|
73
|
+
} as const;
|
|
74
|
+
export type BookingStatusEnum = typeof BookingStatusEnum[keyof typeof BookingStatusEnum];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @export
|
|
78
|
+
*/
|
|
79
|
+
export const BookingStripeStatusEnum = {
|
|
80
|
+
Pending: 'pending',
|
|
81
|
+
Paid: 'paid',
|
|
82
|
+
Failed: 'failed',
|
|
83
|
+
Refunded: 'refunded',
|
|
84
|
+
Canceled: 'canceled'
|
|
85
|
+
} as const;
|
|
86
|
+
export type BookingStripeStatusEnum = typeof BookingStripeStatusEnum[keyof typeof BookingStripeStatusEnum];
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Check if a given object implements the Booking interface.
|
|
91
|
+
*/
|
|
92
|
+
export function instanceOfBooking(value: object): value is Booking {
|
|
93
|
+
if (!('userId' in value) || value['userId'] === undefined) return false;
|
|
94
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
95
|
+
if (!('stripeStatus' in value) || value['stripeStatus'] === undefined) return false;
|
|
96
|
+
if (!('stripePaymentIntentId' in value) || value['stripePaymentIntentId'] === undefined) return false;
|
|
97
|
+
if (!('totalPrice' in value) || value['totalPrice'] === undefined) return false;
|
|
98
|
+
if (!('slotId' in value) || value['slotId'] === undefined) return false;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function BookingFromJSON(json: any): Booking {
|
|
103
|
+
return BookingFromJSONTyped(json, false);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function BookingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Booking {
|
|
107
|
+
if (json == null) {
|
|
108
|
+
return json;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
|
|
112
|
+
'userId': json['userId'],
|
|
113
|
+
'playersIds': json['playersIds'] == null ? undefined : json['playersIds'],
|
|
114
|
+
'status': json['status'],
|
|
115
|
+
'stripeStatus': json['stripeStatus'],
|
|
116
|
+
'stripePaymentIntentId': json['stripePaymentIntentId'],
|
|
117
|
+
'totalPrice': json['totalPrice'],
|
|
118
|
+
'slotId': json['slotId'],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function BookingToJSON(json: any): Booking {
|
|
123
|
+
return BookingToJSONTyped(json, false);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function BookingToJSONTyped(value?: Booking | null, ignoreDiscriminator: boolean = false): any {
|
|
127
|
+
if (value == null) {
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
|
|
133
|
+
'userId': value['userId'],
|
|
134
|
+
'playersIds': value['playersIds'],
|
|
135
|
+
'status': value['status'],
|
|
136
|
+
'stripeStatus': value['stripeStatus'],
|
|
137
|
+
'stripePaymentIntentId': value['stripePaymentIntentId'],
|
|
138
|
+
'totalPrice': value['totalPrice'],
|
|
139
|
+
'slotId': value['slotId'],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Court
|
|
20
|
+
*/
|
|
21
|
+
export interface Court {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof Court
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Court
|
|
32
|
+
*/
|
|
33
|
+
status: CourtStatusEnum;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof Court
|
|
38
|
+
*/
|
|
39
|
+
comments?: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof Court
|
|
44
|
+
*/
|
|
45
|
+
pricePerSlot: number;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof Court
|
|
50
|
+
*/
|
|
51
|
+
slotDefaultDuration: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof Court
|
|
56
|
+
*/
|
|
57
|
+
startTimeInTheDayInMinutes: number;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof Court
|
|
62
|
+
*/
|
|
63
|
+
endTimeInTheDayInMinutes: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @export
|
|
69
|
+
*/
|
|
70
|
+
export const CourtStatusEnum = {
|
|
71
|
+
Available: 'available',
|
|
72
|
+
Unavailable: 'unavailable'
|
|
73
|
+
} as const;
|
|
74
|
+
export type CourtStatusEnum = typeof CourtStatusEnum[keyof typeof CourtStatusEnum];
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check if a given object implements the Court interface.
|
|
79
|
+
*/
|
|
80
|
+
export function instanceOfCourt(value: object): value is Court {
|
|
81
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
82
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
83
|
+
if (!('pricePerSlot' in value) || value['pricePerSlot'] === undefined) return false;
|
|
84
|
+
if (!('slotDefaultDuration' in value) || value['slotDefaultDuration'] === undefined) return false;
|
|
85
|
+
if (!('startTimeInTheDayInMinutes' in value) || value['startTimeInTheDayInMinutes'] === undefined) return false;
|
|
86
|
+
if (!('endTimeInTheDayInMinutes' in value) || value['endTimeInTheDayInMinutes'] === undefined) return false;
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function CourtFromJSON(json: any): Court {
|
|
91
|
+
return CourtFromJSONTyped(json, false);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function CourtFromJSONTyped(json: any, ignoreDiscriminator: boolean): Court {
|
|
95
|
+
if (json == null) {
|
|
96
|
+
return json;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
|
|
100
|
+
'name': json['name'],
|
|
101
|
+
'status': json['status'],
|
|
102
|
+
'comments': json['comments'] == null ? undefined : json['comments'],
|
|
103
|
+
'pricePerSlot': json['pricePerSlot'],
|
|
104
|
+
'slotDefaultDuration': json['slotDefaultDuration'],
|
|
105
|
+
'startTimeInTheDayInMinutes': json['startTimeInTheDayInMinutes'],
|
|
106
|
+
'endTimeInTheDayInMinutes': json['endTimeInTheDayInMinutes'],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function CourtToJSON(json: any): Court {
|
|
111
|
+
return CourtToJSONTyped(json, false);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function CourtToJSONTyped(value?: Court | null, ignoreDiscriminator: boolean = false): any {
|
|
115
|
+
if (value == null) {
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
|
|
121
|
+
'name': value['name'],
|
|
122
|
+
'status': value['status'],
|
|
123
|
+
'comments': value['comments'],
|
|
124
|
+
'pricePerSlot': value['pricePerSlot'],
|
|
125
|
+
'slotDefaultDuration': value['slotDefaultDuration'],
|
|
126
|
+
'startTimeInTheDayInMinutes': value['startTimeInTheDayInMinutes'],
|
|
127
|
+
'endTimeInTheDayInMinutes': value['endTimeInTheDayInMinutes'],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Slot
|
|
20
|
+
*/
|
|
21
|
+
export interface Slot {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {Date}
|
|
25
|
+
* @memberof Slot
|
|
26
|
+
*/
|
|
27
|
+
startDate: Date;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {Date}
|
|
31
|
+
* @memberof Slot
|
|
32
|
+
*/
|
|
33
|
+
endDate: Date;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof Slot
|
|
38
|
+
*/
|
|
39
|
+
courtId: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if a given object implements the Slot interface.
|
|
44
|
+
*/
|
|
45
|
+
export function instanceOfSlot(value: object): value is Slot {
|
|
46
|
+
if (!('startDate' in value) || value['startDate'] === undefined) return false;
|
|
47
|
+
if (!('endDate' in value) || value['endDate'] === undefined) return false;
|
|
48
|
+
if (!('courtId' in value) || value['courtId'] === undefined) return false;
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function SlotFromJSON(json: any): Slot {
|
|
53
|
+
return SlotFromJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function SlotFromJSONTyped(json: any, ignoreDiscriminator: boolean): Slot {
|
|
57
|
+
if (json == null) {
|
|
58
|
+
return json;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
|
|
62
|
+
'startDate': (new Date(json['startDate'])),
|
|
63
|
+
'endDate': (new Date(json['endDate'])),
|
|
64
|
+
'courtId': json['courtId'],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function SlotToJSON(json: any): Slot {
|
|
69
|
+
return SlotToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function SlotToJSONTyped(value?: Slot | null, ignoreDiscriminator: boolean = false): any {
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'startDate': ((value['startDate']).toISOString()),
|
|
80
|
+
'endDate': ((value['endDate']).toISOString()),
|
|
81
|
+
'courtId': value['courtId'],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pickle Ball API
|
|
5
|
+
* API for managing pickle ball games and players
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface SlotException
|
|
20
|
+
*/
|
|
21
|
+
export interface SlotException {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {Date}
|
|
25
|
+
* @memberof SlotException
|
|
26
|
+
*/
|
|
27
|
+
startDate: Date;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {Date}
|
|
31
|
+
* @memberof SlotException
|
|
32
|
+
*/
|
|
33
|
+
endDate: Date;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof SlotException
|
|
38
|
+
*/
|
|
39
|
+
courtId: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof SlotException
|
|
44
|
+
*/
|
|
45
|
+
reason: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the SlotException interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfSlotException(value: object): value is SlotException {
|
|
52
|
+
if (!('startDate' in value) || value['startDate'] === undefined) return false;
|
|
53
|
+
if (!('endDate' in value) || value['endDate'] === undefined) return false;
|
|
54
|
+
if (!('courtId' in value) || value['courtId'] === undefined) return false;
|
|
55
|
+
if (!('reason' in value) || value['reason'] === undefined) return false;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function SlotExceptionFromJSON(json: any): SlotException {
|
|
60
|
+
return SlotExceptionFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function SlotExceptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): SlotException {
|
|
64
|
+
if (json == null) {
|
|
65
|
+
return json;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'startDate': (new Date(json['startDate'])),
|
|
70
|
+
'endDate': (new Date(json['endDate'])),
|
|
71
|
+
'courtId': json['courtId'],
|
|
72
|
+
'reason': json['reason'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function SlotExceptionToJSON(json: any): SlotException {
|
|
77
|
+
return SlotExceptionToJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function SlotExceptionToJSONTyped(value?: SlotException | null, ignoreDiscriminator: boolean = false): any {
|
|
81
|
+
if (value == null) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'startDate': ((value['startDate']).toISOString()),
|
|
88
|
+
'endDate': ((value['endDate']).toISOString()),
|
|
89
|
+
'courtId': value['courtId'],
|
|
90
|
+
'reason': value['reason'],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|