Skip to content

Commit fe91a38

Browse files
committed
0.3.2 - Updated
1 parent 90462ce commit fe91a38

File tree

4 files changed

+165
-7
lines changed

4 files changed

+165
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cuculus/cuculus-api",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

src/apis/UsersApi.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ import * as runtime from '../runtime';
1717
import type {
1818
User,
1919
UserPost,
20+
UserWithFollows,
2021
} from '../models/index';
2122
import {
2223
UserFromJSON,
2324
UserToJSON,
2425
UserPostFromJSON,
2526
UserPostToJSON,
27+
UserWithFollowsFromJSON,
28+
UserWithFollowsToJSON,
2629
} from '../models/index';
2730

2831
export interface CreateFollowRequest {
@@ -173,7 +176,7 @@ export class UsersApi extends runtime.BaseAPI {
173176
/**
174177
* ユーザーIDからユーザーを取得する
175178
*/
176-
async getUserByIdRaw(requestParameters: GetUserByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<User>> {
179+
async getUserByIdRaw(requestParameters: GetUserByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserWithFollows>> {
177180
if (requestParameters.id === null || requestParameters.id === undefined) {
178181
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling getUserById.');
179182
}
@@ -189,21 +192,21 @@ export class UsersApi extends runtime.BaseAPI {
189192
query: queryParameters,
190193
}, initOverrides);
191194

192-
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
195+
return new runtime.JSONApiResponse(response, (jsonValue) => UserWithFollowsFromJSON(jsonValue));
193196
}
194197

195198
/**
196199
* ユーザーIDからユーザーを取得する
197200
*/
198-
async getUserById(requestParameters: GetUserByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<User> {
201+
async getUserById(requestParameters: GetUserByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserWithFollows> {
199202
const response = await this.getUserByIdRaw(requestParameters, initOverrides);
200203
return await response.value();
201204
}
202205

203206
/**
204207
* ユーザー名からユーザーを取得する
205208
*/
206-
async getUserByUsernameRaw(requestParameters: GetUserByUsernameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<User>> {
209+
async getUserByUsernameRaw(requestParameters: GetUserByUsernameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserWithFollows>> {
207210
if (requestParameters.username === null || requestParameters.username === undefined) {
208211
throw new runtime.RequiredError('username','Required parameter requestParameters.username was null or undefined when calling getUserByUsername.');
209212
}
@@ -219,13 +222,13 @@ export class UsersApi extends runtime.BaseAPI {
219222
query: queryParameters,
220223
}, initOverrides);
221224

222-
return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue));
225+
return new runtime.JSONApiResponse(response, (jsonValue) => UserWithFollowsFromJSON(jsonValue));
223226
}
224227

225228
/**
226229
* ユーザー名からユーザーを取得する
227230
*/
228-
async getUserByUsername(requestParameters: GetUserByUsernameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<User> {
231+
async getUserByUsername(requestParameters: GetUserByUsernameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserWithFollows> {
229232
const response = await this.getUserByUsernameRaw(requestParameters, initOverrides);
230233
return await response.value();
231234
}

src/models/UserWithFollows.ts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
/**
4+
* Cuculus API
5+
* The Cuculus API description
6+
*
7+
* The version of the OpenAPI document: 0.0.1
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 { exists, mapValues } from '../runtime';
16+
/**
17+
*
18+
* @export
19+
* @interface UserWithFollows
20+
*/
21+
export interface UserWithFollows {
22+
/**
23+
*
24+
* @type {number}
25+
* @memberof UserWithFollows
26+
*/
27+
id: number;
28+
/**
29+
*
30+
* @type {string}
31+
* @memberof UserWithFollows
32+
*/
33+
name: string;
34+
/**
35+
*
36+
* @type {string}
37+
* @memberof UserWithFollows
38+
*/
39+
username: string;
40+
/**
41+
*
42+
* @type {Date}
43+
* @memberof UserWithFollows
44+
*/
45+
createdAt: Date;
46+
/**
47+
*
48+
* @type {string}
49+
* @memberof UserWithFollows
50+
*/
51+
description: string;
52+
/**
53+
*
54+
* @type {string}
55+
* @memberof UserWithFollows
56+
*/
57+
profileImageUrl: string;
58+
/**
59+
*
60+
* @type {boolean}
61+
* @memberof UserWithFollows
62+
*/
63+
_protected: boolean;
64+
/**
65+
*
66+
* @type {string}
67+
* @memberof UserWithFollows
68+
*/
69+
url: string;
70+
/**
71+
*
72+
* @type {boolean}
73+
* @memberof UserWithFollows
74+
*/
75+
verified: boolean;
76+
/**
77+
* フォロワー数
78+
* @type {number}
79+
* @memberof UserWithFollows
80+
*/
81+
followersCount?: number;
82+
/**
83+
* フォロー数
84+
* @type {number}
85+
* @memberof UserWithFollows
86+
*/
87+
followingCount?: number;
88+
}
89+
90+
/**
91+
* Check if a given object implements the UserWithFollows interface.
92+
*/
93+
export function instanceOfUserWithFollows(value: object): boolean {
94+
let isInstance = true;
95+
isInstance = isInstance && "id" in value;
96+
isInstance = isInstance && "name" in value;
97+
isInstance = isInstance && "username" in value;
98+
isInstance = isInstance && "createdAt" in value;
99+
isInstance = isInstance && "description" in value;
100+
isInstance = isInstance && "profileImageUrl" in value;
101+
isInstance = isInstance && "_protected" in value;
102+
isInstance = isInstance && "url" in value;
103+
isInstance = isInstance && "verified" in value;
104+
105+
return isInstance;
106+
}
107+
108+
export function UserWithFollowsFromJSON(json: any): UserWithFollows {
109+
return UserWithFollowsFromJSONTyped(json, false);
110+
}
111+
112+
export function UserWithFollowsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserWithFollows {
113+
if ((json === undefined) || (json === null)) {
114+
return json;
115+
}
116+
return {
117+
118+
'id': json['id'],
119+
'name': json['name'],
120+
'username': json['username'],
121+
'createdAt': (new Date(json['created_at'])),
122+
'description': json['description'],
123+
'profileImageUrl': json['profile_image_url'],
124+
'_protected': json['protected'],
125+
'url': json['url'],
126+
'verified': json['verified'],
127+
'followersCount': !exists(json, 'followers_count') ? undefined : json['followers_count'],
128+
'followingCount': !exists(json, 'following_count') ? undefined : json['following_count'],
129+
};
130+
}
131+
132+
export function UserWithFollowsToJSON(value?: UserWithFollows | null): any {
133+
if (value === undefined) {
134+
return undefined;
135+
}
136+
if (value === null) {
137+
return null;
138+
}
139+
return {
140+
141+
'id': value.id,
142+
'name': value.name,
143+
'username': value.username,
144+
'created_at': (value.createdAt.toISOString()),
145+
'description': value.description,
146+
'profile_image_url': value.profileImageUrl,
147+
'protected': value._protected,
148+
'url': value.url,
149+
'verified': value.verified,
150+
'followers_count': value.followersCount,
151+
'following_count': value.followingCount,
152+
};
153+
}
154+

src/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export * from './User';
1616
export * from './UserInvitations';
1717
export * from './UserPost';
1818
export * from './UserRequest';
19+
export * from './UserWithFollows';
1920
export * from './VerifyCodeRequest';

0 commit comments

Comments
 (0)