-
Notifications
You must be signed in to change notification settings - Fork 14
/
sourceintercom.go
89 lines (75 loc) · 2.02 KB
/
sourceintercom.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
"github.com/airbytehq/terraform-provider-airbyte/internal/sdk/pkg/utils"
"time"
)
type Intercom string
const (
IntercomIntercom Intercom = "intercom"
)
func (e Intercom) ToPointer() *Intercom {
return &e
}
func (e *Intercom) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "intercom":
*e = Intercom(v)
return nil
default:
return fmt.Errorf("invalid value for Intercom: %v", v)
}
}
type SourceIntercom struct {
// Access token for making authenticated requests. See the <a href="https://developers.intercom.com/building-apps/docs/authentication-types#how-to-get-your-access-token">Intercom docs</a> for more information.
AccessToken string `json:"access_token"`
// Client Id for your Intercom application.
ClientID *string `json:"client_id,omitempty"`
// Client Secret for your Intercom application.
ClientSecret *string `json:"client_secret,omitempty"`
sourceType Intercom `const:"intercom" json:"sourceType"`
// UTC date and time in the format 2017-01-25T00:00:00Z. Any data before this date will not be replicated.
StartDate time.Time `json:"start_date"`
}
func (s SourceIntercom) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(s, "", false)
}
func (s *SourceIntercom) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &s, "", false, false); err != nil {
return err
}
return nil
}
func (o *SourceIntercom) GetAccessToken() string {
if o == nil {
return ""
}
return o.AccessToken
}
func (o *SourceIntercom) GetClientID() *string {
if o == nil {
return nil
}
return o.ClientID
}
func (o *SourceIntercom) GetClientSecret() *string {
if o == nil {
return nil
}
return o.ClientSecret
}
func (o *SourceIntercom) GetSourceType() Intercom {
return IntercomIntercom
}
func (o *SourceIntercom) GetStartDate() time.Time {
if o == nil {
return time.Time{}
}
return o.StartDate
}