You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

235 lines
7.1 KiB

  1. // Copyright YEAR Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package arrayofenum provides access to the Example API.
  6. //
  7. // Creating a client
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/arrayofenum/v1"
  12. // ...
  13. // ctx := context.Background()
  14. // arrayofenumService, err := arrayofenum.NewService(ctx)
  15. //
  16. // In this example, Google Application Default Credentials are used for authentication.
  17. //
  18. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  19. //
  20. // Other authentication options
  21. //
  22. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  23. //
  24. // arrayofenumService, err := arrayofenum.NewService(ctx, option.WithAPIKey("AIza..."))
  25. //
  26. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  27. //
  28. // config := &oauth2.Config{...}
  29. // // ...
  30. // token, err := config.Exchange(ctx, ...)
  31. // arrayofenumService, err := arrayofenum.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  32. //
  33. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  34. package arrayofenum // import "google.golang.org/api/arrayofenum/v1"
  35. import (
  36. "bytes"
  37. "context"
  38. "encoding/json"
  39. "errors"
  40. "fmt"
  41. "io"
  42. "net/http"
  43. "net/url"
  44. "strconv"
  45. "strings"
  46. gensupport "google.golang.org/api/gensupport"
  47. googleapi "google.golang.org/api/googleapi"
  48. option "google.golang.org/api/option"
  49. htransport "google.golang.org/api/transport/http"
  50. )
  51. // Always reference these packages, just in case the auto-generated code
  52. // below doesn't.
  53. var _ = bytes.NewBuffer
  54. var _ = strconv.Itoa
  55. var _ = fmt.Sprintf
  56. var _ = json.NewDecoder
  57. var _ = io.Copy
  58. var _ = url.Parse
  59. var _ = gensupport.MarshalJSON
  60. var _ = googleapi.Version
  61. var _ = errors.New
  62. var _ = strings.Replace
  63. var _ = context.Canceled
  64. const apiId = "arrayofenum:v1"
  65. const apiName = "arrayofenum"
  66. const apiVersion = "v1"
  67. const basePath = "https://www.googleapis.com/discovery/v1/apis"
  68. // NewService creates a new Service.
  69. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  70. client, endpoint, err := htransport.NewClient(ctx, opts...)
  71. if err != nil {
  72. return nil, err
  73. }
  74. s, err := New(client)
  75. if err != nil {
  76. return nil, err
  77. }
  78. if endpoint != "" {
  79. s.BasePath = endpoint
  80. }
  81. return s, nil
  82. }
  83. // New creates a new Service. It uses the provided http.Client for requests.
  84. //
  85. // Deprecated: please use NewService instead.
  86. // To provide a custom HTTP client, use option.WithHTTPClient.
  87. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  88. func New(client *http.Client) (*Service, error) {
  89. if client == nil {
  90. return nil, errors.New("client is nil")
  91. }
  92. s := &Service{client: client, BasePath: basePath}
  93. return s, nil
  94. }
  95. type Service struct {
  96. client *http.Client
  97. BasePath string // API endpoint base URL
  98. UserAgent string // optional additional User-Agent fragment
  99. }
  100. func (s *Service) userAgent() string {
  101. if s.UserAgent == "" {
  102. return googleapi.UserAgent
  103. }
  104. return googleapi.UserAgent + " " + s.UserAgent
  105. }
  106. // Container: Represents a Google Tag Manager Container.
  107. type Container struct {
  108. // AccountId: GTM Account ID.
  109. AccountId string `json:"accountId,omitempty"`
  110. // ContainerId: This is a long description that has URLs in it that
  111. // shouldn't break.
  112. // https://sites.google.com/a/google.com/adx-integration/Home/engineering/binary-releases/rtb-api-release
  113. // https://cs.corp.google.com/#piper///depot/google3/contentads/adx/tools/rtb_api/adxrtb.py
  114. ContainerId string `json:"containerId,omitempty"`
  115. // DomainName: Optional list of domain names associated with the
  116. // Container.
  117. DomainName []string `json:"domainName,omitempty"`
  118. // EnabledBuiltInVariable: List of enabled built-in variables. Valid
  119. // values include: pageUrl, pageHostname, pagePath, referrer, event,
  120. // clickElement, clickClasses, clickId, clickTarget, clickUrl,
  121. // clickText, formElement, formClasses, formId, formTarget, formUrl,
  122. // formText, errorMessage, errorUrl, errorLine, newHistoryFragment,
  123. // oldHistoryFragment, newHistoryState, oldHistoryState, historySource,
  124. // containerVersion, debugMode, randomNumber, containerId.
  125. //
  126. // Possible values:
  127. // "advertiserId"
  128. // "advertisingTrackingEnabled"
  129. // "appId"
  130. // "appName"
  131. // "appVersionCode"
  132. // "appVersionName"
  133. // "clickClasses"
  134. // "clickElement"
  135. // "clickId"
  136. // "clickTarget"
  137. // "clickText"
  138. // "clickUrl"
  139. // "containerId"
  140. // "containerVersion"
  141. // "debugMode"
  142. // "deviceName"
  143. // "errorLine"
  144. // "errorMessage"
  145. // "errorUrl"
  146. // "event"
  147. // "formClasses"
  148. // "formElement"
  149. // "formId"
  150. // "formTarget"
  151. // "formText"
  152. // "formUrl"
  153. // "historySource"
  154. // "language"
  155. // "newHistoryFragment"
  156. // "newHistoryState"
  157. // "oldHistoryFragment"
  158. // "oldHistoryState"
  159. // "osVersion"
  160. // "pageHostname"
  161. // "pagePath"
  162. // "pageUrl"
  163. // "platform"
  164. // "randomNumber"
  165. // "referrer"
  166. // "resolution"
  167. // "sdkVersion"
  168. EnabledBuiltInVariable []string `json:"enabledBuiltInVariable,omitempty"`
  169. // Fingerprint: The fingerprint of the GTM Container as computed at
  170. // storage time. This value is recomputed whenever the account is
  171. // modified.
  172. Fingerprint string `json:"fingerprint,omitempty"`
  173. // Name: Container display name.
  174. Name string `json:"name,omitempty"`
  175. // Notes: Container Notes.
  176. Notes string `json:"notes,omitempty"`
  177. // PublicId: Container Public ID.
  178. PublicId string `json:"publicId,omitempty"`
  179. // TimeZoneCountryId: Container Country ID.
  180. TimeZoneCountryId string `json:"timeZoneCountryId,omitempty"`
  181. // TimeZoneId: Container Time Zone ID.
  182. TimeZoneId string `json:"timeZoneId,omitempty"`
  183. // UsageContext: List of Usage Contexts for the Container. Valid values
  184. // include: web, android, ios.
  185. //
  186. // Possible values:
  187. // "android"
  188. // "ios"
  189. // "web"
  190. UsageContext []string `json:"usageContext,omitempty"`
  191. // ForceSendFields is a list of field names (e.g. "AccountId") to
  192. // unconditionally include in API requests. By default, fields with
  193. // empty values are omitted from API requests. However, any non-pointer,
  194. // non-interface field appearing in ForceSendFields will be sent to the
  195. // server regardless of whether the field is empty or not. This may be
  196. // used to include empty fields in Patch requests.
  197. ForceSendFields []string `json:"-"`
  198. // NullFields is a list of field names (e.g. "AccountId") to include in
  199. // API requests with the JSON null value. By default, fields with empty
  200. // values are omitted from API requests. However, any field with an
  201. // empty value appearing in NullFields will be sent to the server as
  202. // null. It is an error if a field in this list has a non-empty value.
  203. // This may be used to include null fields in Patch requests.
  204. NullFields []string `json:"-"`
  205. }
  206. func (s *Container) MarshalJSON() ([]byte, error) {
  207. type NoMethod Container
  208. raw := NoMethod(*s)
  209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  210. }