-
Notifications
You must be signed in to change notification settings - Fork 1
/
base_controller.go
31 lines (26 loc) · 1.11 KB
/
base_controller.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
/*
Package advancedbilling
This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ).
*/
package advancedbilling
import (
"github.com/apimatic/go-core-runtime/https"
)
// callBuilderFactory is an interface that defines a method to get a CallBuilderFactory.
// It allows objects to get a reference to a CallBuilderFactory for creating API call.
type callBuilderFactory interface {
GetCallBuilder() https.CallBuilderFactory
}
// baseController represents a controller used as a base for other controllers.
// It encapsulates common functionality required by controllers for making API call.
type baseController struct {
callBuilder callBuilderFactory
prepareRequest https.CallBuilderFactory
}
// NewBaseController creates a new instance of baseController.
// It takes a callBuilderFactory as a parameter and returns a pointer to the baseController.
func NewBaseController(cb callBuilderFactory) *baseController {
baseController := baseController{callBuilder: cb}
baseController.prepareRequest = baseController.callBuilder.GetCallBuilder()
return &baseController
}