Skip to content

Commit 9a78722

Browse files
committed
feat: add DNamespaceRoleView class for managing NamespaceRole data
1 parent 82f019f commit 9a78722

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import {
2+
Maybe, Namespace,
3+
NamespaceProjectConnection,
4+
NamespaceRole,
5+
NamespaceRoleAbility, Scalars
6+
} from "@code0-tech/sagittarius-graphql-types";
7+
8+
export class DNamespaceRoleView {
9+
10+
/** The abilities the role is granted */
11+
private readonly _abilities?: Maybe<Array<NamespaceRoleAbility>>;
12+
/** The projects this role is assigned to */
13+
private readonly _assignedProjects?: Maybe<NamespaceProjectConnection>;
14+
/** Time when this NamespaceRole was created */
15+
private readonly _createdAt?: Maybe<Scalars['Time']['output']>;
16+
/** Global ID of this NamespaceRole */
17+
private readonly _id?: Maybe<Scalars['NamespaceRoleID']['output']>;
18+
/** The name of this role */
19+
private readonly _name?: Maybe<Scalars['String']['output']>;
20+
/** The namespace where this role belongs to */
21+
private readonly _namespace?: Maybe<Namespace>;
22+
/** Time when this NamespaceRole was last updated */
23+
private readonly _updatedAt?: Maybe<Scalars['Time']['output']>;
24+
25+
constructor(payload: NamespaceRole) {
26+
this._abilities = payload.abilities;
27+
this._assignedProjects = payload.assignedProjects;
28+
this._createdAt = payload.createdAt;
29+
this._id = payload.id;
30+
this._name = payload.name;
31+
this._namespace = payload.namespace;
32+
this._updatedAt = payload.updatedAt;
33+
}
34+
35+
36+
get abilities(): Maybe<Array<NamespaceRoleAbility>> | undefined {
37+
return this._abilities;
38+
}
39+
40+
get assignedProjects(): Maybe<NamespaceProjectConnection> | undefined {
41+
return this._assignedProjects;
42+
}
43+
44+
get createdAt(): Maybe<Scalars["Time"]["output"]> | undefined {
45+
return this._createdAt;
46+
}
47+
48+
get id(): Maybe<Scalars["NamespaceRoleID"]["output"]> | undefined {
49+
return this._id;
50+
}
51+
52+
get name(): Maybe<Scalars["String"]["output"]> | undefined {
53+
return this._name;
54+
}
55+
56+
get namespace(): Maybe<Namespace> | undefined {
57+
return this._namespace;
58+
}
59+
60+
get updatedAt(): Maybe<Scalars["Time"]["output"]> | undefined {
61+
return this._updatedAt;
62+
}
63+
}

0 commit comments

Comments
 (0)