Skip to content

Commit 394e6f2

Browse files
committed
0.2.1 - Updated
1 parent 0126cfb commit 394e6f2

File tree

5 files changed

+19
-28
lines changed

5 files changed

+19
-28
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.2.0",
3+
"version": "0.2.1",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

src/models/CreatePost.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface CreatePost {
2424
* @type {string}
2525
* @memberof CreatePost
2626
*/
27-
originalPostId: string;
27+
originalPostId?: string;
2828
/**
2929
*
3030
* @type {string}
@@ -38,7 +38,6 @@ export interface CreatePost {
3838
*/
3939
export function instanceOfCreatePost(value: object): boolean {
4040
let isInstance = true;
41-
isInstance = isInstance && "originalPostId" in value;
4241
isInstance = isInstance && "text" in value;
4342

4443
return isInstance;
@@ -54,7 +53,7 @@ export function CreatePostFromJSONTyped(json: any, ignoreDiscriminator: boolean)
5453
}
5554
return {
5655

57-
'originalPostId': json['original_post_id'],
56+
'originalPostId': !exists(json, 'original_post_id') ? undefined : json['original_post_id'],
5857
'text': json['text'],
5958
};
6059
}

src/models/Post.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ export interface Post {
3737
* @type {string}
3838
* @memberof Post
3939
*/
40-
originalPostId: string;
40+
originalPostId?: string;
4141
/**
4242
* リプライ先ID|リプライでない場合は含まれません。
4343
* @type {string}
4444
* @memberof Post
4545
*/
46-
replyToPostId: string;
46+
replyToPostId?: string;
4747
/**
4848
*
4949
* @type {User}
@@ -55,7 +55,7 @@ export interface Post {
5555
* @type {string}
5656
* @memberof Post
5757
*/
58-
text: string;
58+
text?: string;
5959
/**
6060
*
6161
* @type {Date}
@@ -70,10 +70,7 @@ export interface Post {
7070
export function instanceOfPost(value: object): boolean {
7171
let isInstance = true;
7272
isInstance = isInstance && "id" in value;
73-
isInstance = isInstance && "originalPostId" in value;
74-
isInstance = isInstance && "replyToPostId" in value;
7573
isInstance = isInstance && "author" in value;
76-
isInstance = isInstance && "text" in value;
7774
isInstance = isInstance && "postedAt" in value;
7875

7976
return isInstance;
@@ -90,10 +87,10 @@ export function PostFromJSONTyped(json: any, ignoreDiscriminator: boolean): Post
9087
return {
9188

9289
'id': json['id'],
93-
'originalPostId': json['original_post_id'],
94-
'replyToPostId': json['reply_to_post_id'],
90+
'originalPostId': !exists(json, 'original_post_id') ? undefined : json['original_post_id'],
91+
'replyToPostId': !exists(json, 'reply_to_post_id') ? undefined : json['reply_to_post_id'],
9592
'author': UserFromJSON(json['author']),
96-
'text': json['text'],
93+
'text': !exists(json, 'text') ? undefined : json['text'],
9794
'postedAt': (new Date(json['posted_at'])),
9895
};
9996
}

src/models/PostResponse.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ export interface PostResponse {
4343
* @type {string}
4444
* @memberof PostResponse
4545
*/
46-
originalPostId: string;
46+
originalPostId?: string;
4747
/**
4848
* リプライ先ID|リプライでない場合は含まれません。
4949
* @type {string}
5050
* @memberof PostResponse
5151
*/
52-
replyToPostId: string;
52+
replyToPostId?: string;
5353
/**
5454
*
5555
* @type {User}
@@ -61,7 +61,7 @@ export interface PostResponse {
6161
* @type {string}
6262
* @memberof PostResponse
6363
*/
64-
text: string;
64+
text?: string;
6565
/**
6666
*
6767
* @type {Date}
@@ -73,7 +73,7 @@ export interface PostResponse {
7373
* @type {Post}
7474
* @memberof PostResponse
7575
*/
76-
originalPost: Post;
76+
originalPost?: Post;
7777
/**
7878
* リポスト済み
7979
* @type {boolean}
@@ -106,12 +106,8 @@ export interface PostResponse {
106106
export function instanceOfPostResponse(value: object): boolean {
107107
let isInstance = true;
108108
isInstance = isInstance && "id" in value;
109-
isInstance = isInstance && "originalPostId" in value;
110-
isInstance = isInstance && "replyToPostId" in value;
111109
isInstance = isInstance && "author" in value;
112-
isInstance = isInstance && "text" in value;
113110
isInstance = isInstance && "postedAt" in value;
114-
isInstance = isInstance && "originalPost" in value;
115111
isInstance = isInstance && "reposted" in value;
116112
isInstance = isInstance && "repostCount" in value;
117113
isInstance = isInstance && "favorited" in value;
@@ -131,12 +127,12 @@ export function PostResponseFromJSONTyped(json: any, ignoreDiscriminator: boolea
131127
return {
132128

133129
'id': json['id'],
134-
'originalPostId': json['original_post_id'],
135-
'replyToPostId': json['reply_to_post_id'],
130+
'originalPostId': !exists(json, 'original_post_id') ? undefined : json['original_post_id'],
131+
'replyToPostId': !exists(json, 'reply_to_post_id') ? undefined : json['reply_to_post_id'],
136132
'author': UserFromJSON(json['author']),
137-
'text': json['text'],
133+
'text': !exists(json, 'text') ? undefined : json['text'],
138134
'postedAt': (new Date(json['posted_at'])),
139-
'originalPost': PostFromJSON(json['original_post']),
135+
'originalPost': !exists(json, 'original_post') ? undefined : PostFromJSON(json['original_post']),
140136
'reposted': json['reposted'],
141137
'repostCount': json['repost_count'],
142138
'favorited': json['favorited'],

src/models/UserRequest.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface UserRequest {
4848
* @type {string}
4949
* @memberof UserRequest
5050
*/
51-
invitationCode: string;
51+
invitationCode?: string;
5252
}
5353

5454
/**
@@ -60,7 +60,6 @@ export function instanceOfUserRequest(value: object): boolean {
6060
isInstance = isInstance && "code" in value;
6161
isInstance = isInstance && "username" in value;
6262
isInstance = isInstance && "password" in value;
63-
isInstance = isInstance && "invitationCode" in value;
6463

6564
return isInstance;
6665
}
@@ -79,7 +78,7 @@ export function UserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean
7978
'code': json['code'],
8079
'username': json['username'],
8180
'password': json['password'],
82-
'invitationCode': json['invitation_code'],
81+
'invitationCode': !exists(json, 'invitation_code') ? undefined : json['invitation_code'],
8382
};
8483
}
8584

0 commit comments

Comments
 (0)