-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebsites.go
More file actions
72 lines (62 loc) · 1.64 KB
/
websites.go
File metadata and controls
72 lines (62 loc) · 1.64 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
66
67
68
69
70
71
72
// This file was auto-generated by Fern from our API Definition.
package livesession
import (
json "encoding/json"
fmt "fmt"
internal "go.livesession.io/livesession-go/internal"
)
type WebsiteCreate struct {
// Domain name or hostname of the website to track
Host string `json:"host" url:"-"`
// Optional description of the website for organization purposes
Description *string `json:"description,omitempty" url:"-"`
}
type Website struct {
// Unique identifier for the website
WebsiteId *string `json:"website_id,omitempty" url:"website_id,omitempty"`
// Domain name or hostname of the website (e.g., example.com)
Host *string `json:"host,omitempty" url:"host,omitempty"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (w *Website) GetWebsiteId() *string {
if w == nil {
return nil
}
return w.WebsiteId
}
func (w *Website) GetHost() *string {
if w == nil {
return nil
}
return w.Host
}
func (w *Website) GetExtraProperties() map[string]interface{} {
return w.extraProperties
}
func (w *Website) UnmarshalJSON(data []byte) error {
type unmarshaler Website
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*w = Website(value)
extraProperties, err := internal.ExtractExtraProperties(data, *w)
if err != nil {
return err
}
w.extraProperties = extraProperties
w.rawJSON = json.RawMessage(data)
return nil
}
func (w *Website) String() string {
if len(w.rawJSON) > 0 {
if value, err := internal.StringifyJSON(w.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(w); err == nil {
return value
}
return fmt.Sprintf("%#v", w)
}