...
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 package corp_spatialanalytics
37
38 import (
39 "bytes"
40 "context"
41 "encoding/json"
42 "errors"
43 "fmt"
44 "io"
45 "net/http"
46 "net/url"
47 "strconv"
48 "strings"
49
50 googleapi "google.golang.org/api/googleapi"
51 gensupport "google.golang.org/api/internal/gensupport"
52 option "google.golang.org/api/option"
53 internaloption "google.golang.org/api/option/internaloption"
54 htransport "google.golang.org/api/transport/http"
55 )
56
57
58
59 var _ = bytes.NewBuffer
60 var _ = strconv.Itoa
61 var _ = fmt.Sprintf
62 var _ = json.NewDecoder
63 var _ = io.Copy
64 var _ = url.Parse
65 var _ = gensupport.MarshalJSON
66 var _ = googleapi.Version
67 var _ = errors.New
68 var _ = strings.Replace
69 var _ = context.Canceled
70 var _ = internaloption.WithDefaultEndpoint
71
72 const apiId = ""
73 const apiName = ""
74 const apiVersion = ""
75 const basePath = "https://www.googleapis.com/discovery/v1/apis"
76
77
78 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
79 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
80 client, endpoint, err := htransport.NewClient(ctx, opts...)
81 if err != nil {
82 return nil, err
83 }
84 s, err := New(client)
85 if err != nil {
86 return nil, err
87 }
88 if endpoint != "" {
89 s.BasePath = endpoint
90 }
91 return s, nil
92 }
93
94
95
96
97
98
99 func New(client *http.Client) (*Service, error) {
100 if client == nil {
101 return nil, errors.New("client is nil")
102 }
103 s := &Service{client: client, BasePath: basePath}
104 return s, nil
105 }
106
107 type Service struct {
108 client *http.Client
109 BasePath string
110 UserAgent string
111 }
112
113 func (s *Service) userAgent() string {
114 if s.UserAgent == "" {
115 return googleapi.UserAgent
116 }
117 return googleapi.UserAgent + " " + s.UserAgent
118 }
119
View as plain text