-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathGitHubOwner.ps1
More file actions
65 lines (52 loc) · 1.93 KB
/
Copy pathGitHubOwner.ps1
File metadata and controls
65 lines (52 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
class GitHubOwner : GitHubNode {
# The username/login of the owner.
# Example: octocat
[string] $Name
# The name of the organization.
# Example: github
[string] $DisplayName
# The avatar URL of the owner.
# Example: https://github.com/images/error/octocat_happy.gif
[string] $AvatarUrl
# The URL to the owner's profile.
# Example: https://github.com/octocat
[string] $Url
# The type of the owner: 'User', 'Organization' or 'Enterprise'.
# Example: User
[string] $Type
# The location of the account.
# Example: San Francisco
[string] $Location
# The description of the organization.
# Example: A great organization
[string] $Description
# The website URL of the account.
# Example: https://github.com/blog
[string] $Website
# The creation date of the account.
# Example: 2008-01-14T04:33:35Z
[System.Nullable[datetime]] $CreatedAt
# The last update date of the account.
# Example: 2008-01-14T04:33:35Z
[System.Nullable[datetime]] $UpdatedAt
GitHubOwner() {}
GitHubOwner([PSCustomObject]$Object) {
# From GitHubNode
$this.ID = $Object.databaseId ?? $Object.id
$this.NodeID = $Object.node_id ?? $Object.NodeID ?? $Object.id
# From GitHubOwner
$this.Name = $Object.slug ?? $Object.login ?? $Object.name
$this.DisplayName = $Object.DisplayName ?? $Object.name
$this.AvatarUrl = $Object.avatar_url ?? $Object.AvatarUrl
$this.Url = $Object.html_url ?? $Object.url
$this.Type = $Object.type
$this.Location = $Object.location
$this.Description = $Object.description ?? $Object.bio
$this.Website = $Object.websiteUrl ?? $Object.blog ?? $Object.Website
$this.CreatedAt = $Object.created_at ?? $Object.createdAt
$this.UpdatedAt = $Object.updated_at ?? $Object.updatedAt
}
[string] ToString() {
return $this.Name
}
}