-
Notifications
You must be signed in to change notification settings - Fork 2
/
externalref.go
67 lines (57 loc) · 1.43 KB
/
externalref.go
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
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
)
// ExternalRefSource - The source of the external reference.
type ExternalRefSource string
const (
ExternalRefSourceUnspecified ExternalRefSource = "UNSPECIFIED"
ExternalRefSourceJira ExternalRefSource = "JIRA"
)
func (e ExternalRefSource) ToPointer() *ExternalRefSource {
return &e
}
func (e *ExternalRefSource) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "UNSPECIFIED":
fallthrough
case "JIRA":
*e = ExternalRefSource(v)
return nil
default:
return fmt.Errorf("invalid value for ExternalRefSource: %v", v)
}
}
// ExternalRef - A reference to an external source. This value is unused currently, but may be brought back.
type ExternalRef struct {
// The source of the external reference.
ExternalRefSource *ExternalRefSource `json:"externalRefSource,omitempty"`
// The name of the external reference.
Name *string `json:"name,omitempty"`
// The URL to the external reference.
URL *string `json:"url,omitempty"`
}
func (o *ExternalRef) GetExternalRefSource() *ExternalRefSource {
if o == nil {
return nil
}
return o.ExternalRefSource
}
func (o *ExternalRef) GetName() *string {
if o == nil {
return nil
}
return o.Name
}
func (o *ExternalRef) GetURL() *string {
if o == nil {
return nil
}
return o.URL
}