Skip to content

Commit ee72563

Browse files
authored
add telephony obs interface (#1236)
Signed-off-by: shishir gowda <[email protected]>
1 parent 1c8cbd7 commit ee72563

File tree

3 files changed

+218
-0
lines changed

3 files changed

+218
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Code generated; DO NOT EDIT.
2+
3+
package telephonyobs
4+
5+
import (
6+
"time"
7+
)
8+
9+
const Version_6TP95J0 = true
10+
11+
type KeyResolver interface {
12+
Resolve(string)
13+
Reset()
14+
}
15+
16+
type Reporter interface {
17+
WithProject(id string) ProjectReporter
18+
WithDeferredProject() (ProjectReporter, KeyResolver)
19+
}
20+
21+
type ProjectTx interface{}
22+
23+
type ProjectReporter interface {
24+
RegisterFunc(func(ts time.Time, tx ProjectTx) bool)
25+
Tx(func(tx ProjectTx))
26+
TxAt(time.Time, func(tx ProjectTx))
27+
WithCarrier(id string) CarrierReporter
28+
WithDeferredCarrier() (CarrierReporter, KeyResolver)
29+
ProjectTx
30+
}
31+
32+
type CarrierTx interface{}
33+
34+
type CarrierReporter interface {
35+
RegisterFunc(func(ts time.Time, tx CarrierTx) bool)
36+
Tx(func(tx CarrierTx))
37+
TxAt(time.Time, func(tx CarrierTx))
38+
WithCountry(callCountryCode string) CountryReporter
39+
WithDeferredCountry() (CountryReporter, KeyResolver)
40+
CarrierTx
41+
}
42+
43+
type CountryTx interface{}
44+
45+
type CountryReporter interface {
46+
RegisterFunc(func(ts time.Time, tx CountryTx) bool)
47+
Tx(func(tx CountryTx))
48+
TxAt(time.Time, func(tx CountryTx))
49+
WithCall(id string) CallReporter
50+
WithDeferredCall() (CallReporter, KeyResolver)
51+
CountryTx
52+
}
53+
54+
type CallTx interface {
55+
ReportDirection(v DirectionType)
56+
ReportNumberType(v NumberType)
57+
ReportStatus(v CallStatus)
58+
ReportTrunkType(v TrunkType)
59+
ReportCountryCode(v string)
60+
ReportPhoneNumber(v string)
61+
ReportDuration(v uint32)
62+
ReportDurationMinutes(v uint16)
63+
ReportStartTime(v time.Time)
64+
ReportEndTime(v time.Time)
65+
}
66+
67+
type CallReporter interface {
68+
RegisterFunc(func(ts time.Time, tx CallTx) bool)
69+
Tx(func(tx CallTx))
70+
TxAt(time.Time, func(tx CallTx))
71+
CallTx
72+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Code generated; DO NOT EDIT.
2+
3+
package telephonyobs
4+
5+
import (
6+
"time"
7+
)
8+
9+
var (
10+
_ Reporter = (*noopReporter)(nil)
11+
_ ProjectReporter = (*noopProjectReporter)(nil)
12+
_ CarrierReporter = (*noopCarrierReporter)(nil)
13+
_ CountryReporter = (*noopCountryReporter)(nil)
14+
_ CallReporter = (*noopCallReporter)(nil)
15+
)
16+
17+
type noopKeyResolver struct{}
18+
19+
func (noopKeyResolver) Resolve(string) {}
20+
func (noopKeyResolver) Reset() {}
21+
22+
type noopReporter struct{}
23+
24+
func NewNoopReporter() Reporter {
25+
return &noopReporter{}
26+
}
27+
28+
func (r *noopReporter) WithProject(id string) ProjectReporter {
29+
return &noopProjectReporter{}
30+
}
31+
32+
func (r *noopReporter) WithDeferredProject() (ProjectReporter, KeyResolver) {
33+
return &noopProjectReporter{}, noopKeyResolver{}
34+
}
35+
36+
type noopProjectReporter struct{}
37+
38+
func NewNoopProjectReporter() ProjectReporter {
39+
return &noopProjectReporter{}
40+
}
41+
42+
func (r *noopProjectReporter) RegisterFunc(f func(ts time.Time, tx ProjectTx) bool) {}
43+
func (r *noopProjectReporter) Tx(f func(ProjectTx)) {}
44+
func (r *noopProjectReporter) TxAt(ts time.Time, f func(ProjectTx)) {}
45+
func (r *noopProjectReporter) WithCarrier(id string) CarrierReporter {
46+
return &noopCarrierReporter{}
47+
}
48+
func (r *noopProjectReporter) WithDeferredCarrier() (CarrierReporter, KeyResolver) {
49+
return &noopCarrierReporter{}, noopKeyResolver{}
50+
}
51+
52+
type noopCarrierReporter struct{}
53+
54+
func NewNoopCarrierReporter() CarrierReporter {
55+
return &noopCarrierReporter{}
56+
}
57+
58+
func (r *noopCarrierReporter) RegisterFunc(f func(ts time.Time, tx CarrierTx) bool) {}
59+
func (r *noopCarrierReporter) Tx(f func(CarrierTx)) {}
60+
func (r *noopCarrierReporter) TxAt(ts time.Time, f func(CarrierTx)) {}
61+
func (r *noopCarrierReporter) WithCountry(callCountryCode string) CountryReporter {
62+
return &noopCountryReporter{}
63+
}
64+
func (r *noopCarrierReporter) WithDeferredCountry() (CountryReporter, KeyResolver) {
65+
return &noopCountryReporter{}, noopKeyResolver{}
66+
}
67+
68+
type noopCountryReporter struct{}
69+
70+
func NewNoopCountryReporter() CountryReporter {
71+
return &noopCountryReporter{}
72+
}
73+
74+
func (r *noopCountryReporter) RegisterFunc(f func(ts time.Time, tx CountryTx) bool) {}
75+
func (r *noopCountryReporter) Tx(f func(CountryTx)) {}
76+
func (r *noopCountryReporter) TxAt(ts time.Time, f func(CountryTx)) {}
77+
func (r *noopCountryReporter) WithCall(id string) CallReporter {
78+
return &noopCallReporter{}
79+
}
80+
func (r *noopCountryReporter) WithDeferredCall() (CallReporter, KeyResolver) {
81+
return &noopCallReporter{}, noopKeyResolver{}
82+
}
83+
84+
type noopCallReporter struct{}
85+
86+
func NewNoopCallReporter() CallReporter {
87+
return &noopCallReporter{}
88+
}
89+
90+
func (r *noopCallReporter) RegisterFunc(f func(ts time.Time, tx CallTx) bool) {}
91+
func (r *noopCallReporter) Tx(f func(CallTx)) {}
92+
func (r *noopCallReporter) TxAt(ts time.Time, f func(CallTx)) {}
93+
func (r *noopCallReporter) ReportDirection(v DirectionType) {}
94+
func (r *noopCallReporter) ReportNumberType(v NumberType) {}
95+
func (r *noopCallReporter) ReportStatus(v CallStatus) {}
96+
func (r *noopCallReporter) ReportTrunkType(v TrunkType) {}
97+
func (r *noopCallReporter) ReportCountryCode(v string) {}
98+
func (r *noopCallReporter) ReportPhoneNumber(v string) {}
99+
func (r *noopCallReporter) ReportDuration(v uint32) {}
100+
func (r *noopCallReporter) ReportDurationMinutes(v uint16) {}
101+
func (r *noopCallReporter) ReportStartTime(v time.Time) {}
102+
func (r *noopCallReporter) ReportEndTime(v time.Time) {}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Code generated; DO NOT EDIT.
2+
package telephonyobs
3+
4+
type DirectionType string
5+
6+
const (
7+
DirectionTypeUndefined DirectionType = ""
8+
DirectionTypeInbound DirectionType = "inbound"
9+
DirectionTypeOutbound DirectionType = "outbound"
10+
)
11+
12+
type NumberType string
13+
14+
const (
15+
NumberTypeUndefined NumberType = ""
16+
NumberTypeTollFree NumberType = "toll_free"
17+
NumberTypeRegular NumberType = "regular"
18+
)
19+
20+
type CallStatus string
21+
22+
const (
23+
CallStatusUndefined CallStatus = ""
24+
CallStatusAnswered CallStatus = "answered"
25+
CallStatusMissed CallStatus = "missed"
26+
CallStatusBusy CallStatus = "busy"
27+
CallStatusFailed CallStatus = "failed"
28+
)
29+
30+
type TrunkType string
31+
32+
const (
33+
TrunkTypeUndefined TrunkType = ""
34+
TrunkTypeInternal TrunkType = "internal"
35+
TrunkTypeExternal TrunkType = "external"
36+
)
37+
38+
type Rollup string
39+
40+
const (
41+
RollupUndefined Rollup = ""
42+
RollupCountry Rollup = "country"
43+
RollupCall Rollup = "call"
44+
)

0 commit comments

Comments
 (0)