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.
 
 
 

14469 lines
478 KiB

  1. // Copyright 2019 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 tagmanager provides access to the Tag Manager API.
  6. //
  7. // For product documentation, see: https://developers.google.com/tag-manager/api/v2/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/tagmanager/v2"
  14. // ...
  15. // ctx := context.Background()
  16. // tagmanagerService, err := tagmanager.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // tagmanagerService, err := tagmanager.NewService(ctx, option.WithScopes(tagmanager.TagmanagerReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // tagmanagerService, err := tagmanager.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // tagmanagerService, err := tagmanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package tagmanager // import "google.golang.org/api/tagmanager/v2"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  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. const apiId = "tagmanager:v2"
  71. const apiName = "tagmanager"
  72. const apiVersion = "v2"
  73. const basePath = "https://www.googleapis.com/tagmanager/v2/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // Delete your Google Tag Manager containers
  77. TagmanagerDeleteContainersScope = "https://www.googleapis.com/auth/tagmanager.delete.containers"
  78. // Manage your Google Tag Manager container and its subcomponents,
  79. // excluding versioning and publishing
  80. TagmanagerEditContainersScope = "https://www.googleapis.com/auth/tagmanager.edit.containers"
  81. // Manage your Google Tag Manager container versions
  82. TagmanagerEditContainerversionsScope = "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  83. // View and manage your Google Tag Manager accounts
  84. TagmanagerManageAccountsScope = "https://www.googleapis.com/auth/tagmanager.manage.accounts"
  85. // Manage user permissions of your Google Tag Manager account and
  86. // container
  87. TagmanagerManageUsersScope = "https://www.googleapis.com/auth/tagmanager.manage.users"
  88. // Publish your Google Tag Manager container versions
  89. TagmanagerPublishScope = "https://www.googleapis.com/auth/tagmanager.publish"
  90. // View your Google Tag Manager container and its subcomponents
  91. TagmanagerReadonlyScope = "https://www.googleapis.com/auth/tagmanager.readonly"
  92. )
  93. // NewService creates a new Service.
  94. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  95. scopesOption := option.WithScopes(
  96. "https://www.googleapis.com/auth/tagmanager.delete.containers",
  97. "https://www.googleapis.com/auth/tagmanager.edit.containers",
  98. "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  99. "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  100. "https://www.googleapis.com/auth/tagmanager.manage.users",
  101. "https://www.googleapis.com/auth/tagmanager.publish",
  102. "https://www.googleapis.com/auth/tagmanager.readonly",
  103. )
  104. // NOTE: prepend, so we don't override user-specified scopes.
  105. opts = append([]option.ClientOption{scopesOption}, opts...)
  106. client, endpoint, err := htransport.NewClient(ctx, opts...)
  107. if err != nil {
  108. return nil, err
  109. }
  110. s, err := New(client)
  111. if err != nil {
  112. return nil, err
  113. }
  114. if endpoint != "" {
  115. s.BasePath = endpoint
  116. }
  117. return s, nil
  118. }
  119. // New creates a new Service. It uses the provided http.Client for requests.
  120. //
  121. // Deprecated: please use NewService instead.
  122. // To provide a custom HTTP client, use option.WithHTTPClient.
  123. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  124. func New(client *http.Client) (*Service, error) {
  125. if client == nil {
  126. return nil, errors.New("client is nil")
  127. }
  128. s := &Service{client: client, BasePath: basePath}
  129. s.Accounts = NewAccountsService(s)
  130. return s, nil
  131. }
  132. type Service struct {
  133. client *http.Client
  134. BasePath string // API endpoint base URL
  135. UserAgent string // optional additional User-Agent fragment
  136. Accounts *AccountsService
  137. }
  138. func (s *Service) userAgent() string {
  139. if s.UserAgent == "" {
  140. return googleapi.UserAgent
  141. }
  142. return googleapi.UserAgent + " " + s.UserAgent
  143. }
  144. func NewAccountsService(s *Service) *AccountsService {
  145. rs := &AccountsService{s: s}
  146. rs.Containers = NewAccountsContainersService(s)
  147. rs.UserPermissions = NewAccountsUserPermissionsService(s)
  148. return rs
  149. }
  150. type AccountsService struct {
  151. s *Service
  152. Containers *AccountsContainersService
  153. UserPermissions *AccountsUserPermissionsService
  154. }
  155. func NewAccountsContainersService(s *Service) *AccountsContainersService {
  156. rs := &AccountsContainersService{s: s}
  157. rs.Environments = NewAccountsContainersEnvironmentsService(s)
  158. rs.VersionHeaders = NewAccountsContainersVersionHeadersService(s)
  159. rs.Versions = NewAccountsContainersVersionsService(s)
  160. rs.Workspaces = NewAccountsContainersWorkspacesService(s)
  161. return rs
  162. }
  163. type AccountsContainersService struct {
  164. s *Service
  165. Environments *AccountsContainersEnvironmentsService
  166. VersionHeaders *AccountsContainersVersionHeadersService
  167. Versions *AccountsContainersVersionsService
  168. Workspaces *AccountsContainersWorkspacesService
  169. }
  170. func NewAccountsContainersEnvironmentsService(s *Service) *AccountsContainersEnvironmentsService {
  171. rs := &AccountsContainersEnvironmentsService{s: s}
  172. return rs
  173. }
  174. type AccountsContainersEnvironmentsService struct {
  175. s *Service
  176. }
  177. func NewAccountsContainersVersionHeadersService(s *Service) *AccountsContainersVersionHeadersService {
  178. rs := &AccountsContainersVersionHeadersService{s: s}
  179. return rs
  180. }
  181. type AccountsContainersVersionHeadersService struct {
  182. s *Service
  183. }
  184. func NewAccountsContainersVersionsService(s *Service) *AccountsContainersVersionsService {
  185. rs := &AccountsContainersVersionsService{s: s}
  186. return rs
  187. }
  188. type AccountsContainersVersionsService struct {
  189. s *Service
  190. }
  191. func NewAccountsContainersWorkspacesService(s *Service) *AccountsContainersWorkspacesService {
  192. rs := &AccountsContainersWorkspacesService{s: s}
  193. rs.BuiltInVariables = NewAccountsContainersWorkspacesBuiltInVariablesService(s)
  194. rs.Folders = NewAccountsContainersWorkspacesFoldersService(s)
  195. rs.Tags = NewAccountsContainersWorkspacesTagsService(s)
  196. rs.Triggers = NewAccountsContainersWorkspacesTriggersService(s)
  197. rs.Variables = NewAccountsContainersWorkspacesVariablesService(s)
  198. rs.Zones = NewAccountsContainersWorkspacesZonesService(s)
  199. return rs
  200. }
  201. type AccountsContainersWorkspacesService struct {
  202. s *Service
  203. BuiltInVariables *AccountsContainersWorkspacesBuiltInVariablesService
  204. Folders *AccountsContainersWorkspacesFoldersService
  205. Tags *AccountsContainersWorkspacesTagsService
  206. Triggers *AccountsContainersWorkspacesTriggersService
  207. Variables *AccountsContainersWorkspacesVariablesService
  208. Zones *AccountsContainersWorkspacesZonesService
  209. }
  210. func NewAccountsContainersWorkspacesBuiltInVariablesService(s *Service) *AccountsContainersWorkspacesBuiltInVariablesService {
  211. rs := &AccountsContainersWorkspacesBuiltInVariablesService{s: s}
  212. return rs
  213. }
  214. type AccountsContainersWorkspacesBuiltInVariablesService struct {
  215. s *Service
  216. }
  217. func NewAccountsContainersWorkspacesFoldersService(s *Service) *AccountsContainersWorkspacesFoldersService {
  218. rs := &AccountsContainersWorkspacesFoldersService{s: s}
  219. return rs
  220. }
  221. type AccountsContainersWorkspacesFoldersService struct {
  222. s *Service
  223. }
  224. func NewAccountsContainersWorkspacesTagsService(s *Service) *AccountsContainersWorkspacesTagsService {
  225. rs := &AccountsContainersWorkspacesTagsService{s: s}
  226. return rs
  227. }
  228. type AccountsContainersWorkspacesTagsService struct {
  229. s *Service
  230. }
  231. func NewAccountsContainersWorkspacesTriggersService(s *Service) *AccountsContainersWorkspacesTriggersService {
  232. rs := &AccountsContainersWorkspacesTriggersService{s: s}
  233. return rs
  234. }
  235. type AccountsContainersWorkspacesTriggersService struct {
  236. s *Service
  237. }
  238. func NewAccountsContainersWorkspacesVariablesService(s *Service) *AccountsContainersWorkspacesVariablesService {
  239. rs := &AccountsContainersWorkspacesVariablesService{s: s}
  240. return rs
  241. }
  242. type AccountsContainersWorkspacesVariablesService struct {
  243. s *Service
  244. }
  245. func NewAccountsContainersWorkspacesZonesService(s *Service) *AccountsContainersWorkspacesZonesService {
  246. rs := &AccountsContainersWorkspacesZonesService{s: s}
  247. return rs
  248. }
  249. type AccountsContainersWorkspacesZonesService struct {
  250. s *Service
  251. }
  252. func NewAccountsUserPermissionsService(s *Service) *AccountsUserPermissionsService {
  253. rs := &AccountsUserPermissionsService{s: s}
  254. return rs
  255. }
  256. type AccountsUserPermissionsService struct {
  257. s *Service
  258. }
  259. // Account: Represents a Google Tag Manager Account.
  260. type Account struct {
  261. // AccountId: The Account ID uniquely identifies the GTM Account.
  262. AccountId string `json:"accountId,omitempty"`
  263. // Fingerprint: The fingerprint of the GTM Account as computed at
  264. // storage time. This value is recomputed whenever the account is
  265. // modified.
  266. Fingerprint string `json:"fingerprint,omitempty"`
  267. // Name: Account display name.
  268. Name string `json:"name,omitempty"`
  269. // Path: GTM Account's API relative path.
  270. Path string `json:"path,omitempty"`
  271. // ShareData: Whether the account shares data anonymously with Google
  272. // and others. This flag enables benchmarking by sharing your data in an
  273. // anonymous form. Google will remove all identifiable information about
  274. // your website, combine the data with hundreds of other anonymous sites
  275. // and report aggregate trends in the benchmarking service.
  276. ShareData bool `json:"shareData,omitempty"`
  277. // TagManagerUrl: Auto generated link to the tag manager UI
  278. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  279. // ServerResponse contains the HTTP response code and headers from the
  280. // server.
  281. googleapi.ServerResponse `json:"-"`
  282. // ForceSendFields is a list of field names (e.g. "AccountId") to
  283. // unconditionally include in API requests. By default, fields with
  284. // empty values are omitted from API requests. However, any non-pointer,
  285. // non-interface field appearing in ForceSendFields will be sent to the
  286. // server regardless of whether the field is empty or not. This may be
  287. // used to include empty fields in Patch requests.
  288. ForceSendFields []string `json:"-"`
  289. // NullFields is a list of field names (e.g. "AccountId") to include in
  290. // API requests with the JSON null value. By default, fields with empty
  291. // values are omitted from API requests. However, any field with an
  292. // empty value appearing in NullFields will be sent to the server as
  293. // null. It is an error if a field in this list has a non-empty value.
  294. // This may be used to include null fields in Patch requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *Account) MarshalJSON() ([]byte, error) {
  298. type NoMethod Account
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. // AccountAccess: Defines the Google Tag Manager Account access
  303. // permissions.
  304. type AccountAccess struct {
  305. // Permission: Whether the user has no access, user access, or admin
  306. // access to an account.
  307. //
  308. // Possible values:
  309. // "accountPermissionUnspecified"
  310. // "admin"
  311. // "noAccess"
  312. // "user"
  313. Permission string `json:"permission,omitempty"`
  314. // ForceSendFields is a list of field names (e.g. "Permission") to
  315. // unconditionally include in API requests. By default, fields with
  316. // empty values are omitted from API requests. However, any non-pointer,
  317. // non-interface field appearing in ForceSendFields will be sent to the
  318. // server regardless of whether the field is empty or not. This may be
  319. // used to include empty fields in Patch requests.
  320. ForceSendFields []string `json:"-"`
  321. // NullFields is a list of field names (e.g. "Permission") to include in
  322. // API requests with the JSON null value. By default, fields with empty
  323. // values are omitted from API requests. However, any field with an
  324. // empty value appearing in NullFields will be sent to the server as
  325. // null. It is an error if a field in this list has a non-empty value.
  326. // This may be used to include null fields in Patch requests.
  327. NullFields []string `json:"-"`
  328. }
  329. func (s *AccountAccess) MarshalJSON() ([]byte, error) {
  330. type NoMethod AccountAccess
  331. raw := NoMethod(*s)
  332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  333. }
  334. // BuiltInVariable: Built-in variables are a special category of
  335. // variables that are pre-created and non-customizable. They provide
  336. // common functionality like accessing propeties of the gtm data layer,
  337. // monitoring clicks, or accessing elements of a page URL.
  338. type BuiltInVariable struct {
  339. // AccountId: GTM Account ID.
  340. AccountId string `json:"accountId,omitempty"`
  341. // ContainerId: GTM Container ID.
  342. ContainerId string `json:"containerId,omitempty"`
  343. // Name: Name of the built-in variable to be used to refer to the
  344. // built-in variable.
  345. Name string `json:"name,omitempty"`
  346. // Path: GTM BuiltInVariable's API relative path.
  347. Path string `json:"path,omitempty"`
  348. // Type: Type of built-in variable.
  349. //
  350. // Possible values:
  351. // "advertiserId"
  352. // "advertisingTrackingEnabled"
  353. // "ampBrowserLanguage"
  354. // "ampCanonicalHost"
  355. // "ampCanonicalPath"
  356. // "ampCanonicalUrl"
  357. // "ampClientId"
  358. // "ampClientMaxScrollX"
  359. // "ampClientMaxScrollY"
  360. // "ampClientScreenHeight"
  361. // "ampClientScreenWidth"
  362. // "ampClientScrollX"
  363. // "ampClientScrollY"
  364. // "ampClientTimestamp"
  365. // "ampClientTimezone"
  366. // "ampGtmEvent"
  367. // "ampPageDownloadTime"
  368. // "ampPageLoadTime"
  369. // "ampPageViewId"
  370. // "ampReferrer"
  371. // "ampTitle"
  372. // "ampTotalEngagedTime"
  373. // "appId"
  374. // "appName"
  375. // "appVersionCode"
  376. // "appVersionName"
  377. // "builtInVariableTypeUnspecified"
  378. // "clickClasses"
  379. // "clickElement"
  380. // "clickId"
  381. // "clickTarget"
  382. // "clickText"
  383. // "clickUrl"
  384. // "containerId"
  385. // "containerVersion"
  386. // "debugMode"
  387. // "deviceName"
  388. // "elementVisibilityFirstTime"
  389. // "elementVisibilityRatio"
  390. // "elementVisibilityRecentTime"
  391. // "elementVisibilityTime"
  392. // "environmentName"
  393. // "errorLine"
  394. // "errorMessage"
  395. // "errorUrl"
  396. // "event"
  397. // "eventName"
  398. // "firebaseEventParameterCampaign"
  399. // "firebaseEventParameterCampaignAclid"
  400. // "firebaseEventParameterCampaignAnid"
  401. // "firebaseEventParameterCampaignClickTimestamp"
  402. // "firebaseEventParameterCampaignContent"
  403. // "firebaseEventParameterCampaignCp1"
  404. // "firebaseEventParameterCampaignGclid"
  405. // "firebaseEventParameterCampaignSource"
  406. // "firebaseEventParameterCampaignTerm"
  407. // "firebaseEventParameterCurrency"
  408. // "firebaseEventParameterDynamicLinkAcceptTime"
  409. // "firebaseEventParameterDynamicLinkLinkid"
  410. // "firebaseEventParameterNotificationMessageDeviceTime"
  411. // "firebaseEventParameterNotificationMessageId"
  412. // "firebaseEventParameterNotificationMessageName"
  413. // "firebaseEventParameterNotificationMessageTime"
  414. // "firebaseEventParameterNotificationTopic"
  415. // "firebaseEventParameterPreviousAppVersion"
  416. // "firebaseEventParameterPreviousOsVersion"
  417. // "firebaseEventParameterPrice"
  418. // "firebaseEventParameterProductId"
  419. // "firebaseEventParameterQuantity"
  420. // "firebaseEventParameterValue"
  421. // "formClasses"
  422. // "formElement"
  423. // "formId"
  424. // "formTarget"
  425. // "formText"
  426. // "formUrl"
  427. // "historySource"
  428. // "htmlId"
  429. // "language"
  430. // "newHistoryFragment"
  431. // "newHistoryState"
  432. // "oldHistoryFragment"
  433. // "oldHistoryState"
  434. // "osVersion"
  435. // "pageHostname"
  436. // "pagePath"
  437. // "pageUrl"
  438. // "platform"
  439. // "randomNumber"
  440. // "referrer"
  441. // "resolution"
  442. // "scrollDepthDirection"
  443. // "scrollDepthThreshold"
  444. // "scrollDepthUnits"
  445. // "sdkVersion"
  446. // "videoCurrentTime"
  447. // "videoDuration"
  448. // "videoPercent"
  449. // "videoProvider"
  450. // "videoStatus"
  451. // "videoTitle"
  452. // "videoUrl"
  453. // "videoVisible"
  454. Type string `json:"type,omitempty"`
  455. // WorkspaceId: GTM Workspace ID.
  456. WorkspaceId string `json:"workspaceId,omitempty"`
  457. // ForceSendFields is a list of field names (e.g. "AccountId") to
  458. // unconditionally include in API requests. By default, fields with
  459. // empty values are omitted from API requests. However, any non-pointer,
  460. // non-interface field appearing in ForceSendFields will be sent to the
  461. // server regardless of whether the field is empty or not. This may be
  462. // used to include empty fields in Patch requests.
  463. ForceSendFields []string `json:"-"`
  464. // NullFields is a list of field names (e.g. "AccountId") to include in
  465. // API requests with the JSON null value. By default, fields with empty
  466. // values are omitted from API requests. However, any field with an
  467. // empty value appearing in NullFields will be sent to the server as
  468. // null. It is an error if a field in this list has a non-empty value.
  469. // This may be used to include null fields in Patch requests.
  470. NullFields []string `json:"-"`
  471. }
  472. func (s *BuiltInVariable) MarshalJSON() ([]byte, error) {
  473. type NoMethod BuiltInVariable
  474. raw := NoMethod(*s)
  475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  476. }
  477. // Condition: Represents a predicate.
  478. type Condition struct {
  479. // Parameter: A list of named parameters (key/value), depending on the
  480. // condition's type. Notes:
  481. // - For binary operators, include parameters named arg0 and arg1 for
  482. // specifying the left and right operands, respectively.
  483. // - At this time, the left operand (arg0) must be a reference to a
  484. // variable.
  485. // - For case-insensitive Regex matching, include a boolean parameter
  486. // named ignore_case that is set to true. If not specified or set to any
  487. // other value, the matching will be case sensitive.
  488. // - To negate an operator, include a boolean parameter named negate
  489. // boolean parameter that is set to true.
  490. Parameter []*Parameter `json:"parameter,omitempty"`
  491. // Type: The type of operator for this condition.
  492. //
  493. // Possible values:
  494. // "conditionTypeUnspecified"
  495. // "contains"
  496. // "cssSelector"
  497. // "endsWith"
  498. // "equals"
  499. // "greater"
  500. // "greaterOrEquals"
  501. // "less"
  502. // "lessOrEquals"
  503. // "matchRegex"
  504. // "startsWith"
  505. // "urlMatches"
  506. Type string `json:"type,omitempty"`
  507. // ForceSendFields is a list of field names (e.g. "Parameter") to
  508. // unconditionally include in API requests. By default, fields with
  509. // empty values are omitted from API requests. However, any non-pointer,
  510. // non-interface field appearing in ForceSendFields will be sent to the
  511. // server regardless of whether the field is empty or not. This may be
  512. // used to include empty fields in Patch requests.
  513. ForceSendFields []string `json:"-"`
  514. // NullFields is a list of field names (e.g. "Parameter") to include in
  515. // API requests with the JSON null value. By default, fields with empty
  516. // values are omitted from API requests. However, any field with an
  517. // empty value appearing in NullFields will be sent to the server as
  518. // null. It is an error if a field in this list has a non-empty value.
  519. // This may be used to include null fields in Patch requests.
  520. NullFields []string `json:"-"`
  521. }
  522. func (s *Condition) MarshalJSON() ([]byte, error) {
  523. type NoMethod Condition
  524. raw := NoMethod(*s)
  525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  526. }
  527. // Container: Represents a Google Tag Manager Container, which specifies
  528. // the platform tags will run on, manages workspaces, and retains
  529. // container versions.
  530. type Container struct {
  531. // AccountId: GTM Account ID.
  532. AccountId string `json:"accountId,omitempty"`
  533. // ContainerId: The Container ID uniquely identifies the GTM Container.
  534. ContainerId string `json:"containerId,omitempty"`
  535. // DomainName: List of domain names associated with the Container.
  536. DomainName []string `json:"domainName,omitempty"`
  537. // Fingerprint: The fingerprint of the GTM Container as computed at
  538. // storage time. This value is recomputed whenever the account is
  539. // modified.
  540. Fingerprint string `json:"fingerprint,omitempty"`
  541. // Name: Container display name.
  542. Name string `json:"name,omitempty"`
  543. // Notes: Container Notes.
  544. Notes string `json:"notes,omitempty"`
  545. // Path: GTM Container's API relative path.
  546. Path string `json:"path,omitempty"`
  547. // PublicId: Container Public ID.
  548. PublicId string `json:"publicId,omitempty"`
  549. // TagManagerUrl: Auto generated link to the tag manager UI
  550. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  551. // UsageContext: List of Usage Contexts for the Container. Valid values
  552. // include: web, android, or ios.
  553. //
  554. // Possible values:
  555. // "amp"
  556. // "android"
  557. // "androidSdk5"
  558. // "ios"
  559. // "iosSdk5"
  560. // "usageContextUnspecified"
  561. // "web"
  562. UsageContext []string `json:"usageContext,omitempty"`
  563. // ServerResponse contains the HTTP response code and headers from the
  564. // server.
  565. googleapi.ServerResponse `json:"-"`
  566. // ForceSendFields is a list of field names (e.g. "AccountId") to
  567. // unconditionally include in API requests. By default, fields with
  568. // empty values are omitted from API requests. However, any non-pointer,
  569. // non-interface field appearing in ForceSendFields will be sent to the
  570. // server regardless of whether the field is empty or not. This may be
  571. // used to include empty fields in Patch requests.
  572. ForceSendFields []string `json:"-"`
  573. // NullFields is a list of field names (e.g. "AccountId") to include in
  574. // API requests with the JSON null value. By default, fields with empty
  575. // values are omitted from API requests. However, any field with an
  576. // empty value appearing in NullFields will be sent to the server as
  577. // null. It is an error if a field in this list has a non-empty value.
  578. // This may be used to include null fields in Patch requests.
  579. NullFields []string `json:"-"`
  580. }
  581. func (s *Container) MarshalJSON() ([]byte, error) {
  582. type NoMethod Container
  583. raw := NoMethod(*s)
  584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  585. }
  586. // ContainerAccess: Defines the Google Tag Manager Container access
  587. // permissions.
  588. type ContainerAccess struct {
  589. // ContainerId: GTM Container ID.
  590. ContainerId string `json:"containerId,omitempty"`
  591. // Permission: List of Container permissions.
  592. //
  593. // Possible values:
  594. // "approve"
  595. // "containerPermissionUnspecified"
  596. // "edit"
  597. // "noAccess"
  598. // "publish"
  599. // "read"
  600. Permission string `json:"permission,omitempty"`
  601. // ForceSendFields is a list of field names (e.g. "ContainerId") to
  602. // unconditionally include in API requests. By default, fields with
  603. // empty values are omitted from API requests. However, any non-pointer,
  604. // non-interface field appearing in ForceSendFields will be sent to the
  605. // server regardless of whether the field is empty or not. This may be
  606. // used to include empty fields in Patch requests.
  607. ForceSendFields []string `json:"-"`
  608. // NullFields is a list of field names (e.g. "ContainerId") to include
  609. // in API requests with the JSON null value. By default, fields with
  610. // empty values are omitted from API requests. However, any field with
  611. // an empty value appearing in NullFields will be sent to the server as
  612. // null. It is an error if a field in this list has a non-empty value.
  613. // This may be used to include null fields in Patch requests.
  614. NullFields []string `json:"-"`
  615. }
  616. func (s *ContainerAccess) MarshalJSON() ([]byte, error) {
  617. type NoMethod ContainerAccess
  618. raw := NoMethod(*s)
  619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  620. }
  621. // ContainerVersion: Represents a Google Tag Manager Container Version.
  622. type ContainerVersion struct {
  623. // AccountId: GTM Account ID.
  624. AccountId string `json:"accountId,omitempty"`
  625. // BuiltInVariable: The built-in variables in the container that this
  626. // version was taken from.
  627. BuiltInVariable []*BuiltInVariable `json:"builtInVariable,omitempty"`
  628. // Container: The container that this version was taken from.
  629. Container *Container `json:"container,omitempty"`
  630. // ContainerId: GTM Container ID.
  631. ContainerId string `json:"containerId,omitempty"`
  632. // ContainerVersionId: The Container Version ID uniquely identifies the
  633. // GTM Container Version.
  634. ContainerVersionId string `json:"containerVersionId,omitempty"`
  635. // CustomTemplate: The custom templates in the container that this
  636. // version was taken from.
  637. CustomTemplate []*CustomTemplate `json:"customTemplate,omitempty"`
  638. // Deleted: A value of true indicates this container version has been
  639. // deleted.
  640. Deleted bool `json:"deleted,omitempty"`
  641. // Description: Container version description.
  642. Description string `json:"description,omitempty"`
  643. // Fingerprint: The fingerprint of the GTM Container Version as computed
  644. // at storage time. This value is recomputed whenever the container
  645. // version is modified.
  646. Fingerprint string `json:"fingerprint,omitempty"`
  647. // Folder: The folders in the container that this version was taken
  648. // from.
  649. Folder []*Folder `json:"folder,omitempty"`
  650. // Name: Container version display name.
  651. Name string `json:"name,omitempty"`
  652. // Path: GTM ContainerVersions's API relative path.
  653. Path string `json:"path,omitempty"`
  654. // Tag: The tags in the container that this version was taken from.
  655. Tag []*Tag `json:"tag,omitempty"`
  656. // TagManagerUrl: Auto generated link to the tag manager UI
  657. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  658. // Trigger: The triggers in the container that this version was taken
  659. // from.
  660. Trigger []*Trigger `json:"trigger,omitempty"`
  661. // Variable: The variables in the container that this version was taken
  662. // from.
  663. Variable []*Variable `json:"variable,omitempty"`
  664. // Zone: The zones in the container that this version was taken from.
  665. Zone []*Zone `json:"zone,omitempty"`
  666. // ServerResponse contains the HTTP response code and headers from the
  667. // server.
  668. googleapi.ServerResponse `json:"-"`
  669. // ForceSendFields is a list of field names (e.g. "AccountId") to
  670. // unconditionally include in API requests. By default, fields with
  671. // empty values are omitted from API requests. However, any non-pointer,
  672. // non-interface field appearing in ForceSendFields will be sent to the
  673. // server regardless of whether the field is empty or not. This may be
  674. // used to include empty fields in Patch requests.
  675. ForceSendFields []string `json:"-"`
  676. // NullFields is a list of field names (e.g. "AccountId") to include in
  677. // API requests with the JSON null value. By default, fields with empty
  678. // values are omitted from API requests. However, any field with an
  679. // empty value appearing in NullFields will be sent to the server as
  680. // null. It is an error if a field in this list has a non-empty value.
  681. // This may be used to include null fields in Patch requests.
  682. NullFields []string `json:"-"`
  683. }
  684. func (s *ContainerVersion) MarshalJSON() ([]byte, error) {
  685. type NoMethod ContainerVersion
  686. raw := NoMethod(*s)
  687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  688. }
  689. // ContainerVersionHeader: Represents a Google Tag Manager Container
  690. // Version Header.
  691. type ContainerVersionHeader struct {
  692. // AccountId: GTM Account ID.
  693. AccountId string `json:"accountId,omitempty"`
  694. // ContainerId: GTM Container ID.
  695. ContainerId string `json:"containerId,omitempty"`
  696. // ContainerVersionId: The Container Version ID uniquely identifies the
  697. // GTM Container Version.
  698. ContainerVersionId string `json:"containerVersionId,omitempty"`
  699. // Deleted: A value of true indicates this container version has been
  700. // deleted.
  701. Deleted bool `json:"deleted,omitempty"`
  702. // Name: Container version display name.
  703. Name string `json:"name,omitempty"`
  704. // NumCustomTemplates: Number of custom templates in the container
  705. // version.
  706. NumCustomTemplates string `json:"numCustomTemplates,omitempty"`
  707. // NumMacros: Number of macros in the container version.
  708. NumMacros string `json:"numMacros,omitempty"`
  709. // NumRules: Number of rules in the container version.
  710. NumRules string `json:"numRules,omitempty"`
  711. // NumTags: Number of tags in the container version.
  712. NumTags string `json:"numTags,omitempty"`
  713. // NumTriggers: Number of triggers in the container version.
  714. NumTriggers string `json:"numTriggers,omitempty"`
  715. // NumVariables: Number of variables in the container version.
  716. NumVariables string `json:"numVariables,omitempty"`
  717. // NumZones: Number of zones in the container version.
  718. NumZones string `json:"numZones,omitempty"`
  719. // Path: GTM Container Versions's API relative path.
  720. Path string `json:"path,omitempty"`
  721. // ServerResponse contains the HTTP response code and headers from the
  722. // server.
  723. googleapi.ServerResponse `json:"-"`
  724. // ForceSendFields is a list of field names (e.g. "AccountId") to
  725. // unconditionally include in API requests. By default, fields with
  726. // empty values are omitted from API requests. However, any non-pointer,
  727. // non-interface field appearing in ForceSendFields will be sent to the
  728. // server regardless of whether the field is empty or not. This may be
  729. // used to include empty fields in Patch requests.
  730. ForceSendFields []string `json:"-"`
  731. // NullFields is a list of field names (e.g. "AccountId") to include in
  732. // API requests with the JSON null value. By default, fields with empty
  733. // values are omitted from API requests. However, any field with an
  734. // empty value appearing in NullFields will be sent to the server as
  735. // null. It is an error if a field in this list has a non-empty value.
  736. // This may be used to include null fields in Patch requests.
  737. NullFields []string `json:"-"`
  738. }
  739. func (s *ContainerVersionHeader) MarshalJSON() ([]byte, error) {
  740. type NoMethod ContainerVersionHeader
  741. raw := NoMethod(*s)
  742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  743. }
  744. type CreateBuiltInVariableResponse struct {
  745. // BuiltInVariable: List of created built-in variables.
  746. BuiltInVariable []*BuiltInVariable `json:"builtInVariable,omitempty"`
  747. // ServerResponse contains the HTTP response code and headers from the
  748. // server.
  749. googleapi.ServerResponse `json:"-"`
  750. // ForceSendFields is a list of field names (e.g. "BuiltInVariable") to
  751. // unconditionally include in API requests. By default, fields with
  752. // empty values are omitted from API requests. However, any non-pointer,
  753. // non-interface field appearing in ForceSendFields will be sent to the
  754. // server regardless of whether the field is empty or not. This may be
  755. // used to include empty fields in Patch requests.
  756. ForceSendFields []string `json:"-"`
  757. // NullFields is a list of field names (e.g. "BuiltInVariable") to
  758. // include in API requests with the JSON null value. By default, fields
  759. // with empty values are omitted from API requests. However, any field
  760. // with an empty value appearing in NullFields will be sent to the
  761. // server as null. It is an error if a field in this list has a
  762. // non-empty value. This may be used to include null fields in Patch
  763. // requests.
  764. NullFields []string `json:"-"`
  765. }
  766. func (s *CreateBuiltInVariableResponse) MarshalJSON() ([]byte, error) {
  767. type NoMethod CreateBuiltInVariableResponse
  768. raw := NoMethod(*s)
  769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  770. }
  771. // CreateContainerVersionRequestVersionOptions: Options for new
  772. // container versions.
  773. type CreateContainerVersionRequestVersionOptions struct {
  774. // Name: The name of the container version to be created.
  775. Name string `json:"name,omitempty"`
  776. // Notes: The notes of the container version to be created.
  777. Notes string `json:"notes,omitempty"`
  778. // ForceSendFields is a list of field names (e.g. "Name") to
  779. // unconditionally include in API requests. By default, fields with
  780. // empty values are omitted from API requests. However, any non-pointer,
  781. // non-interface field appearing in ForceSendFields will be sent to the
  782. // server regardless of whether the field is empty or not. This may be
  783. // used to include empty fields in Patch requests.
  784. ForceSendFields []string `json:"-"`
  785. // NullFields is a list of field names (e.g. "Name") to include in API
  786. // requests with the JSON null value. By default, fields with empty
  787. // values are omitted from API requests. However, any field with an
  788. // empty value appearing in NullFields will be sent to the server as
  789. // null. It is an error if a field in this list has a non-empty value.
  790. // This may be used to include null fields in Patch requests.
  791. NullFields []string `json:"-"`
  792. }
  793. func (s *CreateContainerVersionRequestVersionOptions) MarshalJSON() ([]byte, error) {
  794. type NoMethod CreateContainerVersionRequestVersionOptions
  795. raw := NoMethod(*s)
  796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  797. }
  798. // CreateContainerVersionResponse: Create container versions response.
  799. type CreateContainerVersionResponse struct {
  800. // CompilerError: Compiler errors or not.
  801. CompilerError bool `json:"compilerError,omitempty"`
  802. // ContainerVersion: The container version created.
  803. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  804. // NewWorkspacePath: Auto generated workspace path created as a result
  805. // of version creation. This field should only be populated if the
  806. // created version was not a quick preview.
  807. NewWorkspacePath string `json:"newWorkspacePath,omitempty"`
  808. // SyncStatus: Whether version creation failed when syncing the
  809. // workspace to the latest container version.
  810. SyncStatus *SyncStatus `json:"syncStatus,omitempty"`
  811. // ServerResponse contains the HTTP response code and headers from the
  812. // server.
  813. googleapi.ServerResponse `json:"-"`
  814. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  815. // unconditionally include in API requests. By default, fields with
  816. // empty values are omitted from API requests. However, any non-pointer,
  817. // non-interface field appearing in ForceSendFields will be sent to the
  818. // server regardless of whether the field is empty or not. This may be
  819. // used to include empty fields in Patch requests.
  820. ForceSendFields []string `json:"-"`
  821. // NullFields is a list of field names (e.g. "CompilerError") to include
  822. // in API requests with the JSON null value. By default, fields with
  823. // empty values are omitted from API requests. However, any field with
  824. // an empty value appearing in NullFields will be sent to the server as
  825. // null. It is an error if a field in this list has a non-empty value.
  826. // This may be used to include null fields in Patch requests.
  827. NullFields []string `json:"-"`
  828. }
  829. func (s *CreateContainerVersionResponse) MarshalJSON() ([]byte, error) {
  830. type NoMethod CreateContainerVersionResponse
  831. raw := NoMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  833. }
  834. // CustomTemplate: Represents a Google Tag Manager Custom Template's
  835. // contents.
  836. type CustomTemplate struct {
  837. // AccountId: GTM Account ID.
  838. AccountId string `json:"accountId,omitempty"`
  839. // ContainerId: GTM Container ID.
  840. ContainerId string `json:"containerId,omitempty"`
  841. // Fingerprint: The fingerprint of the GTM Custom Template as computed
  842. // at storage time. This value is recomputed whenever the template is
  843. // modified.
  844. Fingerprint string `json:"fingerprint,omitempty"`
  845. // Name: Custom Template display name.
  846. Name string `json:"name,omitempty"`
  847. // Path: GTM Custom Template's API relative path.
  848. Path string `json:"path,omitempty"`
  849. // TagManagerUrl: Auto generated link to the tag manager UI
  850. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  851. // TemplateData: The custom template in text format.
  852. TemplateData string `json:"templateData,omitempty"`
  853. // TemplateId: The Custom Template ID uniquely identifies the GTM custom
  854. // template.
  855. TemplateId string `json:"templateId,omitempty"`
  856. // WorkspaceId: GTM Workspace ID.
  857. WorkspaceId string `json:"workspaceId,omitempty"`
  858. // ForceSendFields is a list of field names (e.g. "AccountId") to
  859. // unconditionally include in API requests. By default, fields with
  860. // empty values are omitted from API requests. However, any non-pointer,
  861. // non-interface field appearing in ForceSendFields will be sent to the
  862. // server regardless of whether the field is empty or not. This may be
  863. // used to include empty fields in Patch requests.
  864. ForceSendFields []string `json:"-"`
  865. // NullFields is a list of field names (e.g. "AccountId") to include in
  866. // API requests with the JSON null value. By default, fields with empty
  867. // values are omitted from API requests. However, any field with an
  868. // empty value appearing in NullFields will be sent to the server as
  869. // null. It is an error if a field in this list has a non-empty value.
  870. // This may be used to include null fields in Patch requests.
  871. NullFields []string `json:"-"`
  872. }
  873. func (s *CustomTemplate) MarshalJSON() ([]byte, error) {
  874. type NoMethod CustomTemplate
  875. raw := NoMethod(*s)
  876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  877. }
  878. // Entity: A workspace entity that may represent a tag, trigger,
  879. // variable, or folder in addition to its status in the workspace.
  880. type Entity struct {
  881. // ChangeStatus: Represents how the entity has been changed in the
  882. // workspace.
  883. //
  884. // Possible values:
  885. // "added"
  886. // "changeStatusUnspecified"
  887. // "deleted"
  888. // "none"
  889. // "updated"
  890. ChangeStatus string `json:"changeStatus,omitempty"`
  891. // Folder: The Folder being represented by the entity.
  892. Folder *Folder `json:"folder,omitempty"`
  893. // Tag: The tag being represented by the entity.
  894. Tag *Tag `json:"tag,omitempty"`
  895. // Trigger: The trigger being represented by the entity.
  896. Trigger *Trigger `json:"trigger,omitempty"`
  897. // Variable: The variable being represented by the entity.
  898. Variable *Variable `json:"variable,omitempty"`
  899. // ForceSendFields is a list of field names (e.g. "ChangeStatus") to
  900. // unconditionally include in API requests. By default, fields with
  901. // empty values are omitted from API requests. However, any non-pointer,
  902. // non-interface field appearing in ForceSendFields will be sent to the
  903. // server regardless of whether the field is empty or not. This may be
  904. // used to include empty fields in Patch requests.
  905. ForceSendFields []string `json:"-"`
  906. // NullFields is a list of field names (e.g. "ChangeStatus") to include
  907. // in API requests with the JSON null value. By default, fields with
  908. // empty values are omitted from API requests. However, any field with
  909. // an empty value appearing in NullFields will be sent to the server as
  910. // null. It is an error if a field in this list has a non-empty value.
  911. // This may be used to include null fields in Patch requests.
  912. NullFields []string `json:"-"`
  913. }
  914. func (s *Entity) MarshalJSON() ([]byte, error) {
  915. type NoMethod Entity
  916. raw := NoMethod(*s)
  917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  918. }
  919. // Environment: Represents a Google Tag Manager Environment. Note that a
  920. // user can create, delete and update environments of type USER, but can
  921. // only update the enable_debug and url fields of environments of other
  922. // types.
  923. type Environment struct {
  924. // AccountId: GTM Account ID.
  925. AccountId string `json:"accountId,omitempty"`
  926. // AuthorizationCode: The environment authorization code.
  927. AuthorizationCode string `json:"authorizationCode,omitempty"`
  928. // AuthorizationTimestamp: The last update time-stamp for the
  929. // authorization code.
  930. AuthorizationTimestamp *Timestamp `json:"authorizationTimestamp,omitempty"`
  931. // ContainerId: GTM Container ID.
  932. ContainerId string `json:"containerId,omitempty"`
  933. // ContainerVersionId: Represents a link to a container version.
  934. ContainerVersionId string `json:"containerVersionId,omitempty"`
  935. // Description: The environment description. Can be set or changed only
  936. // on USER type environments.
  937. Description string `json:"description,omitempty"`
  938. // EnableDebug: Whether or not to enable debug by default for the
  939. // environment.
  940. EnableDebug bool `json:"enableDebug,omitempty"`
  941. // EnvironmentId: GTM Environment ID uniquely identifies the GTM
  942. // Environment.
  943. EnvironmentId string `json:"environmentId,omitempty"`
  944. // Fingerprint: The fingerprint of the GTM environment as computed at
  945. // storage time. This value is recomputed whenever the environment is
  946. // modified.
  947. Fingerprint string `json:"fingerprint,omitempty"`
  948. // Name: The environment display name. Can be set or changed only on
  949. // USER type environments.
  950. Name string `json:"name,omitempty"`
  951. // Path: GTM Environment's API relative path.
  952. Path string `json:"path,omitempty"`
  953. // TagManagerUrl: Auto generated link to the tag manager UI
  954. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  955. // Type: The type of this environment.
  956. //
  957. // Possible values:
  958. // "latest"
  959. // "live"
  960. // "user"
  961. // "workspace"
  962. Type string `json:"type,omitempty"`
  963. // Url: Default preview page url for the environment.
  964. Url string `json:"url,omitempty"`
  965. // WorkspaceId: Represents a link to a quick preview of a workspace.
  966. WorkspaceId string `json:"workspaceId,omitempty"`
  967. // ServerResponse contains the HTTP response code and headers from the
  968. // server.
  969. googleapi.ServerResponse `json:"-"`
  970. // ForceSendFields is a list of field names (e.g. "AccountId") to
  971. // unconditionally include in API requests. By default, fields with
  972. // empty values are omitted from API requests. However, any non-pointer,
  973. // non-interface field appearing in ForceSendFields will be sent to the
  974. // server regardless of whether the field is empty or not. This may be
  975. // used to include empty fields in Patch requests.
  976. ForceSendFields []string `json:"-"`
  977. // NullFields is a list of field names (e.g. "AccountId") to include in
  978. // API requests with the JSON null value. By default, fields with empty
  979. // values are omitted from API requests. However, any field with an
  980. // empty value appearing in NullFields will be sent to the server as
  981. // null. It is an error if a field in this list has a non-empty value.
  982. // This may be used to include null fields in Patch requests.
  983. NullFields []string `json:"-"`
  984. }
  985. func (s *Environment) MarshalJSON() ([]byte, error) {
  986. type NoMethod Environment
  987. raw := NoMethod(*s)
  988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  989. }
  990. // Folder: Represents a Google Tag Manager Folder.
  991. type Folder struct {
  992. // AccountId: GTM Account ID.
  993. AccountId string `json:"accountId,omitempty"`
  994. // ContainerId: GTM Container ID.
  995. ContainerId string `json:"containerId,omitempty"`
  996. // Fingerprint: The fingerprint of the GTM Folder as computed at storage
  997. // time. This value is recomputed whenever the folder is modified.
  998. Fingerprint string `json:"fingerprint,omitempty"`
  999. // FolderId: The Folder ID uniquely identifies the GTM Folder.
  1000. FolderId string `json:"folderId,omitempty"`
  1001. // Name: Folder display name.
  1002. Name string `json:"name,omitempty"`
  1003. // Notes: User notes on how to apply this folder in the container.
  1004. Notes string `json:"notes,omitempty"`
  1005. // Path: GTM Folder's API relative path.
  1006. Path string `json:"path,omitempty"`
  1007. // TagManagerUrl: Auto generated link to the tag manager UI
  1008. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  1009. // WorkspaceId: GTM Workspace ID.
  1010. WorkspaceId string `json:"workspaceId,omitempty"`
  1011. // ServerResponse contains the HTTP response code and headers from the
  1012. // server.
  1013. googleapi.ServerResponse `json:"-"`
  1014. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1015. // unconditionally include in API requests. By default, fields with
  1016. // empty values are omitted from API requests. However, any non-pointer,
  1017. // non-interface field appearing in ForceSendFields will be sent to the
  1018. // server regardless of whether the field is empty or not. This may be
  1019. // used to include empty fields in Patch requests.
  1020. ForceSendFields []string `json:"-"`
  1021. // NullFields is a list of field names (e.g. "AccountId") to include in
  1022. // API requests with the JSON null value. By default, fields with empty
  1023. // values are omitted from API requests. However, any field with an
  1024. // empty value appearing in NullFields will be sent to the server as
  1025. // null. It is an error if a field in this list has a non-empty value.
  1026. // This may be used to include null fields in Patch requests.
  1027. NullFields []string `json:"-"`
  1028. }
  1029. func (s *Folder) MarshalJSON() ([]byte, error) {
  1030. type NoMethod Folder
  1031. raw := NoMethod(*s)
  1032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1033. }
  1034. // FolderEntities: Represents a Google Tag Manager Folder's contents.
  1035. type FolderEntities struct {
  1036. // NextPageToken: Continuation token for fetching the next page of
  1037. // results.
  1038. NextPageToken string `json:"nextPageToken,omitempty"`
  1039. // Tag: The list of tags inside the folder.
  1040. Tag []*Tag `json:"tag,omitempty"`
  1041. // Trigger: The list of triggers inside the folder.
  1042. Trigger []*Trigger `json:"trigger,omitempty"`
  1043. // Variable: The list of variables inside the folder.
  1044. Variable []*Variable `json:"variable,omitempty"`
  1045. // ServerResponse contains the HTTP response code and headers from the
  1046. // server.
  1047. googleapi.ServerResponse `json:"-"`
  1048. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1049. // unconditionally include in API requests. By default, fields with
  1050. // empty values are omitted from API requests. However, any non-pointer,
  1051. // non-interface field appearing in ForceSendFields will be sent to the
  1052. // server regardless of whether the field is empty or not. This may be
  1053. // used to include empty fields in Patch requests.
  1054. ForceSendFields []string `json:"-"`
  1055. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1056. // in API requests with the JSON null value. By default, fields with
  1057. // empty values are omitted from API requests. However, any field with
  1058. // an empty value appearing in NullFields will be sent to the server as
  1059. // null. It is an error if a field in this list has a non-empty value.
  1060. // This may be used to include null fields in Patch requests.
  1061. NullFields []string `json:"-"`
  1062. }
  1063. func (s *FolderEntities) MarshalJSON() ([]byte, error) {
  1064. type NoMethod FolderEntities
  1065. raw := NoMethod(*s)
  1066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1067. }
  1068. // GetWorkspaceStatusResponse: The changes that have occurred in the
  1069. // workspace since the base container version.
  1070. type GetWorkspaceStatusResponse struct {
  1071. // MergeConflict: The merge conflict after sync.
  1072. MergeConflict []*MergeConflict `json:"mergeConflict,omitempty"`
  1073. // WorkspaceChange: Entities that have been changed in the workspace.
  1074. WorkspaceChange []*Entity `json:"workspaceChange,omitempty"`
  1075. // ServerResponse contains the HTTP response code and headers from the
  1076. // server.
  1077. googleapi.ServerResponse `json:"-"`
  1078. // ForceSendFields is a list of field names (e.g. "MergeConflict") to
  1079. // unconditionally include in API requests. By default, fields with
  1080. // empty values are omitted from API requests. However, any non-pointer,
  1081. // non-interface field appearing in ForceSendFields will be sent to the
  1082. // server regardless of whether the field is empty or not. This may be
  1083. // used to include empty fields in Patch requests.
  1084. ForceSendFields []string `json:"-"`
  1085. // NullFields is a list of field names (e.g. "MergeConflict") to include
  1086. // in API requests with the JSON null value. By default, fields with
  1087. // empty values are omitted from API requests. However, any field with
  1088. // an empty value appearing in NullFields will be sent to the server as
  1089. // null. It is an error if a field in this list has a non-empty value.
  1090. // This may be used to include null fields in Patch requests.
  1091. NullFields []string `json:"-"`
  1092. }
  1093. func (s *GetWorkspaceStatusResponse) MarshalJSON() ([]byte, error) {
  1094. type NoMethod GetWorkspaceStatusResponse
  1095. raw := NoMethod(*s)
  1096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1097. }
  1098. // ListAccountsResponse: List Accounts Response.
  1099. type ListAccountsResponse struct {
  1100. // Account: List of GTM Accounts that a user has access to.
  1101. Account []*Account `json:"account,omitempty"`
  1102. // NextPageToken: Continuation token for fetching the next page of
  1103. // results.
  1104. NextPageToken string `json:"nextPageToken,omitempty"`
  1105. // ServerResponse contains the HTTP response code and headers from the
  1106. // server.
  1107. googleapi.ServerResponse `json:"-"`
  1108. // ForceSendFields is a list of field names (e.g. "Account") to
  1109. // unconditionally include in API requests. By default, fields with
  1110. // empty values are omitted from API requests. However, any non-pointer,
  1111. // non-interface field appearing in ForceSendFields will be sent to the
  1112. // server regardless of whether the field is empty or not. This may be
  1113. // used to include empty fields in Patch requests.
  1114. ForceSendFields []string `json:"-"`
  1115. // NullFields is a list of field names (e.g. "Account") to include in
  1116. // API requests with the JSON null value. By default, fields with empty
  1117. // values are omitted from API requests. However, any field with an
  1118. // empty value appearing in NullFields will be sent to the server as
  1119. // null. It is an error if a field in this list has a non-empty value.
  1120. // This may be used to include null fields in Patch requests.
  1121. NullFields []string `json:"-"`
  1122. }
  1123. func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
  1124. type NoMethod ListAccountsResponse
  1125. raw := NoMethod(*s)
  1126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1127. }
  1128. // ListContainerVersionsResponse: List container versions response.
  1129. type ListContainerVersionsResponse struct {
  1130. // ContainerVersionHeader: All container version headers of a GTM
  1131. // Container.
  1132. ContainerVersionHeader []*ContainerVersionHeader `json:"containerVersionHeader,omitempty"`
  1133. // NextPageToken: Continuation token for fetching the next page of
  1134. // results.
  1135. NextPageToken string `json:"nextPageToken,omitempty"`
  1136. // ServerResponse contains the HTTP response code and headers from the
  1137. // server.
  1138. googleapi.ServerResponse `json:"-"`
  1139. // ForceSendFields is a list of field names (e.g.
  1140. // "ContainerVersionHeader") to unconditionally include in API requests.
  1141. // By default, fields with empty values are omitted from API requests.
  1142. // However, any non-pointer, non-interface field appearing in
  1143. // ForceSendFields will be sent to the server regardless of whether the
  1144. // field is empty or not. This may be used to include empty fields in
  1145. // Patch requests.
  1146. ForceSendFields []string `json:"-"`
  1147. // NullFields is a list of field names (e.g. "ContainerVersionHeader")
  1148. // to include in API requests with the JSON null value. By default,
  1149. // fields with empty values are omitted from API requests. However, any
  1150. // field with an empty value appearing in NullFields will be sent to the
  1151. // server as null. It is an error if a field in this list has a
  1152. // non-empty value. This may be used to include null fields in Patch
  1153. // requests.
  1154. NullFields []string `json:"-"`
  1155. }
  1156. func (s *ListContainerVersionsResponse) MarshalJSON() ([]byte, error) {
  1157. type NoMethod ListContainerVersionsResponse
  1158. raw := NoMethod(*s)
  1159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1160. }
  1161. // ListContainersResponse: List Containers Response.
  1162. type ListContainersResponse struct {
  1163. // Container: All Containers of a GTM Account.
  1164. Container []*Container `json:"container,omitempty"`
  1165. // NextPageToken: Continuation token for fetching the next page of
  1166. // results.
  1167. NextPageToken string `json:"nextPageToken,omitempty"`
  1168. // ServerResponse contains the HTTP response code and headers from the
  1169. // server.
  1170. googleapi.ServerResponse `json:"-"`
  1171. // ForceSendFields is a list of field names (e.g. "Container") to
  1172. // unconditionally include in API requests. By default, fields with
  1173. // empty values are omitted from API requests. However, any non-pointer,
  1174. // non-interface field appearing in ForceSendFields will be sent to the
  1175. // server regardless of whether the field is empty or not. This may be
  1176. // used to include empty fields in Patch requests.
  1177. ForceSendFields []string `json:"-"`
  1178. // NullFields is a list of field names (e.g. "Container") to include in
  1179. // API requests with the JSON null value. By default, fields with empty
  1180. // values are omitted from API requests. However, any field with an
  1181. // empty value appearing in NullFields will be sent to the server as
  1182. // null. It is an error if a field in this list has a non-empty value.
  1183. // This may be used to include null fields in Patch requests.
  1184. NullFields []string `json:"-"`
  1185. }
  1186. func (s *ListContainersResponse) MarshalJSON() ([]byte, error) {
  1187. type NoMethod ListContainersResponse
  1188. raw := NoMethod(*s)
  1189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1190. }
  1191. // ListEnabledBuiltInVariablesResponse: A list of enabled built-in
  1192. // variables.
  1193. type ListEnabledBuiltInVariablesResponse struct {
  1194. // BuiltInVariable: All GTM BuiltInVariables of a GTM container.
  1195. BuiltInVariable []*BuiltInVariable `json:"builtInVariable,omitempty"`
  1196. // NextPageToken: Continuation token for fetching the next page of
  1197. // results.
  1198. NextPageToken string `json:"nextPageToken,omitempty"`
  1199. // ServerResponse contains the HTTP response code and headers from the
  1200. // server.
  1201. googleapi.ServerResponse `json:"-"`
  1202. // ForceSendFields is a list of field names (e.g. "BuiltInVariable") to
  1203. // unconditionally include in API requests. By default, fields with
  1204. // empty values are omitted from API requests. However, any non-pointer,
  1205. // non-interface field appearing in ForceSendFields will be sent to the
  1206. // server regardless of whether the field is empty or not. This may be
  1207. // used to include empty fields in Patch requests.
  1208. ForceSendFields []string `json:"-"`
  1209. // NullFields is a list of field names (e.g. "BuiltInVariable") to
  1210. // include in API requests with the JSON null value. By default, fields
  1211. // with empty values are omitted from API requests. However, any field
  1212. // with an empty value appearing in NullFields will be sent to the
  1213. // server as null. It is an error if a field in this list has a
  1214. // non-empty value. This may be used to include null fields in Patch
  1215. // requests.
  1216. NullFields []string `json:"-"`
  1217. }
  1218. func (s *ListEnabledBuiltInVariablesResponse) MarshalJSON() ([]byte, error) {
  1219. type NoMethod ListEnabledBuiltInVariablesResponse
  1220. raw := NoMethod(*s)
  1221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1222. }
  1223. // ListEnvironmentsResponse: List Environments Response.
  1224. type ListEnvironmentsResponse struct {
  1225. // Environment: All Environments of a GTM Container.
  1226. Environment []*Environment `json:"environment,omitempty"`
  1227. // NextPageToken: Continuation token for fetching the next page of
  1228. // results.
  1229. NextPageToken string `json:"nextPageToken,omitempty"`
  1230. // ServerResponse contains the HTTP response code and headers from the
  1231. // server.
  1232. googleapi.ServerResponse `json:"-"`
  1233. // ForceSendFields is a list of field names (e.g. "Environment") to
  1234. // unconditionally include in API requests. By default, fields with
  1235. // empty values are omitted from API requests. However, any non-pointer,
  1236. // non-interface field appearing in ForceSendFields will be sent to the
  1237. // server regardless of whether the field is empty or not. This may be
  1238. // used to include empty fields in Patch requests.
  1239. ForceSendFields []string `json:"-"`
  1240. // NullFields is a list of field names (e.g. "Environment") to include
  1241. // in API requests with the JSON null value. By default, fields with
  1242. // empty values are omitted from API requests. However, any field with
  1243. // an empty value appearing in NullFields will be sent to the server as
  1244. // null. It is an error if a field in this list has a non-empty value.
  1245. // This may be used to include null fields in Patch requests.
  1246. NullFields []string `json:"-"`
  1247. }
  1248. func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
  1249. type NoMethod ListEnvironmentsResponse
  1250. raw := NoMethod(*s)
  1251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1252. }
  1253. // ListFoldersResponse: List Folders Response.
  1254. type ListFoldersResponse struct {
  1255. // Folder: All GTM Folders of a GTM Container.
  1256. Folder []*Folder `json:"folder,omitempty"`
  1257. // NextPageToken: Continuation token for fetching the next page of
  1258. // results.
  1259. NextPageToken string `json:"nextPageToken,omitempty"`
  1260. // ServerResponse contains the HTTP response code and headers from the
  1261. // server.
  1262. googleapi.ServerResponse `json:"-"`
  1263. // ForceSendFields is a list of field names (e.g. "Folder") to
  1264. // unconditionally include in API requests. By default, fields with
  1265. // empty values are omitted from API requests. However, any non-pointer,
  1266. // non-interface field appearing in ForceSendFields will be sent to the
  1267. // server regardless of whether the field is empty or not. This may be
  1268. // used to include empty fields in Patch requests.
  1269. ForceSendFields []string `json:"-"`
  1270. // NullFields is a list of field names (e.g. "Folder") to include in API
  1271. // requests with the JSON null value. By default, fields with empty
  1272. // values are omitted from API requests. However, any field with an
  1273. // empty value appearing in NullFields will be sent to the server as
  1274. // null. It is an error if a field in this list has a non-empty value.
  1275. // This may be used to include null fields in Patch requests.
  1276. NullFields []string `json:"-"`
  1277. }
  1278. func (s *ListFoldersResponse) MarshalJSON() ([]byte, error) {
  1279. type NoMethod ListFoldersResponse
  1280. raw := NoMethod(*s)
  1281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1282. }
  1283. // ListTagsResponse: List Tags Response.
  1284. type ListTagsResponse struct {
  1285. // NextPageToken: Continuation token for fetching the next page of
  1286. // results.
  1287. NextPageToken string `json:"nextPageToken,omitempty"`
  1288. // Tag: All GTM Tags of a GTM Container.
  1289. Tag []*Tag `json:"tag,omitempty"`
  1290. // ServerResponse contains the HTTP response code and headers from the
  1291. // server.
  1292. googleapi.ServerResponse `json:"-"`
  1293. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1294. // unconditionally include in API requests. By default, fields with
  1295. // empty values are omitted from API requests. However, any non-pointer,
  1296. // non-interface field appearing in ForceSendFields will be sent to the
  1297. // server regardless of whether the field is empty or not. This may be
  1298. // used to include empty fields in Patch requests.
  1299. ForceSendFields []string `json:"-"`
  1300. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1301. // in API requests with the JSON null value. By default, fields with
  1302. // empty values are omitted from API requests. However, any field with
  1303. // an empty value appearing in NullFields will be sent to the server as
  1304. // null. It is an error if a field in this list has a non-empty value.
  1305. // This may be used to include null fields in Patch requests.
  1306. NullFields []string `json:"-"`
  1307. }
  1308. func (s *ListTagsResponse) MarshalJSON() ([]byte, error) {
  1309. type NoMethod ListTagsResponse
  1310. raw := NoMethod(*s)
  1311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1312. }
  1313. // ListTriggersResponse: List triggers response.
  1314. type ListTriggersResponse struct {
  1315. // NextPageToken: Continuation token for fetching the next page of
  1316. // results.
  1317. NextPageToken string `json:"nextPageToken,omitempty"`
  1318. // Trigger: All GTM Triggers of a GTM Container.
  1319. Trigger []*Trigger `json:"trigger,omitempty"`
  1320. // ServerResponse contains the HTTP response code and headers from the
  1321. // server.
  1322. googleapi.ServerResponse `json:"-"`
  1323. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1324. // unconditionally include in API requests. By default, fields with
  1325. // empty values are omitted from API requests. However, any non-pointer,
  1326. // non-interface field appearing in ForceSendFields will be sent to the
  1327. // server regardless of whether the field is empty or not. This may be
  1328. // used to include empty fields in Patch requests.
  1329. ForceSendFields []string `json:"-"`
  1330. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1331. // in API requests with the JSON null value. By default, fields with
  1332. // empty values are omitted from API requests. However, any field with
  1333. // an empty value appearing in NullFields will be sent to the server as
  1334. // null. It is an error if a field in this list has a non-empty value.
  1335. // This may be used to include null fields in Patch requests.
  1336. NullFields []string `json:"-"`
  1337. }
  1338. func (s *ListTriggersResponse) MarshalJSON() ([]byte, error) {
  1339. type NoMethod ListTriggersResponse
  1340. raw := NoMethod(*s)
  1341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1342. }
  1343. // ListUserPermissionsResponse: List user permissions response.
  1344. type ListUserPermissionsResponse struct {
  1345. // NextPageToken: Continuation token for fetching the next page of
  1346. // results.
  1347. NextPageToken string `json:"nextPageToken,omitempty"`
  1348. // UserPermission: All GTM UserPermissions of a GTM Account.
  1349. UserPermission []*UserPermission `json:"userPermission,omitempty"`
  1350. // ServerResponse contains the HTTP response code and headers from the
  1351. // server.
  1352. googleapi.ServerResponse `json:"-"`
  1353. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1354. // unconditionally include in API requests. By default, fields with
  1355. // empty values are omitted from API requests. However, any non-pointer,
  1356. // non-interface field appearing in ForceSendFields will be sent to the
  1357. // server regardless of whether the field is empty or not. This may be
  1358. // used to include empty fields in Patch requests.
  1359. ForceSendFields []string `json:"-"`
  1360. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1361. // in API requests with the JSON null value. By default, fields with
  1362. // empty values are omitted from API requests. However, any field with
  1363. // an empty value appearing in NullFields will be sent to the server as
  1364. // null. It is an error if a field in this list has a non-empty value.
  1365. // This may be used to include null fields in Patch requests.
  1366. NullFields []string `json:"-"`
  1367. }
  1368. func (s *ListUserPermissionsResponse) MarshalJSON() ([]byte, error) {
  1369. type NoMethod ListUserPermissionsResponse
  1370. raw := NoMethod(*s)
  1371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1372. }
  1373. // ListVariablesResponse: List Variables Response.
  1374. type ListVariablesResponse struct {
  1375. // NextPageToken: Continuation token for fetching the next page of
  1376. // results.
  1377. NextPageToken string `json:"nextPageToken,omitempty"`
  1378. // Variable: All GTM Variables of a GTM Container.
  1379. Variable []*Variable `json:"variable,omitempty"`
  1380. // ServerResponse contains the HTTP response code and headers from the
  1381. // server.
  1382. googleapi.ServerResponse `json:"-"`
  1383. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1384. // unconditionally include in API requests. By default, fields with
  1385. // empty values are omitted from API requests. However, any non-pointer,
  1386. // non-interface field appearing in ForceSendFields will be sent to the
  1387. // server regardless of whether the field is empty or not. This may be
  1388. // used to include empty fields in Patch requests.
  1389. ForceSendFields []string `json:"-"`
  1390. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1391. // in API requests with the JSON null value. By default, fields with
  1392. // empty values are omitted from API requests. However, any field with
  1393. // an empty value appearing in NullFields will be sent to the server as
  1394. // null. It is an error if a field in this list has a non-empty value.
  1395. // This may be used to include null fields in Patch requests.
  1396. NullFields []string `json:"-"`
  1397. }
  1398. func (s *ListVariablesResponse) MarshalJSON() ([]byte, error) {
  1399. type NoMethod ListVariablesResponse
  1400. raw := NoMethod(*s)
  1401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402. }
  1403. // ListWorkspacesResponse: A list of workspaces in a container.
  1404. type ListWorkspacesResponse struct {
  1405. // NextPageToken: Continuation token for fetching the next page of
  1406. // results.
  1407. NextPageToken string `json:"nextPageToken,omitempty"`
  1408. // Workspace: All Workspaces of a GTM Container.
  1409. Workspace []*Workspace `json:"workspace,omitempty"`
  1410. // ServerResponse contains the HTTP response code and headers from the
  1411. // server.
  1412. googleapi.ServerResponse `json:"-"`
  1413. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1414. // unconditionally include in API requests. By default, fields with
  1415. // empty values are omitted from API requests. However, any non-pointer,
  1416. // non-interface field appearing in ForceSendFields will be sent to the
  1417. // server regardless of whether the field is empty or not. This may be
  1418. // used to include empty fields in Patch requests.
  1419. ForceSendFields []string `json:"-"`
  1420. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1421. // in API requests with the JSON null value. By default, fields with
  1422. // empty values are omitted from API requests. However, any field with
  1423. // an empty value appearing in NullFields will be sent to the server as
  1424. // null. It is an error if a field in this list has a non-empty value.
  1425. // This may be used to include null fields in Patch requests.
  1426. NullFields []string `json:"-"`
  1427. }
  1428. func (s *ListWorkspacesResponse) MarshalJSON() ([]byte, error) {
  1429. type NoMethod ListWorkspacesResponse
  1430. raw := NoMethod(*s)
  1431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1432. }
  1433. type ListZonesResponse struct {
  1434. // NextPageToken: Continuation token for fetching the next page of
  1435. // results.
  1436. NextPageToken string `json:"nextPageToken,omitempty"`
  1437. // Zone: All GTM Zones of a GTM Container.
  1438. Zone []*Zone `json:"zone,omitempty"`
  1439. // ServerResponse contains the HTTP response code and headers from the
  1440. // server.
  1441. googleapi.ServerResponse `json:"-"`
  1442. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1443. // unconditionally include in API requests. By default, fields with
  1444. // empty values are omitted from API requests. However, any non-pointer,
  1445. // non-interface field appearing in ForceSendFields will be sent to the
  1446. // server regardless of whether the field is empty or not. This may be
  1447. // used to include empty fields in Patch requests.
  1448. ForceSendFields []string `json:"-"`
  1449. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1450. // in API requests with the JSON null value. By default, fields with
  1451. // empty values are omitted from API requests. However, any field with
  1452. // an empty value appearing in NullFields will be sent to the server as
  1453. // null. It is an error if a field in this list has a non-empty value.
  1454. // This may be used to include null fields in Patch requests.
  1455. NullFields []string `json:"-"`
  1456. }
  1457. func (s *ListZonesResponse) MarshalJSON() ([]byte, error) {
  1458. type NoMethod ListZonesResponse
  1459. raw := NoMethod(*s)
  1460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1461. }
  1462. // MergeConflict: Represents a merge conflict.
  1463. type MergeConflict struct {
  1464. // EntityInBaseVersion: The base version entity (since the latest sync
  1465. // operation) that has conflicting changes compared to the workspace. If
  1466. // this field is missing, it means the workspace entity is deleted from
  1467. // the base version.
  1468. EntityInBaseVersion *Entity `json:"entityInBaseVersion,omitempty"`
  1469. // EntityInWorkspace: The workspace entity that has conflicting changes
  1470. // compared to the base version. If an entity is deleted in a workspace,
  1471. // it will still appear with a deleted change status.
  1472. EntityInWorkspace *Entity `json:"entityInWorkspace,omitempty"`
  1473. // ForceSendFields is a list of field names (e.g. "EntityInBaseVersion")
  1474. // to unconditionally include in API requests. By default, fields with
  1475. // empty values are omitted from API requests. However, any non-pointer,
  1476. // non-interface field appearing in ForceSendFields will be sent to the
  1477. // server regardless of whether the field is empty or not. This may be
  1478. // used to include empty fields in Patch requests.
  1479. ForceSendFields []string `json:"-"`
  1480. // NullFields is a list of field names (e.g. "EntityInBaseVersion") to
  1481. // include in API requests with the JSON null value. By default, fields
  1482. // with empty values are omitted from API requests. However, any field
  1483. // with an empty value appearing in NullFields will be sent to the
  1484. // server as null. It is an error if a field in this list has a
  1485. // non-empty value. This may be used to include null fields in Patch
  1486. // requests.
  1487. NullFields []string `json:"-"`
  1488. }
  1489. func (s *MergeConflict) MarshalJSON() ([]byte, error) {
  1490. type NoMethod MergeConflict
  1491. raw := NoMethod(*s)
  1492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1493. }
  1494. // Parameter: Represents a Google Tag Manager Parameter.
  1495. type Parameter struct {
  1496. // Key: The named key that uniquely identifies a parameter. Required for
  1497. // top-level parameters, as well as map values. Ignored for list values.
  1498. Key string `json:"key,omitempty"`
  1499. // List: This list parameter's parameters (keys will be ignored).
  1500. List []*Parameter `json:"list,omitempty"`
  1501. // Map: This map parameter's parameters (must have keys; keys must be
  1502. // unique).
  1503. Map []*Parameter `json:"map,omitempty"`
  1504. // Type: The parameter type. Valid values are:
  1505. // - boolean: The value represents a boolean, represented as 'true' or
  1506. // 'false'
  1507. // - integer: The value represents a 64-bit signed integer value, in
  1508. // base 10
  1509. // - list: A list of parameters should be specified
  1510. // - map: A map of parameters should be specified
  1511. // - template: The value represents any text; this can include variable
  1512. // references (even variable references that might return non-string
  1513. // types)
  1514. //
  1515. // Possible values:
  1516. // "boolean"
  1517. // "integer"
  1518. // "list"
  1519. // "map"
  1520. // "template"
  1521. // "typeUnspecified"
  1522. Type string `json:"type,omitempty"`
  1523. // Value: A parameter's value (may contain variable references such as
  1524. // "{{myVariable}}") as appropriate to the specified type.
  1525. Value string `json:"value,omitempty"`
  1526. // ForceSendFields is a list of field names (e.g. "Key") to
  1527. // unconditionally include in API requests. By default, fields with
  1528. // empty values are omitted from API requests. However, any non-pointer,
  1529. // non-interface field appearing in ForceSendFields will be sent to the
  1530. // server regardless of whether the field is empty or not. This may be
  1531. // used to include empty fields in Patch requests.
  1532. ForceSendFields []string `json:"-"`
  1533. // NullFields is a list of field names (e.g. "Key") to include in API
  1534. // requests with the JSON null value. By default, fields with empty
  1535. // values are omitted from API requests. However, any field with an
  1536. // empty value appearing in NullFields will be sent to the server as
  1537. // null. It is an error if a field in this list has a non-empty value.
  1538. // This may be used to include null fields in Patch requests.
  1539. NullFields []string `json:"-"`
  1540. }
  1541. func (s *Parameter) MarshalJSON() ([]byte, error) {
  1542. type NoMethod Parameter
  1543. raw := NoMethod(*s)
  1544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1545. }
  1546. // PublishContainerVersionResponse: Publish container version response.
  1547. type PublishContainerVersionResponse struct {
  1548. // CompilerError: Compiler errors or not.
  1549. CompilerError bool `json:"compilerError,omitempty"`
  1550. // ContainerVersion: The container version created.
  1551. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  1552. // ServerResponse contains the HTTP response code and headers from the
  1553. // server.
  1554. googleapi.ServerResponse `json:"-"`
  1555. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  1556. // unconditionally include in API requests. By default, fields with
  1557. // empty values are omitted from API requests. However, any non-pointer,
  1558. // non-interface field appearing in ForceSendFields will be sent to the
  1559. // server regardless of whether the field is empty or not. This may be
  1560. // used to include empty fields in Patch requests.
  1561. ForceSendFields []string `json:"-"`
  1562. // NullFields is a list of field names (e.g. "CompilerError") to include
  1563. // in API requests with the JSON null value. By default, fields with
  1564. // empty values are omitted from API requests. However, any field with
  1565. // an empty value appearing in NullFields will be sent to the server as
  1566. // null. It is an error if a field in this list has a non-empty value.
  1567. // This may be used to include null fields in Patch requests.
  1568. NullFields []string `json:"-"`
  1569. }
  1570. func (s *PublishContainerVersionResponse) MarshalJSON() ([]byte, error) {
  1571. type NoMethod PublishContainerVersionResponse
  1572. raw := NoMethod(*s)
  1573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1574. }
  1575. // QuickPreviewResponse: Response to quick previewing a workspace.
  1576. type QuickPreviewResponse struct {
  1577. // CompilerError: Were there compiler errors or not.
  1578. CompilerError bool `json:"compilerError,omitempty"`
  1579. // ContainerVersion: The quick previewed container version.
  1580. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  1581. // SyncStatus: Whether quick previewing failed when syncing the
  1582. // workspace to the latest container version.
  1583. SyncStatus *SyncStatus `json:"syncStatus,omitempty"`
  1584. // ServerResponse contains the HTTP response code and headers from the
  1585. // server.
  1586. googleapi.ServerResponse `json:"-"`
  1587. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  1588. // unconditionally include in API requests. By default, fields with
  1589. // empty values are omitted from API requests. However, any non-pointer,
  1590. // non-interface field appearing in ForceSendFields will be sent to the
  1591. // server regardless of whether the field is empty or not. This may be
  1592. // used to include empty fields in Patch requests.
  1593. ForceSendFields []string `json:"-"`
  1594. // NullFields is a list of field names (e.g. "CompilerError") to include
  1595. // in API requests with the JSON null value. By default, fields with
  1596. // empty values are omitted from API requests. However, any field with
  1597. // an empty value appearing in NullFields will be sent to the server as
  1598. // null. It is an error if a field in this list has a non-empty value.
  1599. // This may be used to include null fields in Patch requests.
  1600. NullFields []string `json:"-"`
  1601. }
  1602. func (s *QuickPreviewResponse) MarshalJSON() ([]byte, error) {
  1603. type NoMethod QuickPreviewResponse
  1604. raw := NoMethod(*s)
  1605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1606. }
  1607. // RevertBuiltInVariableResponse: The result of reverting a built-in
  1608. // variable in a workspace.
  1609. type RevertBuiltInVariableResponse struct {
  1610. // Enabled: Whether the built-in variable is enabled after reversion.
  1611. Enabled bool `json:"enabled,omitempty"`
  1612. // ServerResponse contains the HTTP response code and headers from the
  1613. // server.
  1614. googleapi.ServerResponse `json:"-"`
  1615. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1616. // unconditionally include in API requests. By default, fields with
  1617. // empty values are omitted from API requests. However, any non-pointer,
  1618. // non-interface field appearing in ForceSendFields will be sent to the
  1619. // server regardless of whether the field is empty or not. This may be
  1620. // used to include empty fields in Patch requests.
  1621. ForceSendFields []string `json:"-"`
  1622. // NullFields is a list of field names (e.g. "Enabled") to include in
  1623. // API requests with the JSON null value. By default, fields with empty
  1624. // values are omitted from API requests. However, any field with an
  1625. // empty value appearing in NullFields will be sent to the server as
  1626. // null. It is an error if a field in this list has a non-empty value.
  1627. // This may be used to include null fields in Patch requests.
  1628. NullFields []string `json:"-"`
  1629. }
  1630. func (s *RevertBuiltInVariableResponse) MarshalJSON() ([]byte, error) {
  1631. type NoMethod RevertBuiltInVariableResponse
  1632. raw := NoMethod(*s)
  1633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1634. }
  1635. // RevertFolderResponse: The result of reverting folder changes in a
  1636. // workspace.
  1637. type RevertFolderResponse struct {
  1638. // Folder: Folder as it appears in the latest container version since
  1639. // the last workspace synchronization operation. If no folder is
  1640. // present, that means the folder was deleted in the latest container
  1641. // version.
  1642. Folder *Folder `json:"folder,omitempty"`
  1643. // ServerResponse contains the HTTP response code and headers from the
  1644. // server.
  1645. googleapi.ServerResponse `json:"-"`
  1646. // ForceSendFields is a list of field names (e.g. "Folder") to
  1647. // unconditionally include in API requests. By default, fields with
  1648. // empty values are omitted from API requests. However, any non-pointer,
  1649. // non-interface field appearing in ForceSendFields will be sent to the
  1650. // server regardless of whether the field is empty or not. This may be
  1651. // used to include empty fields in Patch requests.
  1652. ForceSendFields []string `json:"-"`
  1653. // NullFields is a list of field names (e.g. "Folder") to include in API
  1654. // requests with the JSON null value. By default, fields with empty
  1655. // values are omitted from API requests. However, any field with an
  1656. // empty value appearing in NullFields will be sent to the server as
  1657. // null. It is an error if a field in this list has a non-empty value.
  1658. // This may be used to include null fields in Patch requests.
  1659. NullFields []string `json:"-"`
  1660. }
  1661. func (s *RevertFolderResponse) MarshalJSON() ([]byte, error) {
  1662. type NoMethod RevertFolderResponse
  1663. raw := NoMethod(*s)
  1664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1665. }
  1666. // RevertTagResponse: The result of reverting a tag in a workspace.
  1667. type RevertTagResponse struct {
  1668. // Tag: Tag as it appears in the latest container version since the last
  1669. // workspace synchronization operation. If no tag is present, that means
  1670. // the tag was deleted in the latest container version.
  1671. Tag *Tag `json:"tag,omitempty"`
  1672. // ServerResponse contains the HTTP response code and headers from the
  1673. // server.
  1674. googleapi.ServerResponse `json:"-"`
  1675. // ForceSendFields is a list of field names (e.g. "Tag") to
  1676. // unconditionally include in API requests. By default, fields with
  1677. // empty values are omitted from API requests. However, any non-pointer,
  1678. // non-interface field appearing in ForceSendFields will be sent to the
  1679. // server regardless of whether the field is empty or not. This may be
  1680. // used to include empty fields in Patch requests.
  1681. ForceSendFields []string `json:"-"`
  1682. // NullFields is a list of field names (e.g. "Tag") to include in API
  1683. // requests with the JSON null value. By default, fields with empty
  1684. // values are omitted from API requests. However, any field with an
  1685. // empty value appearing in NullFields will be sent to the server as
  1686. // null. It is an error if a field in this list has a non-empty value.
  1687. // This may be used to include null fields in Patch requests.
  1688. NullFields []string `json:"-"`
  1689. }
  1690. func (s *RevertTagResponse) MarshalJSON() ([]byte, error) {
  1691. type NoMethod RevertTagResponse
  1692. raw := NoMethod(*s)
  1693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1694. }
  1695. // RevertTriggerResponse: The result of reverting a trigger in a
  1696. // workspace.
  1697. type RevertTriggerResponse struct {
  1698. // Trigger: Trigger as it appears in the latest container version since
  1699. // the last workspace synchronization operation. If no trigger is
  1700. // present, that means the trigger was deleted in the latest container
  1701. // version.
  1702. Trigger *Trigger `json:"trigger,omitempty"`
  1703. // ServerResponse contains the HTTP response code and headers from the
  1704. // server.
  1705. googleapi.ServerResponse `json:"-"`
  1706. // ForceSendFields is a list of field names (e.g. "Trigger") to
  1707. // unconditionally include in API requests. By default, fields with
  1708. // empty values are omitted from API requests. However, any non-pointer,
  1709. // non-interface field appearing in ForceSendFields will be sent to the
  1710. // server regardless of whether the field is empty or not. This may be
  1711. // used to include empty fields in Patch requests.
  1712. ForceSendFields []string `json:"-"`
  1713. // NullFields is a list of field names (e.g. "Trigger") to include in
  1714. // API requests with the JSON null value. By default, fields with empty
  1715. // values are omitted from API requests. However, any field with an
  1716. // empty value appearing in NullFields will be sent to the server as
  1717. // null. It is an error if a field in this list has a non-empty value.
  1718. // This may be used to include null fields in Patch requests.
  1719. NullFields []string `json:"-"`
  1720. }
  1721. func (s *RevertTriggerResponse) MarshalJSON() ([]byte, error) {
  1722. type NoMethod RevertTriggerResponse
  1723. raw := NoMethod(*s)
  1724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1725. }
  1726. // RevertVariableResponse: The result of reverting a variable in a
  1727. // workspace.
  1728. type RevertVariableResponse struct {
  1729. // Variable: Variable as it appears in the latest container version
  1730. // since the last workspace synchronization operation. If no variable is
  1731. // present, that means the variable was deleted in the latest container
  1732. // version.
  1733. Variable *Variable `json:"variable,omitempty"`
  1734. // ServerResponse contains the HTTP response code and headers from the
  1735. // server.
  1736. googleapi.ServerResponse `json:"-"`
  1737. // ForceSendFields is a list of field names (e.g. "Variable") to
  1738. // unconditionally include in API requests. By default, fields with
  1739. // empty values are omitted from API requests. However, any non-pointer,
  1740. // non-interface field appearing in ForceSendFields will be sent to the
  1741. // server regardless of whether the field is empty or not. This may be
  1742. // used to include empty fields in Patch requests.
  1743. ForceSendFields []string `json:"-"`
  1744. // NullFields is a list of field names (e.g. "Variable") to include in
  1745. // API requests with the JSON null value. By default, fields with empty
  1746. // values are omitted from API requests. However, any field with an
  1747. // empty value appearing in NullFields will be sent to the server as
  1748. // null. It is an error if a field in this list has a non-empty value.
  1749. // This may be used to include null fields in Patch requests.
  1750. NullFields []string `json:"-"`
  1751. }
  1752. func (s *RevertVariableResponse) MarshalJSON() ([]byte, error) {
  1753. type NoMethod RevertVariableResponse
  1754. raw := NoMethod(*s)
  1755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1756. }
  1757. // RevertZoneResponse: The result of reverting a zone in a workspace.
  1758. type RevertZoneResponse struct {
  1759. // Zone: Zone as it appears in the latest container version since the
  1760. // last workspace synchronization operation. If no zone is present, that
  1761. // means the zone was deleted in the latest container version.
  1762. Zone *Zone `json:"zone,omitempty"`
  1763. // ServerResponse contains the HTTP response code and headers from the
  1764. // server.
  1765. googleapi.ServerResponse `json:"-"`
  1766. // ForceSendFields is a list of field names (e.g. "Zone") to
  1767. // unconditionally include in API requests. By default, fields with
  1768. // empty values are omitted from API requests. However, any non-pointer,
  1769. // non-interface field appearing in ForceSendFields will be sent to the
  1770. // server regardless of whether the field is empty or not. This may be
  1771. // used to include empty fields in Patch requests.
  1772. ForceSendFields []string `json:"-"`
  1773. // NullFields is a list of field names (e.g. "Zone") to include in API
  1774. // requests with the JSON null value. By default, fields with empty
  1775. // values are omitted from API requests. However, any field with an
  1776. // empty value appearing in NullFields will be sent to the server as
  1777. // null. It is an error if a field in this list has a non-empty value.
  1778. // This may be used to include null fields in Patch requests.
  1779. NullFields []string `json:"-"`
  1780. }
  1781. func (s *RevertZoneResponse) MarshalJSON() ([]byte, error) {
  1782. type NoMethod RevertZoneResponse
  1783. raw := NoMethod(*s)
  1784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1785. }
  1786. // SetupTag: Represents a reference to atag that fires before another
  1787. // tag in order to set up dependencies.
  1788. type SetupTag struct {
  1789. // StopOnSetupFailure: If true, fire the main tag if and only if the
  1790. // setup tag fires successfully. If false, fire the main tag regardless
  1791. // of setup tag firing status.
  1792. StopOnSetupFailure bool `json:"stopOnSetupFailure,omitempty"`
  1793. // TagName: The name of the setup tag.
  1794. TagName string `json:"tagName,omitempty"`
  1795. // ForceSendFields is a list of field names (e.g. "StopOnSetupFailure")
  1796. // to unconditionally include in API requests. By default, fields with
  1797. // empty values are omitted from API requests. However, any non-pointer,
  1798. // non-interface field appearing in ForceSendFields will be sent to the
  1799. // server regardless of whether the field is empty or not. This may be
  1800. // used to include empty fields in Patch requests.
  1801. ForceSendFields []string `json:"-"`
  1802. // NullFields is a list of field names (e.g. "StopOnSetupFailure") to
  1803. // include in API requests with the JSON null value. By default, fields
  1804. // with empty values are omitted from API requests. However, any field
  1805. // with an empty value appearing in NullFields will be sent to the
  1806. // server as null. It is an error if a field in this list has a
  1807. // non-empty value. This may be used to include null fields in Patch
  1808. // requests.
  1809. NullFields []string `json:"-"`
  1810. }
  1811. func (s *SetupTag) MarshalJSON() ([]byte, error) {
  1812. type NoMethod SetupTag
  1813. raw := NoMethod(*s)
  1814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1815. }
  1816. // SyncStatus: The status of a workspace after synchronization.
  1817. type SyncStatus struct {
  1818. // MergeConflict: Synchornization operation detected a merge conflict.
  1819. MergeConflict bool `json:"mergeConflict,omitempty"`
  1820. // SyncError: An error occurred during the synchronization operation.
  1821. SyncError bool `json:"syncError,omitempty"`
  1822. // ForceSendFields is a list of field names (e.g. "MergeConflict") to
  1823. // unconditionally include in API requests. By default, fields with
  1824. // empty values are omitted from API requests. However, any non-pointer,
  1825. // non-interface field appearing in ForceSendFields will be sent to the
  1826. // server regardless of whether the field is empty or not. This may be
  1827. // used to include empty fields in Patch requests.
  1828. ForceSendFields []string `json:"-"`
  1829. // NullFields is a list of field names (e.g. "MergeConflict") to include
  1830. // in API requests with the JSON null value. By default, fields with
  1831. // empty values are omitted from API requests. However, any field with
  1832. // an empty value appearing in NullFields will be sent to the server as
  1833. // null. It is an error if a field in this list has a non-empty value.
  1834. // This may be used to include null fields in Patch requests.
  1835. NullFields []string `json:"-"`
  1836. }
  1837. func (s *SyncStatus) MarshalJSON() ([]byte, error) {
  1838. type NoMethod SyncStatus
  1839. raw := NoMethod(*s)
  1840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1841. }
  1842. // SyncWorkspaceResponse: A response after synchronizing the workspace
  1843. // to the latest container version.
  1844. type SyncWorkspaceResponse struct {
  1845. // MergeConflict: The merge conflict after sync. If this field is not
  1846. // empty, the sync is still treated as successful. But a version cannot
  1847. // be created until all conflicts are resolved.
  1848. MergeConflict []*MergeConflict `json:"mergeConflict,omitempty"`
  1849. // SyncStatus: Indicates whether synchronization caused a merge conflict
  1850. // or sync error.
  1851. SyncStatus *SyncStatus `json:"syncStatus,omitempty"`
  1852. // ServerResponse contains the HTTP response code and headers from the
  1853. // server.
  1854. googleapi.ServerResponse `json:"-"`
  1855. // ForceSendFields is a list of field names (e.g. "MergeConflict") to
  1856. // unconditionally include in API requests. By default, fields with
  1857. // empty values are omitted from API requests. However, any non-pointer,
  1858. // non-interface field appearing in ForceSendFields will be sent to the
  1859. // server regardless of whether the field is empty or not. This may be
  1860. // used to include empty fields in Patch requests.
  1861. ForceSendFields []string `json:"-"`
  1862. // NullFields is a list of field names (e.g. "MergeConflict") to include
  1863. // in API requests with the JSON null value. By default, fields with
  1864. // empty values are omitted from API requests. However, any field with
  1865. // an empty value appearing in NullFields will be sent to the server as
  1866. // null. It is an error if a field in this list has a non-empty value.
  1867. // This may be used to include null fields in Patch requests.
  1868. NullFields []string `json:"-"`
  1869. }
  1870. func (s *SyncWorkspaceResponse) MarshalJSON() ([]byte, error) {
  1871. type NoMethod SyncWorkspaceResponse
  1872. raw := NoMethod(*s)
  1873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1874. }
  1875. // Tag: Represents a Google Tag Manager Tag.
  1876. type Tag struct {
  1877. // AccountId: GTM Account ID.
  1878. AccountId string `json:"accountId,omitempty"`
  1879. // BlockingRuleId: Blocking rule IDs. If any of the listed rules
  1880. // evaluate to true, the tag will not fire.
  1881. BlockingRuleId []string `json:"blockingRuleId,omitempty"`
  1882. // BlockingTriggerId: Blocking trigger IDs. If any of the listed
  1883. // triggers evaluate to true, the tag will not fire.
  1884. BlockingTriggerId []string `json:"blockingTriggerId,omitempty"`
  1885. // ContainerId: GTM Container ID.
  1886. ContainerId string `json:"containerId,omitempty"`
  1887. // Fingerprint: The fingerprint of the GTM Tag as computed at storage
  1888. // time. This value is recomputed whenever the tag is modified.
  1889. Fingerprint string `json:"fingerprint,omitempty"`
  1890. // FiringRuleId: Firing rule IDs. A tag will fire when any of the listed
  1891. // rules are true and all of its blockingRuleIds (if any specified) are
  1892. // false.
  1893. FiringRuleId []string `json:"firingRuleId,omitempty"`
  1894. // FiringTriggerId: Firing trigger IDs. A tag will fire when any of the
  1895. // listed triggers are true and all of its blockingTriggerIds (if any
  1896. // specified) are false.
  1897. FiringTriggerId []string `json:"firingTriggerId,omitempty"`
  1898. // LiveOnly: If set to true, this tag will only fire in the live
  1899. // environment (e.g. not in preview or debug mode).
  1900. LiveOnly bool `json:"liveOnly,omitempty"`
  1901. // Name: Tag display name.
  1902. Name string `json:"name,omitempty"`
  1903. // Notes: User notes on how to apply this tag in the container.
  1904. Notes string `json:"notes,omitempty"`
  1905. // Parameter: The tag's parameters.
  1906. Parameter []*Parameter `json:"parameter,omitempty"`
  1907. // ParentFolderId: Parent folder id.
  1908. ParentFolderId string `json:"parentFolderId,omitempty"`
  1909. // Path: GTM Tag's API relative path.
  1910. Path string `json:"path,omitempty"`
  1911. // Paused: Indicates whether the tag is paused, which prevents the tag
  1912. // from firing.
  1913. Paused bool `json:"paused,omitempty"`
  1914. // Priority: User defined numeric priority of the tag. Tags are fired
  1915. // asynchronously in order of priority. Tags with higher numeric value
  1916. // fire first. A tag's priority can be a positive or negative value. The
  1917. // default value is 0.
  1918. Priority *Parameter `json:"priority,omitempty"`
  1919. // ScheduleEndMs: The end timestamp in milliseconds to schedule a tag.
  1920. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  1921. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  1922. // tag.
  1923. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  1924. // SetupTag: The list of setup tags. Currently we only allow one.
  1925. SetupTag []*SetupTag `json:"setupTag,omitempty"`
  1926. // TagFiringOption: Option to fire this tag.
  1927. //
  1928. // Possible values:
  1929. // "oncePerEvent"
  1930. // "oncePerLoad"
  1931. // "tagFiringOptionUnspecified"
  1932. // "unlimited"
  1933. TagFiringOption string `json:"tagFiringOption,omitempty"`
  1934. // TagId: The Tag ID uniquely identifies the GTM Tag.
  1935. TagId string `json:"tagId,omitempty"`
  1936. // TagManagerUrl: Auto generated link to the tag manager UI
  1937. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  1938. // TeardownTag: The list of teardown tags. Currently we only allow one.
  1939. TeardownTag []*TeardownTag `json:"teardownTag,omitempty"`
  1940. // Type: GTM Tag Type.
  1941. Type string `json:"type,omitempty"`
  1942. // WorkspaceId: GTM Workspace ID.
  1943. WorkspaceId string `json:"workspaceId,omitempty"`
  1944. // ServerResponse contains the HTTP response code and headers from the
  1945. // server.
  1946. googleapi.ServerResponse `json:"-"`
  1947. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1948. // unconditionally include in API requests. By default, fields with
  1949. // empty values are omitted from API requests. However, any non-pointer,
  1950. // non-interface field appearing in ForceSendFields will be sent to the
  1951. // server regardless of whether the field is empty or not. This may be
  1952. // used to include empty fields in Patch requests.
  1953. ForceSendFields []string `json:"-"`
  1954. // NullFields is a list of field names (e.g. "AccountId") to include in
  1955. // API requests with the JSON null value. By default, fields with empty
  1956. // values are omitted from API requests. However, any field with an
  1957. // empty value appearing in NullFields will be sent to the server as
  1958. // null. It is an error if a field in this list has a non-empty value.
  1959. // This may be used to include null fields in Patch requests.
  1960. NullFields []string `json:"-"`
  1961. }
  1962. func (s *Tag) MarshalJSON() ([]byte, error) {
  1963. type NoMethod Tag
  1964. raw := NoMethod(*s)
  1965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1966. }
  1967. // TeardownTag: Represents a tag that fires after another tag in order
  1968. // to tear down dependencies.
  1969. type TeardownTag struct {
  1970. // StopTeardownOnFailure: If true, fire the teardown tag if and only if
  1971. // the main tag fires successfully. If false, fire the teardown tag
  1972. // regardless of main tag firing status.
  1973. StopTeardownOnFailure bool `json:"stopTeardownOnFailure,omitempty"`
  1974. // TagName: The name of the teardown tag.
  1975. TagName string `json:"tagName,omitempty"`
  1976. // ForceSendFields is a list of field names (e.g.
  1977. // "StopTeardownOnFailure") to unconditionally include in API requests.
  1978. // By default, fields with empty values are omitted from API requests.
  1979. // However, any non-pointer, non-interface field appearing in
  1980. // ForceSendFields will be sent to the server regardless of whether the
  1981. // field is empty or not. This may be used to include empty fields in
  1982. // Patch requests.
  1983. ForceSendFields []string `json:"-"`
  1984. // NullFields is a list of field names (e.g. "StopTeardownOnFailure") to
  1985. // include in API requests with the JSON null value. By default, fields
  1986. // with empty values are omitted from API requests. However, any field
  1987. // with an empty value appearing in NullFields will be sent to the
  1988. // server as null. It is an error if a field in this list has a
  1989. // non-empty value. This may be used to include null fields in Patch
  1990. // requests.
  1991. NullFields []string `json:"-"`
  1992. }
  1993. func (s *TeardownTag) MarshalJSON() ([]byte, error) {
  1994. type NoMethod TeardownTag
  1995. raw := NoMethod(*s)
  1996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1997. }
  1998. // Timestamp: A Timestamp represents a point in time independent of any
  1999. // time zone or local calendar, encoded as a count of seconds and
  2000. // fractions of seconds at nanosecond resolution. The count is relative
  2001. // to an epoch at UTC midnight on January 1, 1970, in the proleptic
  2002. // Gregorian calendar which extends the Gregorian calendar backwards to
  2003. // year one.
  2004. //
  2005. // All minutes are 60 seconds long. Leap seconds are "smeared" so that
  2006. // no leap second table is needed for interpretation, using a [24-hour
  2007. // linear smear](https://developers.google.com/time/smear).
  2008. //
  2009. // The range is from 0001-01-01T00:00:00Z to
  2010. // 9999-12-31T23:59:59.999999999Z. By restricting to that range, we
  2011. // ensure that we can convert to and from [RFC
  2012. // 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
  2013. //
  2014. // # Examples
  2015. //
  2016. // Example 1: Compute Timestamp from POSIX `time()`.
  2017. //
  2018. // Timestamp timestamp; timestamp.set_seconds(time(NULL));
  2019. // timestamp.set_nanos(0);
  2020. //
  2021. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  2022. //
  2023. // struct timeval tv; gettimeofday(&tv, NULL);
  2024. //
  2025. // Timestamp timestamp; timestamp.set_seconds(tv.tv_sec);
  2026. // timestamp.set_nanos(tv.tv_usec * 1000);
  2027. //
  2028. // Example 3: Compute Timestamp from Win32
  2029. // `GetSystemTimeAsFileTime()`.
  2030. //
  2031. // FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks =
  2032. // (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  2033. //
  2034. // // A Windows tick is 100 nanoseconds. Windows epoch
  2035. // 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch
  2036. // 1970-01-01T00:00:00Z. Timestamp timestamp;
  2037. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  2038. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  2039. //
  2040. // Example 4: Compute Timestamp from Java
  2041. // `System.currentTimeMillis()`.
  2042. //
  2043. // long millis = System.currentTimeMillis();
  2044. //
  2045. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis /
  2046. // 1000) .setNanos((int) ((millis % 1000) *
  2047. // 1000000)).build();
  2048. //
  2049. //
  2050. //
  2051. // Example 5: Compute Timestamp from current time in Python.
  2052. //
  2053. // timestamp = Timestamp() timestamp.GetCurrentTime()
  2054. //
  2055. // # JSON Mapping
  2056. //
  2057. // In JSON format, the Timestamp type is encoded as a string in the [RFC
  2058. // 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
  2059. // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
  2060. // where {year} is always expressed using four digits while {month},
  2061. // {day}, {hour}, {min}, and {sec} are zero-padded to two digits each.
  2062. // The fractional seconds, which can go up to 9 digits (i.e. up to 1
  2063. // nanosecond resolution), are optional. The "Z" suffix indicates the
  2064. // timezone ("UTC"); the timezone is required. A proto3 JSON serializer
  2065. // should always use UTC (as indicated by "Z") when printing the
  2066. // Timestamp type and a proto3 JSON parser should be able to accept both
  2067. // UTC and other timezones (as indicated by an offset).
  2068. //
  2069. // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
  2070. // 01:30 UTC on January 15, 2017.
  2071. //
  2072. // In JavaScript, one can convert a Date object to this format using the
  2073. // standard
  2074. // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScrip
  2075. // t/Reference/Global_Objects/Date/toISOString) method. In Python, a
  2076. // standard `datetime.datetime` object can be converted to this format
  2077. // using
  2078. // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime
  2079. // ) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in
  2080. // Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
  2081. // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D ) to obtain a formatter capable of generating timestamps in this
  2082. // format.
  2083. type Timestamp struct {
  2084. // Nanos: Non-negative fractions of a second at nanosecond resolution.
  2085. // Negative second values with fractions must still have non-negative
  2086. // nanos values that count forward in time. Must be from 0 to
  2087. // 999,999,999 inclusive.
  2088. Nanos int64 `json:"nanos,omitempty"`
  2089. // Seconds: Represents seconds of UTC time since Unix epoch
  2090. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  2091. // 9999-12-31T23:59:59Z inclusive.
  2092. Seconds int64 `json:"seconds,omitempty,string"`
  2093. // ForceSendFields is a list of field names (e.g. "Nanos") to
  2094. // unconditionally include in API requests. By default, fields with
  2095. // empty values are omitted from API requests. However, any non-pointer,
  2096. // non-interface field appearing in ForceSendFields will be sent to the
  2097. // server regardless of whether the field is empty or not. This may be
  2098. // used to include empty fields in Patch requests.
  2099. ForceSendFields []string `json:"-"`
  2100. // NullFields is a list of field names (e.g. "Nanos") to include in API
  2101. // requests with the JSON null value. By default, fields with empty
  2102. // values are omitted from API requests. However, any field with an
  2103. // empty value appearing in NullFields will be sent to the server as
  2104. // null. It is an error if a field in this list has a non-empty value.
  2105. // This may be used to include null fields in Patch requests.
  2106. NullFields []string `json:"-"`
  2107. }
  2108. func (s *Timestamp) MarshalJSON() ([]byte, error) {
  2109. type NoMethod Timestamp
  2110. raw := NoMethod(*s)
  2111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2112. }
  2113. // Trigger: Represents a Google Tag Manager Trigger
  2114. type Trigger struct {
  2115. // AccountId: GTM Account ID.
  2116. AccountId string `json:"accountId,omitempty"`
  2117. // AutoEventFilter: Used in the case of auto event tracking.
  2118. AutoEventFilter []*Condition `json:"autoEventFilter,omitempty"`
  2119. // CheckValidation: Whether or not we should only fire tags if the form
  2120. // submit or link click event is not cancelled by some other event
  2121. // handler (e.g. because of validation). Only valid for Form Submission
  2122. // and Link Click triggers.
  2123. CheckValidation *Parameter `json:"checkValidation,omitempty"`
  2124. // ContainerId: GTM Container ID.
  2125. ContainerId string `json:"containerId,omitempty"`
  2126. // ContinuousTimeMinMilliseconds: A visibility trigger minimum
  2127. // continuous visible time (in milliseconds). Only valid for AMP
  2128. // Visibility trigger.
  2129. ContinuousTimeMinMilliseconds *Parameter `json:"continuousTimeMinMilliseconds,omitempty"`
  2130. // CustomEventFilter: Used in the case of custom event, which is fired
  2131. // iff all Conditions are true.
  2132. CustomEventFilter []*Condition `json:"customEventFilter,omitempty"`
  2133. // EventName: Name of the GTM event that is fired. Only valid for Timer
  2134. // triggers.
  2135. EventName *Parameter `json:"eventName,omitempty"`
  2136. // Filter: The trigger will only fire iff all Conditions are true.
  2137. Filter []*Condition `json:"filter,omitempty"`
  2138. // Fingerprint: The fingerprint of the GTM Trigger as computed at
  2139. // storage time. This value is recomputed whenever the trigger is
  2140. // modified.
  2141. Fingerprint string `json:"fingerprint,omitempty"`
  2142. // HorizontalScrollPercentageList: List of integer percentage values for
  2143. // scroll triggers. The trigger will fire when each percentage is
  2144. // reached when the view is scrolled horizontally. Only valid for AMP
  2145. // scroll triggers.
  2146. HorizontalScrollPercentageList *Parameter `json:"horizontalScrollPercentageList,omitempty"`
  2147. // Interval: Time between triggering recurring Timer Events (in
  2148. // milliseconds). Only valid for Timer triggers.
  2149. Interval *Parameter `json:"interval,omitempty"`
  2150. // IntervalSeconds: Time between Timer Events to fire (in seconds). Only
  2151. // valid for AMP Timer trigger.
  2152. IntervalSeconds *Parameter `json:"intervalSeconds,omitempty"`
  2153. // Limit: Limit of the number of GTM events this Timer Trigger will
  2154. // fire. If no limit is set, we will continue to fire GTM events until
  2155. // the user leaves the page. Only valid for Timer triggers.
  2156. Limit *Parameter `json:"limit,omitempty"`
  2157. // MaxTimerLengthSeconds: Max time to fire Timer Events (in seconds).
  2158. // Only valid for AMP Timer trigger.
  2159. MaxTimerLengthSeconds *Parameter `json:"maxTimerLengthSeconds,omitempty"`
  2160. // Name: Trigger display name.
  2161. Name string `json:"name,omitempty"`
  2162. // Notes: User notes on how to apply this trigger in the container.
  2163. Notes string `json:"notes,omitempty"`
  2164. // Parameter: Additional parameters.
  2165. Parameter []*Parameter `json:"parameter,omitempty"`
  2166. // ParentFolderId: Parent folder id.
  2167. ParentFolderId string `json:"parentFolderId,omitempty"`
  2168. // Path: GTM Trigger's API relative path.
  2169. Path string `json:"path,omitempty"`
  2170. // Selector: A click trigger CSS selector (i.e. "a", "button" etc.).
  2171. // Only valid for AMP Click trigger.
  2172. Selector *Parameter `json:"selector,omitempty"`
  2173. // TagManagerUrl: Auto generated link to the tag manager UI
  2174. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2175. // TotalTimeMinMilliseconds: A visibility trigger minimum total visible
  2176. // time (in milliseconds). Only valid for AMP Visibility trigger.
  2177. TotalTimeMinMilliseconds *Parameter `json:"totalTimeMinMilliseconds,omitempty"`
  2178. // TriggerId: The Trigger ID uniquely identifies the GTM Trigger.
  2179. TriggerId string `json:"triggerId,omitempty"`
  2180. // Type: Defines the data layer event that causes this trigger.
  2181. //
  2182. // Possible values:
  2183. // "always"
  2184. // "ampClick"
  2185. // "ampScroll"
  2186. // "ampTimer"
  2187. // "ampVisibility"
  2188. // "click"
  2189. // "customEvent"
  2190. // "domReady"
  2191. // "elementVisibility"
  2192. // "eventTypeUnspecified"
  2193. // "firebaseAppException"
  2194. // "firebaseAppUpdate"
  2195. // "firebaseCampaign"
  2196. // "firebaseFirstOpen"
  2197. // "firebaseInAppPurchase"
  2198. // "firebaseNotificationDismiss"
  2199. // "firebaseNotificationForeground"
  2200. // "firebaseNotificationOpen"
  2201. // "firebaseNotificationReceive"
  2202. // "firebaseOsUpdate"
  2203. // "firebaseSessionStart"
  2204. // "firebaseUserEngagement"
  2205. // "formSubmission"
  2206. // "historyChange"
  2207. // "jsError"
  2208. // "linkClick"
  2209. // "pageview"
  2210. // "scrollDepth"
  2211. // "timer"
  2212. // "windowLoaded"
  2213. // "youTubeVideo"
  2214. Type string `json:"type,omitempty"`
  2215. // UniqueTriggerId: Globally unique id of the trigger that
  2216. // auto-generates this (a Form Submit, Link Click or Timer listener) if
  2217. // any. Used to make incompatible auto-events work together with trigger
  2218. // filtering based on trigger ids. This value is populated during output
  2219. // generation since the tags implied by triggers don't exist until then.
  2220. // Only valid for Form Submit, Link Click and Timer triggers.
  2221. UniqueTriggerId *Parameter `json:"uniqueTriggerId,omitempty"`
  2222. // VerticalScrollPercentageList: List of integer percentage values for
  2223. // scroll triggers. The trigger will fire when each percentage is
  2224. // reached when the view is scrolled vertically. Only valid for AMP
  2225. // scroll triggers.
  2226. VerticalScrollPercentageList *Parameter `json:"verticalScrollPercentageList,omitempty"`
  2227. // VisibilitySelector: A visibility trigger CSS selector (i.e. "#id").
  2228. // Only valid for AMP Visibility trigger.
  2229. VisibilitySelector *Parameter `json:"visibilitySelector,omitempty"`
  2230. // VisiblePercentageMax: A visibility trigger maximum percent
  2231. // visibility. Only valid for AMP Visibility trigger.
  2232. VisiblePercentageMax *Parameter `json:"visiblePercentageMax,omitempty"`
  2233. // VisiblePercentageMin: A visibility trigger minimum percent
  2234. // visibility. Only valid for AMP Visibility trigger.
  2235. VisiblePercentageMin *Parameter `json:"visiblePercentageMin,omitempty"`
  2236. // WaitForTags: Whether or not we should delay the form submissions or
  2237. // link opening until all of the tags have fired (by preventing the
  2238. // default action and later simulating the default action). Only valid
  2239. // for Form Submission and Link Click triggers.
  2240. WaitForTags *Parameter `json:"waitForTags,omitempty"`
  2241. // WaitForTagsTimeout: How long to wait (in milliseconds) for tags to
  2242. // fire when 'waits_for_tags' above evaluates to true. Only valid for
  2243. // Form Submission and Link Click triggers.
  2244. WaitForTagsTimeout *Parameter `json:"waitForTagsTimeout,omitempty"`
  2245. // WorkspaceId: GTM Workspace ID.
  2246. WorkspaceId string `json:"workspaceId,omitempty"`
  2247. // ServerResponse contains the HTTP response code and headers from the
  2248. // server.
  2249. googleapi.ServerResponse `json:"-"`
  2250. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2251. // unconditionally include in API requests. By default, fields with
  2252. // empty values are omitted from API requests. However, any non-pointer,
  2253. // non-interface field appearing in ForceSendFields will be sent to the
  2254. // server regardless of whether the field is empty or not. This may be
  2255. // used to include empty fields in Patch requests.
  2256. ForceSendFields []string `json:"-"`
  2257. // NullFields is a list of field names (e.g. "AccountId") to include in
  2258. // API requests with the JSON null value. By default, fields with empty
  2259. // values are omitted from API requests. However, any field with an
  2260. // empty value appearing in NullFields will be sent to the server as
  2261. // null. It is an error if a field in this list has a non-empty value.
  2262. // This may be used to include null fields in Patch requests.
  2263. NullFields []string `json:"-"`
  2264. }
  2265. func (s *Trigger) MarshalJSON() ([]byte, error) {
  2266. type NoMethod Trigger
  2267. raw := NoMethod(*s)
  2268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2269. }
  2270. // UserPermission: Represents a user's permissions to an account and its
  2271. // container.
  2272. type UserPermission struct {
  2273. // AccountAccess: GTM Account access permissions.
  2274. AccountAccess *AccountAccess `json:"accountAccess,omitempty"`
  2275. // AccountId: The Account ID uniquely identifies the GTM Account.
  2276. AccountId string `json:"accountId,omitempty"`
  2277. // ContainerAccess: GTM Container access permissions.
  2278. ContainerAccess []*ContainerAccess `json:"containerAccess,omitempty"`
  2279. // EmailAddress: User's email address.
  2280. EmailAddress string `json:"emailAddress,omitempty"`
  2281. // Path: GTM UserPermission's API relative path.
  2282. Path string `json:"path,omitempty"`
  2283. // ServerResponse contains the HTTP response code and headers from the
  2284. // server.
  2285. googleapi.ServerResponse `json:"-"`
  2286. // ForceSendFields is a list of field names (e.g. "AccountAccess") to
  2287. // unconditionally include in API requests. By default, fields with
  2288. // empty values are omitted from API requests. However, any non-pointer,
  2289. // non-interface field appearing in ForceSendFields will be sent to the
  2290. // server regardless of whether the field is empty or not. This may be
  2291. // used to include empty fields in Patch requests.
  2292. ForceSendFields []string `json:"-"`
  2293. // NullFields is a list of field names (e.g. "AccountAccess") to include
  2294. // in API requests with the JSON null value. By default, fields with
  2295. // empty values are omitted from API requests. However, any field with
  2296. // an empty value appearing in NullFields will be sent to the server as
  2297. // null. It is an error if a field in this list has a non-empty value.
  2298. // This may be used to include null fields in Patch requests.
  2299. NullFields []string `json:"-"`
  2300. }
  2301. func (s *UserPermission) MarshalJSON() ([]byte, error) {
  2302. type NoMethod UserPermission
  2303. raw := NoMethod(*s)
  2304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2305. }
  2306. // Variable: Represents a Google Tag Manager Variable.
  2307. type Variable struct {
  2308. // AccountId: GTM Account ID.
  2309. AccountId string `json:"accountId,omitempty"`
  2310. // ContainerId: GTM Container ID.
  2311. ContainerId string `json:"containerId,omitempty"`
  2312. // DisablingTriggerId: For mobile containers only: A list of trigger IDs
  2313. // for disabling conditional variables; the variable is enabled if one
  2314. // of the enabling trigger is true while all the disabling trigger are
  2315. // false. Treated as an unordered set.
  2316. DisablingTriggerId []string `json:"disablingTriggerId,omitempty"`
  2317. // EnablingTriggerId: For mobile containers only: A list of trigger IDs
  2318. // for enabling conditional variables; the variable is enabled if one of
  2319. // the enabling triggers is true while all the disabling triggers are
  2320. // false. Treated as an unordered set.
  2321. EnablingTriggerId []string `json:"enablingTriggerId,omitempty"`
  2322. // Fingerprint: The fingerprint of the GTM Variable as computed at
  2323. // storage time. This value is recomputed whenever the variable is
  2324. // modified.
  2325. Fingerprint string `json:"fingerprint,omitempty"`
  2326. // FormatValue: Option to convert a variable value to other value.
  2327. FormatValue *VariableFormatValue `json:"formatValue,omitempty"`
  2328. // Name: Variable display name.
  2329. Name string `json:"name,omitempty"`
  2330. // Notes: User notes on how to apply this variable in the container.
  2331. Notes string `json:"notes,omitempty"`
  2332. // Parameter: The variable's parameters.
  2333. Parameter []*Parameter `json:"parameter,omitempty"`
  2334. // ParentFolderId: Parent folder id.
  2335. ParentFolderId string `json:"parentFolderId,omitempty"`
  2336. // Path: GTM Variable's API relative path.
  2337. Path string `json:"path,omitempty"`
  2338. // ScheduleEndMs: The end timestamp in milliseconds to schedule a
  2339. // variable.
  2340. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  2341. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  2342. // variable.
  2343. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  2344. // TagManagerUrl: Auto generated link to the tag manager UI
  2345. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2346. // Type: GTM Variable Type.
  2347. Type string `json:"type,omitempty"`
  2348. // VariableId: The Variable ID uniquely identifies the GTM Variable.
  2349. VariableId string `json:"variableId,omitempty"`
  2350. // WorkspaceId: GTM Workspace ID.
  2351. WorkspaceId string `json:"workspaceId,omitempty"`
  2352. // ServerResponse contains the HTTP response code and headers from the
  2353. // server.
  2354. googleapi.ServerResponse `json:"-"`
  2355. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2356. // unconditionally include in API requests. By default, fields with
  2357. // empty values are omitted from API requests. However, any non-pointer,
  2358. // non-interface field appearing in ForceSendFields will be sent to the
  2359. // server regardless of whether the field is empty or not. This may be
  2360. // used to include empty fields in Patch requests.
  2361. ForceSendFields []string `json:"-"`
  2362. // NullFields is a list of field names (e.g. "AccountId") to include in
  2363. // API requests with the JSON null value. By default, fields with empty
  2364. // values are omitted from API requests. However, any field with an
  2365. // empty value appearing in NullFields will be sent to the server as
  2366. // null. It is an error if a field in this list has a non-empty value.
  2367. // This may be used to include null fields in Patch requests.
  2368. NullFields []string `json:"-"`
  2369. }
  2370. func (s *Variable) MarshalJSON() ([]byte, error) {
  2371. type NoMethod Variable
  2372. raw := NoMethod(*s)
  2373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2374. }
  2375. type VariableFormatValue struct {
  2376. // CaseConversionType: The option to convert a string-type variable
  2377. // value to either lowercase or uppercase.
  2378. //
  2379. // Possible values:
  2380. // "lowercase"
  2381. // "none"
  2382. // "uppercase"
  2383. CaseConversionType string `json:"caseConversionType,omitempty"`
  2384. // ConvertFalseToValue: The value to convert if a variable value is
  2385. // false.
  2386. ConvertFalseToValue *Parameter `json:"convertFalseToValue,omitempty"`
  2387. // ConvertNullToValue: The value to convert if a variable value is null.
  2388. ConvertNullToValue *Parameter `json:"convertNullToValue,omitempty"`
  2389. // ConvertTrueToValue: The value to convert if a variable value is true.
  2390. ConvertTrueToValue *Parameter `json:"convertTrueToValue,omitempty"`
  2391. // ConvertUndefinedToValue: The value to convert if a variable value is
  2392. // undefined.
  2393. ConvertUndefinedToValue *Parameter `json:"convertUndefinedToValue,omitempty"`
  2394. // ForceSendFields is a list of field names (e.g. "CaseConversionType")
  2395. // to unconditionally include in API requests. By default, fields with
  2396. // empty values are omitted from API requests. However, any non-pointer,
  2397. // non-interface field appearing in ForceSendFields will be sent to the
  2398. // server regardless of whether the field is empty or not. This may be
  2399. // used to include empty fields in Patch requests.
  2400. ForceSendFields []string `json:"-"`
  2401. // NullFields is a list of field names (e.g. "CaseConversionType") to
  2402. // include in API requests with the JSON null value. By default, fields
  2403. // with empty values are omitted from API requests. However, any field
  2404. // with an empty value appearing in NullFields will be sent to the
  2405. // server as null. It is an error if a field in this list has a
  2406. // non-empty value. This may be used to include null fields in Patch
  2407. // requests.
  2408. NullFields []string `json:"-"`
  2409. }
  2410. func (s *VariableFormatValue) MarshalJSON() ([]byte, error) {
  2411. type NoMethod VariableFormatValue
  2412. raw := NoMethod(*s)
  2413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2414. }
  2415. // Workspace: Represents a Google Tag Manager Container Workspace.
  2416. type Workspace struct {
  2417. // AccountId: GTM Account ID.
  2418. AccountId string `json:"accountId,omitempty"`
  2419. // ContainerId: GTM Container ID.
  2420. ContainerId string `json:"containerId,omitempty"`
  2421. // Description: Workspace description.
  2422. Description string `json:"description,omitempty"`
  2423. // Fingerprint: The fingerprint of the GTM Workspace as computed at
  2424. // storage time. This value is recomputed whenever the workspace is
  2425. // modified.
  2426. Fingerprint string `json:"fingerprint,omitempty"`
  2427. // Name: Workspace display name.
  2428. Name string `json:"name,omitempty"`
  2429. // Path: GTM Workspace's API relative path.
  2430. Path string `json:"path,omitempty"`
  2431. // TagManagerUrl: Auto generated link to the tag manager UI
  2432. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2433. // WorkspaceId: The Workspace ID uniquely identifies the GTM Workspace.
  2434. WorkspaceId string `json:"workspaceId,omitempty"`
  2435. // ServerResponse contains the HTTP response code and headers from the
  2436. // server.
  2437. googleapi.ServerResponse `json:"-"`
  2438. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2439. // unconditionally include in API requests. By default, fields with
  2440. // empty values are omitted from API requests. However, any non-pointer,
  2441. // non-interface field appearing in ForceSendFields will be sent to the
  2442. // server regardless of whether the field is empty or not. This may be
  2443. // used to include empty fields in Patch requests.
  2444. ForceSendFields []string `json:"-"`
  2445. // NullFields is a list of field names (e.g. "AccountId") to include in
  2446. // API requests with the JSON null value. By default, fields with empty
  2447. // values are omitted from API requests. However, any field with an
  2448. // empty value appearing in NullFields will be sent to the server as
  2449. // null. It is an error if a field in this list has a non-empty value.
  2450. // This may be used to include null fields in Patch requests.
  2451. NullFields []string `json:"-"`
  2452. }
  2453. func (s *Workspace) MarshalJSON() ([]byte, error) {
  2454. type NoMethod Workspace
  2455. raw := NoMethod(*s)
  2456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2457. }
  2458. // Zone: Represents a Google Tag Manager Zone's contents.
  2459. type Zone struct {
  2460. // AccountId: GTM Account ID.
  2461. AccountId string `json:"accountId,omitempty"`
  2462. // Boundary: This Zone's boundary.
  2463. Boundary *ZoneBoundary `json:"boundary,omitempty"`
  2464. // ChildContainer: Containers that are children of this Zone.
  2465. ChildContainer []*ZoneChildContainer `json:"childContainer,omitempty"`
  2466. // ContainerId: GTM Container ID.
  2467. ContainerId string `json:"containerId,omitempty"`
  2468. // Fingerprint: The fingerprint of the GTM Zone as computed at storage
  2469. // time. This value is recomputed whenever the zone is modified.
  2470. Fingerprint string `json:"fingerprint,omitempty"`
  2471. // Name: Zone display name.
  2472. Name string `json:"name,omitempty"`
  2473. // Notes: User notes on how to apply this zone in the container.
  2474. Notes string `json:"notes,omitempty"`
  2475. // Path: GTM Zone's API relative path.
  2476. Path string `json:"path,omitempty"`
  2477. // TagManagerUrl: Auto generated link to the tag manager UI
  2478. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2479. // TypeRestriction: This Zone's type restrictions.
  2480. TypeRestriction *ZoneTypeRestriction `json:"typeRestriction,omitempty"`
  2481. // WorkspaceId: GTM Workspace ID.
  2482. WorkspaceId string `json:"workspaceId,omitempty"`
  2483. // ZoneId: The Zone ID uniquely identifies the GTM Zone.
  2484. ZoneId string `json:"zoneId,omitempty"`
  2485. // ServerResponse contains the HTTP response code and headers from the
  2486. // server.
  2487. googleapi.ServerResponse `json:"-"`
  2488. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2489. // unconditionally include in API requests. By default, fields with
  2490. // empty values are omitted from API requests. However, any non-pointer,
  2491. // non-interface field appearing in ForceSendFields will be sent to the
  2492. // server regardless of whether the field is empty or not. This may be
  2493. // used to include empty fields in Patch requests.
  2494. ForceSendFields []string `json:"-"`
  2495. // NullFields is a list of field names (e.g. "AccountId") to include in
  2496. // API requests with the JSON null value. By default, fields with empty
  2497. // values are omitted from API requests. However, any field with an
  2498. // empty value appearing in NullFields will be sent to the server as
  2499. // null. It is an error if a field in this list has a non-empty value.
  2500. // This may be used to include null fields in Patch requests.
  2501. NullFields []string `json:"-"`
  2502. }
  2503. func (s *Zone) MarshalJSON() ([]byte, error) {
  2504. type NoMethod Zone
  2505. raw := NoMethod(*s)
  2506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2507. }
  2508. // ZoneBoundary: Represents a Zone's boundaries.
  2509. type ZoneBoundary struct {
  2510. // Condition: The conditions that, when conjoined, make up the boundary.
  2511. Condition []*Condition `json:"condition,omitempty"`
  2512. // CustomEvaluationTriggerId: Custom evaluation trigger IDs. A zone will
  2513. // evaluate its boundary conditions when any of the listed triggers are
  2514. // true.
  2515. CustomEvaluationTriggerId []string `json:"customEvaluationTriggerId,omitempty"`
  2516. // ForceSendFields is a list of field names (e.g. "Condition") to
  2517. // unconditionally include in API requests. By default, fields with
  2518. // empty values are omitted from API requests. However, any non-pointer,
  2519. // non-interface field appearing in ForceSendFields will be sent to the
  2520. // server regardless of whether the field is empty or not. This may be
  2521. // used to include empty fields in Patch requests.
  2522. ForceSendFields []string `json:"-"`
  2523. // NullFields is a list of field names (e.g. "Condition") to include in
  2524. // API requests with the JSON null value. By default, fields with empty
  2525. // values are omitted from API requests. However, any field with an
  2526. // empty value appearing in NullFields will be sent to the server as
  2527. // null. It is an error if a field in this list has a non-empty value.
  2528. // This may be used to include null fields in Patch requests.
  2529. NullFields []string `json:"-"`
  2530. }
  2531. func (s *ZoneBoundary) MarshalJSON() ([]byte, error) {
  2532. type NoMethod ZoneBoundary
  2533. raw := NoMethod(*s)
  2534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2535. }
  2536. // ZoneChildContainer: Represents a child container of a Zone.
  2537. type ZoneChildContainer struct {
  2538. // Nickname: The zone's nickname for the child container.
  2539. Nickname string `json:"nickname,omitempty"`
  2540. // PublicId: The child container's public id.
  2541. PublicId string `json:"publicId,omitempty"`
  2542. // ForceSendFields is a list of field names (e.g. "Nickname") to
  2543. // unconditionally include in API requests. By default, fields with
  2544. // empty values are omitted from API requests. However, any non-pointer,
  2545. // non-interface field appearing in ForceSendFields will be sent to the
  2546. // server regardless of whether the field is empty or not. This may be
  2547. // used to include empty fields in Patch requests.
  2548. ForceSendFields []string `json:"-"`
  2549. // NullFields is a list of field names (e.g. "Nickname") to include in
  2550. // API requests with the JSON null value. By default, fields with empty
  2551. // values are omitted from API requests. However, any field with an
  2552. // empty value appearing in NullFields will be sent to the server as
  2553. // null. It is an error if a field in this list has a non-empty value.
  2554. // This may be used to include null fields in Patch requests.
  2555. NullFields []string `json:"-"`
  2556. }
  2557. func (s *ZoneChildContainer) MarshalJSON() ([]byte, error) {
  2558. type NoMethod ZoneChildContainer
  2559. raw := NoMethod(*s)
  2560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2561. }
  2562. // ZoneTypeRestriction: Represents a Zone's type restrictions.
  2563. type ZoneTypeRestriction struct {
  2564. // Enable: True if type restrictions have been enabled for this Zone.
  2565. Enable bool `json:"enable,omitempty"`
  2566. // WhitelistedTypeId: List of type public ids that have been whitelisted
  2567. // for use in this Zone.
  2568. WhitelistedTypeId []string `json:"whitelistedTypeId,omitempty"`
  2569. // ForceSendFields is a list of field names (e.g. "Enable") to
  2570. // unconditionally include in API requests. By default, fields with
  2571. // empty values are omitted from API requests. However, any non-pointer,
  2572. // non-interface field appearing in ForceSendFields will be sent to the
  2573. // server regardless of whether the field is empty or not. This may be
  2574. // used to include empty fields in Patch requests.
  2575. ForceSendFields []string `json:"-"`
  2576. // NullFields is a list of field names (e.g. "Enable") to include in API
  2577. // requests with the JSON null value. By default, fields with empty
  2578. // values are omitted from API requests. However, any field with an
  2579. // empty value appearing in NullFields will be sent to the server as
  2580. // null. It is an error if a field in this list has a non-empty value.
  2581. // This may be used to include null fields in Patch requests.
  2582. NullFields []string `json:"-"`
  2583. }
  2584. func (s *ZoneTypeRestriction) MarshalJSON() ([]byte, error) {
  2585. type NoMethod ZoneTypeRestriction
  2586. raw := NoMethod(*s)
  2587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2588. }
  2589. // method id "tagmanager.accounts.get":
  2590. type AccountsGetCall struct {
  2591. s *Service
  2592. path string
  2593. urlParams_ gensupport.URLParams
  2594. ifNoneMatch_ string
  2595. ctx_ context.Context
  2596. header_ http.Header
  2597. }
  2598. // Get: Gets a GTM Account.
  2599. func (r *AccountsService) Get(path string) *AccountsGetCall {
  2600. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2601. c.path = path
  2602. return c
  2603. }
  2604. // Fields allows partial responses to be retrieved. See
  2605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2606. // for more information.
  2607. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  2608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2609. return c
  2610. }
  2611. // IfNoneMatch sets the optional parameter which makes the operation
  2612. // fail if the object's ETag matches the given value. This is useful for
  2613. // getting updates only after the object has changed since the last
  2614. // request. Use googleapi.IsNotModified to check whether the response
  2615. // error from Do is the result of In-None-Match.
  2616. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  2617. c.ifNoneMatch_ = entityTag
  2618. return c
  2619. }
  2620. // Context sets the context to be used in this call's Do method. Any
  2621. // pending HTTP request will be aborted if the provided context is
  2622. // canceled.
  2623. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  2624. c.ctx_ = ctx
  2625. return c
  2626. }
  2627. // Header returns an http.Header that can be modified by the caller to
  2628. // add HTTP headers to the request.
  2629. func (c *AccountsGetCall) Header() http.Header {
  2630. if c.header_ == nil {
  2631. c.header_ = make(http.Header)
  2632. }
  2633. return c.header_
  2634. }
  2635. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  2636. reqHeaders := make(http.Header)
  2637. for k, v := range c.header_ {
  2638. reqHeaders[k] = v
  2639. }
  2640. reqHeaders.Set("User-Agent", c.s.userAgent())
  2641. if c.ifNoneMatch_ != "" {
  2642. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2643. }
  2644. var body io.Reader = nil
  2645. c.urlParams_.Set("alt", alt)
  2646. c.urlParams_.Set("prettyPrint", "false")
  2647. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  2648. urls += "?" + c.urlParams_.Encode()
  2649. req, err := http.NewRequest("GET", urls, body)
  2650. if err != nil {
  2651. return nil, err
  2652. }
  2653. req.Header = reqHeaders
  2654. googleapi.Expand(req.URL, map[string]string{
  2655. "path": c.path,
  2656. })
  2657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2658. }
  2659. // Do executes the "tagmanager.accounts.get" call.
  2660. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  2661. // code is an error. Response headers are in either
  2662. // *Account.ServerResponse.Header or (if a response was returned at all)
  2663. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2664. // check whether the returned error was because http.StatusNotModified
  2665. // was returned.
  2666. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  2667. gensupport.SetOptions(c.urlParams_, opts...)
  2668. res, err := c.doRequest("json")
  2669. if res != nil && res.StatusCode == http.StatusNotModified {
  2670. if res.Body != nil {
  2671. res.Body.Close()
  2672. }
  2673. return nil, &googleapi.Error{
  2674. Code: res.StatusCode,
  2675. Header: res.Header,
  2676. }
  2677. }
  2678. if err != nil {
  2679. return nil, err
  2680. }
  2681. defer googleapi.CloseBody(res)
  2682. if err := googleapi.CheckResponse(res); err != nil {
  2683. return nil, err
  2684. }
  2685. ret := &Account{
  2686. ServerResponse: googleapi.ServerResponse{
  2687. Header: res.Header,
  2688. HTTPStatusCode: res.StatusCode,
  2689. },
  2690. }
  2691. target := &ret
  2692. if err := gensupport.DecodeResponse(target, res); err != nil {
  2693. return nil, err
  2694. }
  2695. return ret, nil
  2696. // {
  2697. // "description": "Gets a GTM Account.",
  2698. // "httpMethod": "GET",
  2699. // "id": "tagmanager.accounts.get",
  2700. // "parameterOrder": [
  2701. // "path"
  2702. // ],
  2703. // "parameters": {
  2704. // "path": {
  2705. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}",
  2706. // "location": "path",
  2707. // "required": true,
  2708. // "type": "string"
  2709. // }
  2710. // },
  2711. // "path": "{+path}",
  2712. // "response": {
  2713. // "$ref": "Account"
  2714. // },
  2715. // "scopes": [
  2716. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  2717. // "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  2718. // "https://www.googleapis.com/auth/tagmanager.readonly"
  2719. // ]
  2720. // }
  2721. }
  2722. // method id "tagmanager.accounts.list":
  2723. type AccountsListCall struct {
  2724. s *Service
  2725. urlParams_ gensupport.URLParams
  2726. ifNoneMatch_ string
  2727. ctx_ context.Context
  2728. header_ http.Header
  2729. }
  2730. // List: Lists all GTM Accounts that a user has access to.
  2731. func (r *AccountsService) List() *AccountsListCall {
  2732. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2733. return c
  2734. }
  2735. // PageToken sets the optional parameter "pageToken": Continuation token
  2736. // for fetching the next page of results.
  2737. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  2738. c.urlParams_.Set("pageToken", pageToken)
  2739. return c
  2740. }
  2741. // Fields allows partial responses to be retrieved. See
  2742. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2743. // for more information.
  2744. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  2745. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2746. return c
  2747. }
  2748. // IfNoneMatch sets the optional parameter which makes the operation
  2749. // fail if the object's ETag matches the given value. This is useful for
  2750. // getting updates only after the object has changed since the last
  2751. // request. Use googleapi.IsNotModified to check whether the response
  2752. // error from Do is the result of In-None-Match.
  2753. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  2754. c.ifNoneMatch_ = entityTag
  2755. return c
  2756. }
  2757. // Context sets the context to be used in this call's Do method. Any
  2758. // pending HTTP request will be aborted if the provided context is
  2759. // canceled.
  2760. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  2761. c.ctx_ = ctx
  2762. return c
  2763. }
  2764. // Header returns an http.Header that can be modified by the caller to
  2765. // add HTTP headers to the request.
  2766. func (c *AccountsListCall) Header() http.Header {
  2767. if c.header_ == nil {
  2768. c.header_ = make(http.Header)
  2769. }
  2770. return c.header_
  2771. }
  2772. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  2773. reqHeaders := make(http.Header)
  2774. for k, v := range c.header_ {
  2775. reqHeaders[k] = v
  2776. }
  2777. reqHeaders.Set("User-Agent", c.s.userAgent())
  2778. if c.ifNoneMatch_ != "" {
  2779. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2780. }
  2781. var body io.Reader = nil
  2782. c.urlParams_.Set("alt", alt)
  2783. c.urlParams_.Set("prettyPrint", "false")
  2784. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
  2785. urls += "?" + c.urlParams_.Encode()
  2786. req, err := http.NewRequest("GET", urls, body)
  2787. if err != nil {
  2788. return nil, err
  2789. }
  2790. req.Header = reqHeaders
  2791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2792. }
  2793. // Do executes the "tagmanager.accounts.list" call.
  2794. // Exactly one of *ListAccountsResponse or error will be non-nil. Any
  2795. // non-2xx status code is an error. Response headers are in either
  2796. // *ListAccountsResponse.ServerResponse.Header or (if a response was
  2797. // returned at all) in error.(*googleapi.Error).Header. Use
  2798. // googleapi.IsNotModified to check whether the returned error was
  2799. // because http.StatusNotModified was returned.
  2800. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error) {
  2801. gensupport.SetOptions(c.urlParams_, opts...)
  2802. res, err := c.doRequest("json")
  2803. if res != nil && res.StatusCode == http.StatusNotModified {
  2804. if res.Body != nil {
  2805. res.Body.Close()
  2806. }
  2807. return nil, &googleapi.Error{
  2808. Code: res.StatusCode,
  2809. Header: res.Header,
  2810. }
  2811. }
  2812. if err != nil {
  2813. return nil, err
  2814. }
  2815. defer googleapi.CloseBody(res)
  2816. if err := googleapi.CheckResponse(res); err != nil {
  2817. return nil, err
  2818. }
  2819. ret := &ListAccountsResponse{
  2820. ServerResponse: googleapi.ServerResponse{
  2821. Header: res.Header,
  2822. HTTPStatusCode: res.StatusCode,
  2823. },
  2824. }
  2825. target := &ret
  2826. if err := gensupport.DecodeResponse(target, res); err != nil {
  2827. return nil, err
  2828. }
  2829. return ret, nil
  2830. // {
  2831. // "description": "Lists all GTM Accounts that a user has access to.",
  2832. // "httpMethod": "GET",
  2833. // "id": "tagmanager.accounts.list",
  2834. // "parameters": {
  2835. // "pageToken": {
  2836. // "description": "Continuation token for fetching the next page of results.",
  2837. // "location": "query",
  2838. // "type": "string"
  2839. // }
  2840. // },
  2841. // "path": "accounts",
  2842. // "response": {
  2843. // "$ref": "ListAccountsResponse"
  2844. // },
  2845. // "scopes": [
  2846. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  2847. // "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  2848. // "https://www.googleapis.com/auth/tagmanager.readonly"
  2849. // ]
  2850. // }
  2851. }
  2852. // Pages invokes f for each page of results.
  2853. // A non-nil error returned from f will halt the iteration.
  2854. // The provided context supersedes any context provided to the Context method.
  2855. func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error {
  2856. c.ctx_ = ctx
  2857. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2858. for {
  2859. x, err := c.Do()
  2860. if err != nil {
  2861. return err
  2862. }
  2863. if err := f(x); err != nil {
  2864. return err
  2865. }
  2866. if x.NextPageToken == "" {
  2867. return nil
  2868. }
  2869. c.PageToken(x.NextPageToken)
  2870. }
  2871. }
  2872. // method id "tagmanager.accounts.update":
  2873. type AccountsUpdateCall struct {
  2874. s *Service
  2875. path string
  2876. account *Account
  2877. urlParams_ gensupport.URLParams
  2878. ctx_ context.Context
  2879. header_ http.Header
  2880. }
  2881. // Update: Updates a GTM Account.
  2882. func (r *AccountsService) Update(path string, account *Account) *AccountsUpdateCall {
  2883. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2884. c.path = path
  2885. c.account = account
  2886. return c
  2887. }
  2888. // Fingerprint sets the optional parameter "fingerprint": When provided,
  2889. // this fingerprint must match the fingerprint of the account in
  2890. // storage.
  2891. func (c *AccountsUpdateCall) Fingerprint(fingerprint string) *AccountsUpdateCall {
  2892. c.urlParams_.Set("fingerprint", fingerprint)
  2893. return c
  2894. }
  2895. // Fields allows partial responses to be retrieved. See
  2896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2897. // for more information.
  2898. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  2899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2900. return c
  2901. }
  2902. // Context sets the context to be used in this call's Do method. Any
  2903. // pending HTTP request will be aborted if the provided context is
  2904. // canceled.
  2905. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  2906. c.ctx_ = ctx
  2907. return c
  2908. }
  2909. // Header returns an http.Header that can be modified by the caller to
  2910. // add HTTP headers to the request.
  2911. func (c *AccountsUpdateCall) Header() http.Header {
  2912. if c.header_ == nil {
  2913. c.header_ = make(http.Header)
  2914. }
  2915. return c.header_
  2916. }
  2917. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2918. reqHeaders := make(http.Header)
  2919. for k, v := range c.header_ {
  2920. reqHeaders[k] = v
  2921. }
  2922. reqHeaders.Set("User-Agent", c.s.userAgent())
  2923. var body io.Reader = nil
  2924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  2925. if err != nil {
  2926. return nil, err
  2927. }
  2928. reqHeaders.Set("Content-Type", "application/json")
  2929. c.urlParams_.Set("alt", alt)
  2930. c.urlParams_.Set("prettyPrint", "false")
  2931. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  2932. urls += "?" + c.urlParams_.Encode()
  2933. req, err := http.NewRequest("PUT", urls, body)
  2934. if err != nil {
  2935. return nil, err
  2936. }
  2937. req.Header = reqHeaders
  2938. googleapi.Expand(req.URL, map[string]string{
  2939. "path": c.path,
  2940. })
  2941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2942. }
  2943. // Do executes the "tagmanager.accounts.update" call.
  2944. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  2945. // code is an error. Response headers are in either
  2946. // *Account.ServerResponse.Header or (if a response was returned at all)
  2947. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2948. // check whether the returned error was because http.StatusNotModified
  2949. // was returned.
  2950. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  2951. gensupport.SetOptions(c.urlParams_, opts...)
  2952. res, err := c.doRequest("json")
  2953. if res != nil && res.StatusCode == http.StatusNotModified {
  2954. if res.Body != nil {
  2955. res.Body.Close()
  2956. }
  2957. return nil, &googleapi.Error{
  2958. Code: res.StatusCode,
  2959. Header: res.Header,
  2960. }
  2961. }
  2962. if err != nil {
  2963. return nil, err
  2964. }
  2965. defer googleapi.CloseBody(res)
  2966. if err := googleapi.CheckResponse(res); err != nil {
  2967. return nil, err
  2968. }
  2969. ret := &Account{
  2970. ServerResponse: googleapi.ServerResponse{
  2971. Header: res.Header,
  2972. HTTPStatusCode: res.StatusCode,
  2973. },
  2974. }
  2975. target := &ret
  2976. if err := gensupport.DecodeResponse(target, res); err != nil {
  2977. return nil, err
  2978. }
  2979. return ret, nil
  2980. // {
  2981. // "description": "Updates a GTM Account.",
  2982. // "httpMethod": "PUT",
  2983. // "id": "tagmanager.accounts.update",
  2984. // "parameterOrder": [
  2985. // "path"
  2986. // ],
  2987. // "parameters": {
  2988. // "fingerprint": {
  2989. // "description": "When provided, this fingerprint must match the fingerprint of the account in storage.",
  2990. // "location": "query",
  2991. // "type": "string"
  2992. // },
  2993. // "path": {
  2994. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}",
  2995. // "location": "path",
  2996. // "required": true,
  2997. // "type": "string"
  2998. // }
  2999. // },
  3000. // "path": "{+path}",
  3001. // "request": {
  3002. // "$ref": "Account"
  3003. // },
  3004. // "response": {
  3005. // "$ref": "Account"
  3006. // },
  3007. // "scopes": [
  3008. // "https://www.googleapis.com/auth/tagmanager.manage.accounts"
  3009. // ]
  3010. // }
  3011. }
  3012. // method id "tagmanager.accounts.containers.create":
  3013. type AccountsContainersCreateCall struct {
  3014. s *Service
  3015. parent string
  3016. container *Container
  3017. urlParams_ gensupport.URLParams
  3018. ctx_ context.Context
  3019. header_ http.Header
  3020. }
  3021. // Create: Creates a Container.
  3022. func (r *AccountsContainersService) Create(parent string, container *Container) *AccountsContainersCreateCall {
  3023. c := &AccountsContainersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3024. c.parent = parent
  3025. c.container = container
  3026. return c
  3027. }
  3028. // Fields allows partial responses to be retrieved. See
  3029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3030. // for more information.
  3031. func (c *AccountsContainersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersCreateCall {
  3032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3033. return c
  3034. }
  3035. // Context sets the context to be used in this call's Do method. Any
  3036. // pending HTTP request will be aborted if the provided context is
  3037. // canceled.
  3038. func (c *AccountsContainersCreateCall) Context(ctx context.Context) *AccountsContainersCreateCall {
  3039. c.ctx_ = ctx
  3040. return c
  3041. }
  3042. // Header returns an http.Header that can be modified by the caller to
  3043. // add HTTP headers to the request.
  3044. func (c *AccountsContainersCreateCall) Header() http.Header {
  3045. if c.header_ == nil {
  3046. c.header_ = make(http.Header)
  3047. }
  3048. return c.header_
  3049. }
  3050. func (c *AccountsContainersCreateCall) doRequest(alt string) (*http.Response, error) {
  3051. reqHeaders := make(http.Header)
  3052. for k, v := range c.header_ {
  3053. reqHeaders[k] = v
  3054. }
  3055. reqHeaders.Set("User-Agent", c.s.userAgent())
  3056. var body io.Reader = nil
  3057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.container)
  3058. if err != nil {
  3059. return nil, err
  3060. }
  3061. reqHeaders.Set("Content-Type", "application/json")
  3062. c.urlParams_.Set("alt", alt)
  3063. c.urlParams_.Set("prettyPrint", "false")
  3064. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/containers")
  3065. urls += "?" + c.urlParams_.Encode()
  3066. req, err := http.NewRequest("POST", urls, body)
  3067. if err != nil {
  3068. return nil, err
  3069. }
  3070. req.Header = reqHeaders
  3071. googleapi.Expand(req.URL, map[string]string{
  3072. "parent": c.parent,
  3073. })
  3074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3075. }
  3076. // Do executes the "tagmanager.accounts.containers.create" call.
  3077. // Exactly one of *Container or error will be non-nil. Any non-2xx
  3078. // status code is an error. Response headers are in either
  3079. // *Container.ServerResponse.Header or (if a response was returned at
  3080. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3081. // to check whether the returned error was because
  3082. // http.StatusNotModified was returned.
  3083. func (c *AccountsContainersCreateCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  3084. gensupport.SetOptions(c.urlParams_, opts...)
  3085. res, err := c.doRequest("json")
  3086. if res != nil && res.StatusCode == http.StatusNotModified {
  3087. if res.Body != nil {
  3088. res.Body.Close()
  3089. }
  3090. return nil, &googleapi.Error{
  3091. Code: res.StatusCode,
  3092. Header: res.Header,
  3093. }
  3094. }
  3095. if err != nil {
  3096. return nil, err
  3097. }
  3098. defer googleapi.CloseBody(res)
  3099. if err := googleapi.CheckResponse(res); err != nil {
  3100. return nil, err
  3101. }
  3102. ret := &Container{
  3103. ServerResponse: googleapi.ServerResponse{
  3104. Header: res.Header,
  3105. HTTPStatusCode: res.StatusCode,
  3106. },
  3107. }
  3108. target := &ret
  3109. if err := gensupport.DecodeResponse(target, res); err != nil {
  3110. return nil, err
  3111. }
  3112. return ret, nil
  3113. // {
  3114. // "description": "Creates a Container.",
  3115. // "httpMethod": "POST",
  3116. // "id": "tagmanager.accounts.containers.create",
  3117. // "parameterOrder": [
  3118. // "parent"
  3119. // ],
  3120. // "parameters": {
  3121. // "parent": {
  3122. // "description": "GTM Account's API relative path. Example: accounts/{account_id}.",
  3123. // "location": "path",
  3124. // "required": true,
  3125. // "type": "string"
  3126. // }
  3127. // },
  3128. // "path": "{+parent}/containers",
  3129. // "request": {
  3130. // "$ref": "Container"
  3131. // },
  3132. // "response": {
  3133. // "$ref": "Container"
  3134. // },
  3135. // "scopes": [
  3136. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3137. // ]
  3138. // }
  3139. }
  3140. // method id "tagmanager.accounts.containers.delete":
  3141. type AccountsContainersDeleteCall struct {
  3142. s *Service
  3143. path string
  3144. urlParams_ gensupport.URLParams
  3145. ctx_ context.Context
  3146. header_ http.Header
  3147. }
  3148. // Delete: Deletes a Container.
  3149. func (r *AccountsContainersService) Delete(path string) *AccountsContainersDeleteCall {
  3150. c := &AccountsContainersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3151. c.path = path
  3152. return c
  3153. }
  3154. // Fields allows partial responses to be retrieved. See
  3155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3156. // for more information.
  3157. func (c *AccountsContainersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersDeleteCall {
  3158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3159. return c
  3160. }
  3161. // Context sets the context to be used in this call's Do method. Any
  3162. // pending HTTP request will be aborted if the provided context is
  3163. // canceled.
  3164. func (c *AccountsContainersDeleteCall) Context(ctx context.Context) *AccountsContainersDeleteCall {
  3165. c.ctx_ = ctx
  3166. return c
  3167. }
  3168. // Header returns an http.Header that can be modified by the caller to
  3169. // add HTTP headers to the request.
  3170. func (c *AccountsContainersDeleteCall) Header() http.Header {
  3171. if c.header_ == nil {
  3172. c.header_ = make(http.Header)
  3173. }
  3174. return c.header_
  3175. }
  3176. func (c *AccountsContainersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3177. reqHeaders := make(http.Header)
  3178. for k, v := range c.header_ {
  3179. reqHeaders[k] = v
  3180. }
  3181. reqHeaders.Set("User-Agent", c.s.userAgent())
  3182. var body io.Reader = nil
  3183. c.urlParams_.Set("alt", alt)
  3184. c.urlParams_.Set("prettyPrint", "false")
  3185. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3186. urls += "?" + c.urlParams_.Encode()
  3187. req, err := http.NewRequest("DELETE", urls, body)
  3188. if err != nil {
  3189. return nil, err
  3190. }
  3191. req.Header = reqHeaders
  3192. googleapi.Expand(req.URL, map[string]string{
  3193. "path": c.path,
  3194. })
  3195. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3196. }
  3197. // Do executes the "tagmanager.accounts.containers.delete" call.
  3198. func (c *AccountsContainersDeleteCall) Do(opts ...googleapi.CallOption) error {
  3199. gensupport.SetOptions(c.urlParams_, opts...)
  3200. res, err := c.doRequest("json")
  3201. if err != nil {
  3202. return err
  3203. }
  3204. defer googleapi.CloseBody(res)
  3205. if err := googleapi.CheckResponse(res); err != nil {
  3206. return err
  3207. }
  3208. return nil
  3209. // {
  3210. // "description": "Deletes a Container.",
  3211. // "httpMethod": "DELETE",
  3212. // "id": "tagmanager.accounts.containers.delete",
  3213. // "parameterOrder": [
  3214. // "path"
  3215. // ],
  3216. // "parameters": {
  3217. // "path": {
  3218. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3219. // "location": "path",
  3220. // "required": true,
  3221. // "type": "string"
  3222. // }
  3223. // },
  3224. // "path": "{+path}",
  3225. // "scopes": [
  3226. // "https://www.googleapis.com/auth/tagmanager.delete.containers"
  3227. // ]
  3228. // }
  3229. }
  3230. // method id "tagmanager.accounts.containers.get":
  3231. type AccountsContainersGetCall struct {
  3232. s *Service
  3233. path string
  3234. urlParams_ gensupport.URLParams
  3235. ifNoneMatch_ string
  3236. ctx_ context.Context
  3237. header_ http.Header
  3238. }
  3239. // Get: Gets a Container.
  3240. func (r *AccountsContainersService) Get(path string) *AccountsContainersGetCall {
  3241. c := &AccountsContainersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3242. c.path = path
  3243. return c
  3244. }
  3245. // Fields allows partial responses to be retrieved. See
  3246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3247. // for more information.
  3248. func (c *AccountsContainersGetCall) Fields(s ...googleapi.Field) *AccountsContainersGetCall {
  3249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3250. return c
  3251. }
  3252. // IfNoneMatch sets the optional parameter which makes the operation
  3253. // fail if the object's ETag matches the given value. This is useful for
  3254. // getting updates only after the object has changed since the last
  3255. // request. Use googleapi.IsNotModified to check whether the response
  3256. // error from Do is the result of In-None-Match.
  3257. func (c *AccountsContainersGetCall) IfNoneMatch(entityTag string) *AccountsContainersGetCall {
  3258. c.ifNoneMatch_ = entityTag
  3259. return c
  3260. }
  3261. // Context sets the context to be used in this call's Do method. Any
  3262. // pending HTTP request will be aborted if the provided context is
  3263. // canceled.
  3264. func (c *AccountsContainersGetCall) Context(ctx context.Context) *AccountsContainersGetCall {
  3265. c.ctx_ = ctx
  3266. return c
  3267. }
  3268. // Header returns an http.Header that can be modified by the caller to
  3269. // add HTTP headers to the request.
  3270. func (c *AccountsContainersGetCall) Header() http.Header {
  3271. if c.header_ == nil {
  3272. c.header_ = make(http.Header)
  3273. }
  3274. return c.header_
  3275. }
  3276. func (c *AccountsContainersGetCall) doRequest(alt string) (*http.Response, error) {
  3277. reqHeaders := make(http.Header)
  3278. for k, v := range c.header_ {
  3279. reqHeaders[k] = v
  3280. }
  3281. reqHeaders.Set("User-Agent", c.s.userAgent())
  3282. if c.ifNoneMatch_ != "" {
  3283. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3284. }
  3285. var body io.Reader = nil
  3286. c.urlParams_.Set("alt", alt)
  3287. c.urlParams_.Set("prettyPrint", "false")
  3288. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3289. urls += "?" + c.urlParams_.Encode()
  3290. req, err := http.NewRequest("GET", urls, body)
  3291. if err != nil {
  3292. return nil, err
  3293. }
  3294. req.Header = reqHeaders
  3295. googleapi.Expand(req.URL, map[string]string{
  3296. "path": c.path,
  3297. })
  3298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3299. }
  3300. // Do executes the "tagmanager.accounts.containers.get" call.
  3301. // Exactly one of *Container or error will be non-nil. Any non-2xx
  3302. // status code is an error. Response headers are in either
  3303. // *Container.ServerResponse.Header or (if a response was returned at
  3304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3305. // to check whether the returned error was because
  3306. // http.StatusNotModified was returned.
  3307. func (c *AccountsContainersGetCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  3308. gensupport.SetOptions(c.urlParams_, opts...)
  3309. res, err := c.doRequest("json")
  3310. if res != nil && res.StatusCode == http.StatusNotModified {
  3311. if res.Body != nil {
  3312. res.Body.Close()
  3313. }
  3314. return nil, &googleapi.Error{
  3315. Code: res.StatusCode,
  3316. Header: res.Header,
  3317. }
  3318. }
  3319. if err != nil {
  3320. return nil, err
  3321. }
  3322. defer googleapi.CloseBody(res)
  3323. if err := googleapi.CheckResponse(res); err != nil {
  3324. return nil, err
  3325. }
  3326. ret := &Container{
  3327. ServerResponse: googleapi.ServerResponse{
  3328. Header: res.Header,
  3329. HTTPStatusCode: res.StatusCode,
  3330. },
  3331. }
  3332. target := &ret
  3333. if err := gensupport.DecodeResponse(target, res); err != nil {
  3334. return nil, err
  3335. }
  3336. return ret, nil
  3337. // {
  3338. // "description": "Gets a Container.",
  3339. // "httpMethod": "GET",
  3340. // "id": "tagmanager.accounts.containers.get",
  3341. // "parameterOrder": [
  3342. // "path"
  3343. // ],
  3344. // "parameters": {
  3345. // "path": {
  3346. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3347. // "location": "path",
  3348. // "required": true,
  3349. // "type": "string"
  3350. // }
  3351. // },
  3352. // "path": "{+path}",
  3353. // "response": {
  3354. // "$ref": "Container"
  3355. // },
  3356. // "scopes": [
  3357. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3358. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3359. // ]
  3360. // }
  3361. }
  3362. // method id "tagmanager.accounts.containers.list":
  3363. type AccountsContainersListCall struct {
  3364. s *Service
  3365. parent string
  3366. urlParams_ gensupport.URLParams
  3367. ifNoneMatch_ string
  3368. ctx_ context.Context
  3369. header_ http.Header
  3370. }
  3371. // List: Lists all Containers that belongs to a GTM Account.
  3372. func (r *AccountsContainersService) List(parent string) *AccountsContainersListCall {
  3373. c := &AccountsContainersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3374. c.parent = parent
  3375. return c
  3376. }
  3377. // PageToken sets the optional parameter "pageToken": Continuation token
  3378. // for fetching the next page of results.
  3379. func (c *AccountsContainersListCall) PageToken(pageToken string) *AccountsContainersListCall {
  3380. c.urlParams_.Set("pageToken", pageToken)
  3381. return c
  3382. }
  3383. // Fields allows partial responses to be retrieved. See
  3384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3385. // for more information.
  3386. func (c *AccountsContainersListCall) Fields(s ...googleapi.Field) *AccountsContainersListCall {
  3387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3388. return c
  3389. }
  3390. // IfNoneMatch sets the optional parameter which makes the operation
  3391. // fail if the object's ETag matches the given value. This is useful for
  3392. // getting updates only after the object has changed since the last
  3393. // request. Use googleapi.IsNotModified to check whether the response
  3394. // error from Do is the result of In-None-Match.
  3395. func (c *AccountsContainersListCall) IfNoneMatch(entityTag string) *AccountsContainersListCall {
  3396. c.ifNoneMatch_ = entityTag
  3397. return c
  3398. }
  3399. // Context sets the context to be used in this call's Do method. Any
  3400. // pending HTTP request will be aborted if the provided context is
  3401. // canceled.
  3402. func (c *AccountsContainersListCall) Context(ctx context.Context) *AccountsContainersListCall {
  3403. c.ctx_ = ctx
  3404. return c
  3405. }
  3406. // Header returns an http.Header that can be modified by the caller to
  3407. // add HTTP headers to the request.
  3408. func (c *AccountsContainersListCall) Header() http.Header {
  3409. if c.header_ == nil {
  3410. c.header_ = make(http.Header)
  3411. }
  3412. return c.header_
  3413. }
  3414. func (c *AccountsContainersListCall) doRequest(alt string) (*http.Response, error) {
  3415. reqHeaders := make(http.Header)
  3416. for k, v := range c.header_ {
  3417. reqHeaders[k] = v
  3418. }
  3419. reqHeaders.Set("User-Agent", c.s.userAgent())
  3420. if c.ifNoneMatch_ != "" {
  3421. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3422. }
  3423. var body io.Reader = nil
  3424. c.urlParams_.Set("alt", alt)
  3425. c.urlParams_.Set("prettyPrint", "false")
  3426. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/containers")
  3427. urls += "?" + c.urlParams_.Encode()
  3428. req, err := http.NewRequest("GET", urls, body)
  3429. if err != nil {
  3430. return nil, err
  3431. }
  3432. req.Header = reqHeaders
  3433. googleapi.Expand(req.URL, map[string]string{
  3434. "parent": c.parent,
  3435. })
  3436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3437. }
  3438. // Do executes the "tagmanager.accounts.containers.list" call.
  3439. // Exactly one of *ListContainersResponse or error will be non-nil. Any
  3440. // non-2xx status code is an error. Response headers are in either
  3441. // *ListContainersResponse.ServerResponse.Header or (if a response was
  3442. // returned at all) in error.(*googleapi.Error).Header. Use
  3443. // googleapi.IsNotModified to check whether the returned error was
  3444. // because http.StatusNotModified was returned.
  3445. func (c *AccountsContainersListCall) Do(opts ...googleapi.CallOption) (*ListContainersResponse, error) {
  3446. gensupport.SetOptions(c.urlParams_, opts...)
  3447. res, err := c.doRequest("json")
  3448. if res != nil && res.StatusCode == http.StatusNotModified {
  3449. if res.Body != nil {
  3450. res.Body.Close()
  3451. }
  3452. return nil, &googleapi.Error{
  3453. Code: res.StatusCode,
  3454. Header: res.Header,
  3455. }
  3456. }
  3457. if err != nil {
  3458. return nil, err
  3459. }
  3460. defer googleapi.CloseBody(res)
  3461. if err := googleapi.CheckResponse(res); err != nil {
  3462. return nil, err
  3463. }
  3464. ret := &ListContainersResponse{
  3465. ServerResponse: googleapi.ServerResponse{
  3466. Header: res.Header,
  3467. HTTPStatusCode: res.StatusCode,
  3468. },
  3469. }
  3470. target := &ret
  3471. if err := gensupport.DecodeResponse(target, res); err != nil {
  3472. return nil, err
  3473. }
  3474. return ret, nil
  3475. // {
  3476. // "description": "Lists all Containers that belongs to a GTM Account.",
  3477. // "httpMethod": "GET",
  3478. // "id": "tagmanager.accounts.containers.list",
  3479. // "parameterOrder": [
  3480. // "parent"
  3481. // ],
  3482. // "parameters": {
  3483. // "pageToken": {
  3484. // "description": "Continuation token for fetching the next page of results.",
  3485. // "location": "query",
  3486. // "type": "string"
  3487. // },
  3488. // "parent": {
  3489. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}.",
  3490. // "location": "path",
  3491. // "required": true,
  3492. // "type": "string"
  3493. // }
  3494. // },
  3495. // "path": "{+parent}/containers",
  3496. // "response": {
  3497. // "$ref": "ListContainersResponse"
  3498. // },
  3499. // "scopes": [
  3500. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3501. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3502. // ]
  3503. // }
  3504. }
  3505. // Pages invokes f for each page of results.
  3506. // A non-nil error returned from f will halt the iteration.
  3507. // The provided context supersedes any context provided to the Context method.
  3508. func (c *AccountsContainersListCall) Pages(ctx context.Context, f func(*ListContainersResponse) error) error {
  3509. c.ctx_ = ctx
  3510. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3511. for {
  3512. x, err := c.Do()
  3513. if err != nil {
  3514. return err
  3515. }
  3516. if err := f(x); err != nil {
  3517. return err
  3518. }
  3519. if x.NextPageToken == "" {
  3520. return nil
  3521. }
  3522. c.PageToken(x.NextPageToken)
  3523. }
  3524. }
  3525. // method id "tagmanager.accounts.containers.update":
  3526. type AccountsContainersUpdateCall struct {
  3527. s *Service
  3528. path string
  3529. container *Container
  3530. urlParams_ gensupport.URLParams
  3531. ctx_ context.Context
  3532. header_ http.Header
  3533. }
  3534. // Update: Updates a Container.
  3535. func (r *AccountsContainersService) Update(path string, container *Container) *AccountsContainersUpdateCall {
  3536. c := &AccountsContainersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3537. c.path = path
  3538. c.container = container
  3539. return c
  3540. }
  3541. // Fingerprint sets the optional parameter "fingerprint": When provided,
  3542. // this fingerprint must match the fingerprint of the container in
  3543. // storage.
  3544. func (c *AccountsContainersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersUpdateCall {
  3545. c.urlParams_.Set("fingerprint", fingerprint)
  3546. return c
  3547. }
  3548. // Fields allows partial responses to be retrieved. See
  3549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3550. // for more information.
  3551. func (c *AccountsContainersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersUpdateCall {
  3552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3553. return c
  3554. }
  3555. // Context sets the context to be used in this call's Do method. Any
  3556. // pending HTTP request will be aborted if the provided context is
  3557. // canceled.
  3558. func (c *AccountsContainersUpdateCall) Context(ctx context.Context) *AccountsContainersUpdateCall {
  3559. c.ctx_ = ctx
  3560. return c
  3561. }
  3562. // Header returns an http.Header that can be modified by the caller to
  3563. // add HTTP headers to the request.
  3564. func (c *AccountsContainersUpdateCall) Header() http.Header {
  3565. if c.header_ == nil {
  3566. c.header_ = make(http.Header)
  3567. }
  3568. return c.header_
  3569. }
  3570. func (c *AccountsContainersUpdateCall) doRequest(alt string) (*http.Response, error) {
  3571. reqHeaders := make(http.Header)
  3572. for k, v := range c.header_ {
  3573. reqHeaders[k] = v
  3574. }
  3575. reqHeaders.Set("User-Agent", c.s.userAgent())
  3576. var body io.Reader = nil
  3577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.container)
  3578. if err != nil {
  3579. return nil, err
  3580. }
  3581. reqHeaders.Set("Content-Type", "application/json")
  3582. c.urlParams_.Set("alt", alt)
  3583. c.urlParams_.Set("prettyPrint", "false")
  3584. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3585. urls += "?" + c.urlParams_.Encode()
  3586. req, err := http.NewRequest("PUT", urls, body)
  3587. if err != nil {
  3588. return nil, err
  3589. }
  3590. req.Header = reqHeaders
  3591. googleapi.Expand(req.URL, map[string]string{
  3592. "path": c.path,
  3593. })
  3594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3595. }
  3596. // Do executes the "tagmanager.accounts.containers.update" call.
  3597. // Exactly one of *Container or error will be non-nil. Any non-2xx
  3598. // status code is an error. Response headers are in either
  3599. // *Container.ServerResponse.Header or (if a response was returned at
  3600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3601. // to check whether the returned error was because
  3602. // http.StatusNotModified was returned.
  3603. func (c *AccountsContainersUpdateCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  3604. gensupport.SetOptions(c.urlParams_, opts...)
  3605. res, err := c.doRequest("json")
  3606. if res != nil && res.StatusCode == http.StatusNotModified {
  3607. if res.Body != nil {
  3608. res.Body.Close()
  3609. }
  3610. return nil, &googleapi.Error{
  3611. Code: res.StatusCode,
  3612. Header: res.Header,
  3613. }
  3614. }
  3615. if err != nil {
  3616. return nil, err
  3617. }
  3618. defer googleapi.CloseBody(res)
  3619. if err := googleapi.CheckResponse(res); err != nil {
  3620. return nil, err
  3621. }
  3622. ret := &Container{
  3623. ServerResponse: googleapi.ServerResponse{
  3624. Header: res.Header,
  3625. HTTPStatusCode: res.StatusCode,
  3626. },
  3627. }
  3628. target := &ret
  3629. if err := gensupport.DecodeResponse(target, res); err != nil {
  3630. return nil, err
  3631. }
  3632. return ret, nil
  3633. // {
  3634. // "description": "Updates a Container.",
  3635. // "httpMethod": "PUT",
  3636. // "id": "tagmanager.accounts.containers.update",
  3637. // "parameterOrder": [
  3638. // "path"
  3639. // ],
  3640. // "parameters": {
  3641. // "fingerprint": {
  3642. // "description": "When provided, this fingerprint must match the fingerprint of the container in storage.",
  3643. // "location": "query",
  3644. // "type": "string"
  3645. // },
  3646. // "path": {
  3647. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3648. // "location": "path",
  3649. // "required": true,
  3650. // "type": "string"
  3651. // }
  3652. // },
  3653. // "path": "{+path}",
  3654. // "request": {
  3655. // "$ref": "Container"
  3656. // },
  3657. // "response": {
  3658. // "$ref": "Container"
  3659. // },
  3660. // "scopes": [
  3661. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3662. // ]
  3663. // }
  3664. }
  3665. // method id "tagmanager.accounts.containers.environments.create":
  3666. type AccountsContainersEnvironmentsCreateCall struct {
  3667. s *Service
  3668. parent string
  3669. environment *Environment
  3670. urlParams_ gensupport.URLParams
  3671. ctx_ context.Context
  3672. header_ http.Header
  3673. }
  3674. // Create: Creates a GTM Environment.
  3675. func (r *AccountsContainersEnvironmentsService) Create(parent string, environment *Environment) *AccountsContainersEnvironmentsCreateCall {
  3676. c := &AccountsContainersEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3677. c.parent = parent
  3678. c.environment = environment
  3679. return c
  3680. }
  3681. // Fields allows partial responses to be retrieved. See
  3682. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3683. // for more information.
  3684. func (c *AccountsContainersEnvironmentsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsCreateCall {
  3685. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3686. return c
  3687. }
  3688. // Context sets the context to be used in this call's Do method. Any
  3689. // pending HTTP request will be aborted if the provided context is
  3690. // canceled.
  3691. func (c *AccountsContainersEnvironmentsCreateCall) Context(ctx context.Context) *AccountsContainersEnvironmentsCreateCall {
  3692. c.ctx_ = ctx
  3693. return c
  3694. }
  3695. // Header returns an http.Header that can be modified by the caller to
  3696. // add HTTP headers to the request.
  3697. func (c *AccountsContainersEnvironmentsCreateCall) Header() http.Header {
  3698. if c.header_ == nil {
  3699. c.header_ = make(http.Header)
  3700. }
  3701. return c.header_
  3702. }
  3703. func (c *AccountsContainersEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) {
  3704. reqHeaders := make(http.Header)
  3705. for k, v := range c.header_ {
  3706. reqHeaders[k] = v
  3707. }
  3708. reqHeaders.Set("User-Agent", c.s.userAgent())
  3709. var body io.Reader = nil
  3710. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  3711. if err != nil {
  3712. return nil, err
  3713. }
  3714. reqHeaders.Set("Content-Type", "application/json")
  3715. c.urlParams_.Set("alt", alt)
  3716. c.urlParams_.Set("prettyPrint", "false")
  3717. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/environments")
  3718. urls += "?" + c.urlParams_.Encode()
  3719. req, err := http.NewRequest("POST", urls, body)
  3720. if err != nil {
  3721. return nil, err
  3722. }
  3723. req.Header = reqHeaders
  3724. googleapi.Expand(req.URL, map[string]string{
  3725. "parent": c.parent,
  3726. })
  3727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3728. }
  3729. // Do executes the "tagmanager.accounts.containers.environments.create" call.
  3730. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  3731. // status code is an error. Response headers are in either
  3732. // *Environment.ServerResponse.Header or (if a response was returned at
  3733. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3734. // to check whether the returned error was because
  3735. // http.StatusNotModified was returned.
  3736. func (c *AccountsContainersEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  3737. gensupport.SetOptions(c.urlParams_, opts...)
  3738. res, err := c.doRequest("json")
  3739. if res != nil && res.StatusCode == http.StatusNotModified {
  3740. if res.Body != nil {
  3741. res.Body.Close()
  3742. }
  3743. return nil, &googleapi.Error{
  3744. Code: res.StatusCode,
  3745. Header: res.Header,
  3746. }
  3747. }
  3748. if err != nil {
  3749. return nil, err
  3750. }
  3751. defer googleapi.CloseBody(res)
  3752. if err := googleapi.CheckResponse(res); err != nil {
  3753. return nil, err
  3754. }
  3755. ret := &Environment{
  3756. ServerResponse: googleapi.ServerResponse{
  3757. Header: res.Header,
  3758. HTTPStatusCode: res.StatusCode,
  3759. },
  3760. }
  3761. target := &ret
  3762. if err := gensupport.DecodeResponse(target, res); err != nil {
  3763. return nil, err
  3764. }
  3765. return ret, nil
  3766. // {
  3767. // "description": "Creates a GTM Environment.",
  3768. // "httpMethod": "POST",
  3769. // "id": "tagmanager.accounts.containers.environments.create",
  3770. // "parameterOrder": [
  3771. // "parent"
  3772. // ],
  3773. // "parameters": {
  3774. // "parent": {
  3775. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3776. // "location": "path",
  3777. // "required": true,
  3778. // "type": "string"
  3779. // }
  3780. // },
  3781. // "path": "{+parent}/environments",
  3782. // "request": {
  3783. // "$ref": "Environment"
  3784. // },
  3785. // "response": {
  3786. // "$ref": "Environment"
  3787. // },
  3788. // "scopes": [
  3789. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3790. // ]
  3791. // }
  3792. }
  3793. // method id "tagmanager.accounts.containers.environments.delete":
  3794. type AccountsContainersEnvironmentsDeleteCall struct {
  3795. s *Service
  3796. path string
  3797. urlParams_ gensupport.URLParams
  3798. ctx_ context.Context
  3799. header_ http.Header
  3800. }
  3801. // Delete: Deletes a GTM Environment.
  3802. func (r *AccountsContainersEnvironmentsService) Delete(path string) *AccountsContainersEnvironmentsDeleteCall {
  3803. c := &AccountsContainersEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3804. c.path = path
  3805. return c
  3806. }
  3807. // Fields allows partial responses to be retrieved. See
  3808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3809. // for more information.
  3810. func (c *AccountsContainersEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsDeleteCall {
  3811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3812. return c
  3813. }
  3814. // Context sets the context to be used in this call's Do method. Any
  3815. // pending HTTP request will be aborted if the provided context is
  3816. // canceled.
  3817. func (c *AccountsContainersEnvironmentsDeleteCall) Context(ctx context.Context) *AccountsContainersEnvironmentsDeleteCall {
  3818. c.ctx_ = ctx
  3819. return c
  3820. }
  3821. // Header returns an http.Header that can be modified by the caller to
  3822. // add HTTP headers to the request.
  3823. func (c *AccountsContainersEnvironmentsDeleteCall) Header() http.Header {
  3824. if c.header_ == nil {
  3825. c.header_ = make(http.Header)
  3826. }
  3827. return c.header_
  3828. }
  3829. func (c *AccountsContainersEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3830. reqHeaders := make(http.Header)
  3831. for k, v := range c.header_ {
  3832. reqHeaders[k] = v
  3833. }
  3834. reqHeaders.Set("User-Agent", c.s.userAgent())
  3835. var body io.Reader = nil
  3836. c.urlParams_.Set("alt", alt)
  3837. c.urlParams_.Set("prettyPrint", "false")
  3838. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3839. urls += "?" + c.urlParams_.Encode()
  3840. req, err := http.NewRequest("DELETE", urls, body)
  3841. if err != nil {
  3842. return nil, err
  3843. }
  3844. req.Header = reqHeaders
  3845. googleapi.Expand(req.URL, map[string]string{
  3846. "path": c.path,
  3847. })
  3848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3849. }
  3850. // Do executes the "tagmanager.accounts.containers.environments.delete" call.
  3851. func (c *AccountsContainersEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  3852. gensupport.SetOptions(c.urlParams_, opts...)
  3853. res, err := c.doRequest("json")
  3854. if err != nil {
  3855. return err
  3856. }
  3857. defer googleapi.CloseBody(res)
  3858. if err := googleapi.CheckResponse(res); err != nil {
  3859. return err
  3860. }
  3861. return nil
  3862. // {
  3863. // "description": "Deletes a GTM Environment.",
  3864. // "httpMethod": "DELETE",
  3865. // "id": "tagmanager.accounts.containers.environments.delete",
  3866. // "parameterOrder": [
  3867. // "path"
  3868. // ],
  3869. // "parameters": {
  3870. // "path": {
  3871. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  3872. // "location": "path",
  3873. // "required": true,
  3874. // "type": "string"
  3875. // }
  3876. // },
  3877. // "path": "{+path}",
  3878. // "scopes": [
  3879. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3880. // ]
  3881. // }
  3882. }
  3883. // method id "tagmanager.accounts.containers.environments.get":
  3884. type AccountsContainersEnvironmentsGetCall struct {
  3885. s *Service
  3886. path string
  3887. urlParams_ gensupport.URLParams
  3888. ifNoneMatch_ string
  3889. ctx_ context.Context
  3890. header_ http.Header
  3891. }
  3892. // Get: Gets a GTM Environment.
  3893. func (r *AccountsContainersEnvironmentsService) Get(path string) *AccountsContainersEnvironmentsGetCall {
  3894. c := &AccountsContainersEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3895. c.path = path
  3896. return c
  3897. }
  3898. // Fields allows partial responses to be retrieved. See
  3899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3900. // for more information.
  3901. func (c *AccountsContainersEnvironmentsGetCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsGetCall {
  3902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3903. return c
  3904. }
  3905. // IfNoneMatch sets the optional parameter which makes the operation
  3906. // fail if the object's ETag matches the given value. This is useful for
  3907. // getting updates only after the object has changed since the last
  3908. // request. Use googleapi.IsNotModified to check whether the response
  3909. // error from Do is the result of In-None-Match.
  3910. func (c *AccountsContainersEnvironmentsGetCall) IfNoneMatch(entityTag string) *AccountsContainersEnvironmentsGetCall {
  3911. c.ifNoneMatch_ = entityTag
  3912. return c
  3913. }
  3914. // Context sets the context to be used in this call's Do method. Any
  3915. // pending HTTP request will be aborted if the provided context is
  3916. // canceled.
  3917. func (c *AccountsContainersEnvironmentsGetCall) Context(ctx context.Context) *AccountsContainersEnvironmentsGetCall {
  3918. c.ctx_ = ctx
  3919. return c
  3920. }
  3921. // Header returns an http.Header that can be modified by the caller to
  3922. // add HTTP headers to the request.
  3923. func (c *AccountsContainersEnvironmentsGetCall) Header() http.Header {
  3924. if c.header_ == nil {
  3925. c.header_ = make(http.Header)
  3926. }
  3927. return c.header_
  3928. }
  3929. func (c *AccountsContainersEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  3930. reqHeaders := make(http.Header)
  3931. for k, v := range c.header_ {
  3932. reqHeaders[k] = v
  3933. }
  3934. reqHeaders.Set("User-Agent", c.s.userAgent())
  3935. if c.ifNoneMatch_ != "" {
  3936. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3937. }
  3938. var body io.Reader = nil
  3939. c.urlParams_.Set("alt", alt)
  3940. c.urlParams_.Set("prettyPrint", "false")
  3941. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3942. urls += "?" + c.urlParams_.Encode()
  3943. req, err := http.NewRequest("GET", urls, body)
  3944. if err != nil {
  3945. return nil, err
  3946. }
  3947. req.Header = reqHeaders
  3948. googleapi.Expand(req.URL, map[string]string{
  3949. "path": c.path,
  3950. })
  3951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3952. }
  3953. // Do executes the "tagmanager.accounts.containers.environments.get" call.
  3954. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  3955. // status code is an error. Response headers are in either
  3956. // *Environment.ServerResponse.Header or (if a response was returned at
  3957. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3958. // to check whether the returned error was because
  3959. // http.StatusNotModified was returned.
  3960. func (c *AccountsContainersEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  3961. gensupport.SetOptions(c.urlParams_, opts...)
  3962. res, err := c.doRequest("json")
  3963. if res != nil && res.StatusCode == http.StatusNotModified {
  3964. if res.Body != nil {
  3965. res.Body.Close()
  3966. }
  3967. return nil, &googleapi.Error{
  3968. Code: res.StatusCode,
  3969. Header: res.Header,
  3970. }
  3971. }
  3972. if err != nil {
  3973. return nil, err
  3974. }
  3975. defer googleapi.CloseBody(res)
  3976. if err := googleapi.CheckResponse(res); err != nil {
  3977. return nil, err
  3978. }
  3979. ret := &Environment{
  3980. ServerResponse: googleapi.ServerResponse{
  3981. Header: res.Header,
  3982. HTTPStatusCode: res.StatusCode,
  3983. },
  3984. }
  3985. target := &ret
  3986. if err := gensupport.DecodeResponse(target, res); err != nil {
  3987. return nil, err
  3988. }
  3989. return ret, nil
  3990. // {
  3991. // "description": "Gets a GTM Environment.",
  3992. // "httpMethod": "GET",
  3993. // "id": "tagmanager.accounts.containers.environments.get",
  3994. // "parameterOrder": [
  3995. // "path"
  3996. // ],
  3997. // "parameters": {
  3998. // "path": {
  3999. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  4000. // "location": "path",
  4001. // "required": true,
  4002. // "type": "string"
  4003. // }
  4004. // },
  4005. // "path": "{+path}",
  4006. // "response": {
  4007. // "$ref": "Environment"
  4008. // },
  4009. // "scopes": [
  4010. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4011. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4012. // ]
  4013. // }
  4014. }
  4015. // method id "tagmanager.accounts.containers.environments.list":
  4016. type AccountsContainersEnvironmentsListCall struct {
  4017. s *Service
  4018. parent string
  4019. urlParams_ gensupport.URLParams
  4020. ifNoneMatch_ string
  4021. ctx_ context.Context
  4022. header_ http.Header
  4023. }
  4024. // List: Lists all GTM Environments of a GTM Container.
  4025. func (r *AccountsContainersEnvironmentsService) List(parent string) *AccountsContainersEnvironmentsListCall {
  4026. c := &AccountsContainersEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4027. c.parent = parent
  4028. return c
  4029. }
  4030. // PageToken sets the optional parameter "pageToken": Continuation token
  4031. // for fetching the next page of results.
  4032. func (c *AccountsContainersEnvironmentsListCall) PageToken(pageToken string) *AccountsContainersEnvironmentsListCall {
  4033. c.urlParams_.Set("pageToken", pageToken)
  4034. return c
  4035. }
  4036. // Fields allows partial responses to be retrieved. See
  4037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4038. // for more information.
  4039. func (c *AccountsContainersEnvironmentsListCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsListCall {
  4040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4041. return c
  4042. }
  4043. // IfNoneMatch sets the optional parameter which makes the operation
  4044. // fail if the object's ETag matches the given value. This is useful for
  4045. // getting updates only after the object has changed since the last
  4046. // request. Use googleapi.IsNotModified to check whether the response
  4047. // error from Do is the result of In-None-Match.
  4048. func (c *AccountsContainersEnvironmentsListCall) IfNoneMatch(entityTag string) *AccountsContainersEnvironmentsListCall {
  4049. c.ifNoneMatch_ = entityTag
  4050. return c
  4051. }
  4052. // Context sets the context to be used in this call's Do method. Any
  4053. // pending HTTP request will be aborted if the provided context is
  4054. // canceled.
  4055. func (c *AccountsContainersEnvironmentsListCall) Context(ctx context.Context) *AccountsContainersEnvironmentsListCall {
  4056. c.ctx_ = ctx
  4057. return c
  4058. }
  4059. // Header returns an http.Header that can be modified by the caller to
  4060. // add HTTP headers to the request.
  4061. func (c *AccountsContainersEnvironmentsListCall) Header() http.Header {
  4062. if c.header_ == nil {
  4063. c.header_ = make(http.Header)
  4064. }
  4065. return c.header_
  4066. }
  4067. func (c *AccountsContainersEnvironmentsListCall) doRequest(alt string) (*http.Response, error) {
  4068. reqHeaders := make(http.Header)
  4069. for k, v := range c.header_ {
  4070. reqHeaders[k] = v
  4071. }
  4072. reqHeaders.Set("User-Agent", c.s.userAgent())
  4073. if c.ifNoneMatch_ != "" {
  4074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4075. }
  4076. var body io.Reader = nil
  4077. c.urlParams_.Set("alt", alt)
  4078. c.urlParams_.Set("prettyPrint", "false")
  4079. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/environments")
  4080. urls += "?" + c.urlParams_.Encode()
  4081. req, err := http.NewRequest("GET", urls, body)
  4082. if err != nil {
  4083. return nil, err
  4084. }
  4085. req.Header = reqHeaders
  4086. googleapi.Expand(req.URL, map[string]string{
  4087. "parent": c.parent,
  4088. })
  4089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4090. }
  4091. // Do executes the "tagmanager.accounts.containers.environments.list" call.
  4092. // Exactly one of *ListEnvironmentsResponse or error will be non-nil.
  4093. // Any non-2xx status code is an error. Response headers are in either
  4094. // *ListEnvironmentsResponse.ServerResponse.Header or (if a response was
  4095. // returned at all) in error.(*googleapi.Error).Header. Use
  4096. // googleapi.IsNotModified to check whether the returned error was
  4097. // because http.StatusNotModified was returned.
  4098. func (c *AccountsContainersEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) {
  4099. gensupport.SetOptions(c.urlParams_, opts...)
  4100. res, err := c.doRequest("json")
  4101. if res != nil && res.StatusCode == http.StatusNotModified {
  4102. if res.Body != nil {
  4103. res.Body.Close()
  4104. }
  4105. return nil, &googleapi.Error{
  4106. Code: res.StatusCode,
  4107. Header: res.Header,
  4108. }
  4109. }
  4110. if err != nil {
  4111. return nil, err
  4112. }
  4113. defer googleapi.CloseBody(res)
  4114. if err := googleapi.CheckResponse(res); err != nil {
  4115. return nil, err
  4116. }
  4117. ret := &ListEnvironmentsResponse{
  4118. ServerResponse: googleapi.ServerResponse{
  4119. Header: res.Header,
  4120. HTTPStatusCode: res.StatusCode,
  4121. },
  4122. }
  4123. target := &ret
  4124. if err := gensupport.DecodeResponse(target, res); err != nil {
  4125. return nil, err
  4126. }
  4127. return ret, nil
  4128. // {
  4129. // "description": "Lists all GTM Environments of a GTM Container.",
  4130. // "httpMethod": "GET",
  4131. // "id": "tagmanager.accounts.containers.environments.list",
  4132. // "parameterOrder": [
  4133. // "parent"
  4134. // ],
  4135. // "parameters": {
  4136. // "pageToken": {
  4137. // "description": "Continuation token for fetching the next page of results.",
  4138. // "location": "query",
  4139. // "type": "string"
  4140. // },
  4141. // "parent": {
  4142. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  4143. // "location": "path",
  4144. // "required": true,
  4145. // "type": "string"
  4146. // }
  4147. // },
  4148. // "path": "{+parent}/environments",
  4149. // "response": {
  4150. // "$ref": "ListEnvironmentsResponse"
  4151. // },
  4152. // "scopes": [
  4153. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4154. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4155. // ]
  4156. // }
  4157. }
  4158. // Pages invokes f for each page of results.
  4159. // A non-nil error returned from f will halt the iteration.
  4160. // The provided context supersedes any context provided to the Context method.
  4161. func (c *AccountsContainersEnvironmentsListCall) Pages(ctx context.Context, f func(*ListEnvironmentsResponse) error) error {
  4162. c.ctx_ = ctx
  4163. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4164. for {
  4165. x, err := c.Do()
  4166. if err != nil {
  4167. return err
  4168. }
  4169. if err := f(x); err != nil {
  4170. return err
  4171. }
  4172. if x.NextPageToken == "" {
  4173. return nil
  4174. }
  4175. c.PageToken(x.NextPageToken)
  4176. }
  4177. }
  4178. // method id "tagmanager.accounts.containers.environments.reauthorize":
  4179. type AccountsContainersEnvironmentsReauthorizeCall struct {
  4180. s *Service
  4181. path string
  4182. environment *Environment
  4183. urlParams_ gensupport.URLParams
  4184. ctx_ context.Context
  4185. header_ http.Header
  4186. }
  4187. // Reauthorize: Re-generates the authorization code for a GTM
  4188. // Environment.
  4189. func (r *AccountsContainersEnvironmentsService) Reauthorize(path string, environment *Environment) *AccountsContainersEnvironmentsReauthorizeCall {
  4190. c := &AccountsContainersEnvironmentsReauthorizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4191. c.path = path
  4192. c.environment = environment
  4193. return c
  4194. }
  4195. // Fields allows partial responses to be retrieved. See
  4196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4197. // for more information.
  4198. func (c *AccountsContainersEnvironmentsReauthorizeCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsReauthorizeCall {
  4199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4200. return c
  4201. }
  4202. // Context sets the context to be used in this call's Do method. Any
  4203. // pending HTTP request will be aborted if the provided context is
  4204. // canceled.
  4205. func (c *AccountsContainersEnvironmentsReauthorizeCall) Context(ctx context.Context) *AccountsContainersEnvironmentsReauthorizeCall {
  4206. c.ctx_ = ctx
  4207. return c
  4208. }
  4209. // Header returns an http.Header that can be modified by the caller to
  4210. // add HTTP headers to the request.
  4211. func (c *AccountsContainersEnvironmentsReauthorizeCall) Header() http.Header {
  4212. if c.header_ == nil {
  4213. c.header_ = make(http.Header)
  4214. }
  4215. return c.header_
  4216. }
  4217. func (c *AccountsContainersEnvironmentsReauthorizeCall) doRequest(alt string) (*http.Response, error) {
  4218. reqHeaders := make(http.Header)
  4219. for k, v := range c.header_ {
  4220. reqHeaders[k] = v
  4221. }
  4222. reqHeaders.Set("User-Agent", c.s.userAgent())
  4223. var body io.Reader = nil
  4224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  4225. if err != nil {
  4226. return nil, err
  4227. }
  4228. reqHeaders.Set("Content-Type", "application/json")
  4229. c.urlParams_.Set("alt", alt)
  4230. c.urlParams_.Set("prettyPrint", "false")
  4231. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:reauthorize")
  4232. urls += "?" + c.urlParams_.Encode()
  4233. req, err := http.NewRequest("POST", urls, body)
  4234. if err != nil {
  4235. return nil, err
  4236. }
  4237. req.Header = reqHeaders
  4238. googleapi.Expand(req.URL, map[string]string{
  4239. "path": c.path,
  4240. })
  4241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4242. }
  4243. // Do executes the "tagmanager.accounts.containers.environments.reauthorize" call.
  4244. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  4245. // status code is an error. Response headers are in either
  4246. // *Environment.ServerResponse.Header or (if a response was returned at
  4247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4248. // to check whether the returned error was because
  4249. // http.StatusNotModified was returned.
  4250. func (c *AccountsContainersEnvironmentsReauthorizeCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  4251. gensupport.SetOptions(c.urlParams_, opts...)
  4252. res, err := c.doRequest("json")
  4253. if res != nil && res.StatusCode == http.StatusNotModified {
  4254. if res.Body != nil {
  4255. res.Body.Close()
  4256. }
  4257. return nil, &googleapi.Error{
  4258. Code: res.StatusCode,
  4259. Header: res.Header,
  4260. }
  4261. }
  4262. if err != nil {
  4263. return nil, err
  4264. }
  4265. defer googleapi.CloseBody(res)
  4266. if err := googleapi.CheckResponse(res); err != nil {
  4267. return nil, err
  4268. }
  4269. ret := &Environment{
  4270. ServerResponse: googleapi.ServerResponse{
  4271. Header: res.Header,
  4272. HTTPStatusCode: res.StatusCode,
  4273. },
  4274. }
  4275. target := &ret
  4276. if err := gensupport.DecodeResponse(target, res); err != nil {
  4277. return nil, err
  4278. }
  4279. return ret, nil
  4280. // {
  4281. // "description": "Re-generates the authorization code for a GTM Environment.",
  4282. // "httpMethod": "POST",
  4283. // "id": "tagmanager.accounts.containers.environments.reauthorize",
  4284. // "parameterOrder": [
  4285. // "path"
  4286. // ],
  4287. // "parameters": {
  4288. // "path": {
  4289. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  4290. // "location": "path",
  4291. // "required": true,
  4292. // "type": "string"
  4293. // }
  4294. // },
  4295. // "path": "{+path}:reauthorize",
  4296. // "request": {
  4297. // "$ref": "Environment"
  4298. // },
  4299. // "response": {
  4300. // "$ref": "Environment"
  4301. // },
  4302. // "scopes": [
  4303. // "https://www.googleapis.com/auth/tagmanager.publish"
  4304. // ]
  4305. // }
  4306. }
  4307. // method id "tagmanager.accounts.containers.environments.update":
  4308. type AccountsContainersEnvironmentsUpdateCall struct {
  4309. s *Service
  4310. path string
  4311. environment *Environment
  4312. urlParams_ gensupport.URLParams
  4313. ctx_ context.Context
  4314. header_ http.Header
  4315. }
  4316. // Update: Updates a GTM Environment.
  4317. func (r *AccountsContainersEnvironmentsService) Update(path string, environment *Environment) *AccountsContainersEnvironmentsUpdateCall {
  4318. c := &AccountsContainersEnvironmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4319. c.path = path
  4320. c.environment = environment
  4321. return c
  4322. }
  4323. // Fingerprint sets the optional parameter "fingerprint": When provided,
  4324. // this fingerprint must match the fingerprint of the environment in
  4325. // storage.
  4326. func (c *AccountsContainersEnvironmentsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersEnvironmentsUpdateCall {
  4327. c.urlParams_.Set("fingerprint", fingerprint)
  4328. return c
  4329. }
  4330. // Fields allows partial responses to be retrieved. See
  4331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4332. // for more information.
  4333. func (c *AccountsContainersEnvironmentsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsUpdateCall {
  4334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4335. return c
  4336. }
  4337. // Context sets the context to be used in this call's Do method. Any
  4338. // pending HTTP request will be aborted if the provided context is
  4339. // canceled.
  4340. func (c *AccountsContainersEnvironmentsUpdateCall) Context(ctx context.Context) *AccountsContainersEnvironmentsUpdateCall {
  4341. c.ctx_ = ctx
  4342. return c
  4343. }
  4344. // Header returns an http.Header that can be modified by the caller to
  4345. // add HTTP headers to the request.
  4346. func (c *AccountsContainersEnvironmentsUpdateCall) Header() http.Header {
  4347. if c.header_ == nil {
  4348. c.header_ = make(http.Header)
  4349. }
  4350. return c.header_
  4351. }
  4352. func (c *AccountsContainersEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4353. reqHeaders := make(http.Header)
  4354. for k, v := range c.header_ {
  4355. reqHeaders[k] = v
  4356. }
  4357. reqHeaders.Set("User-Agent", c.s.userAgent())
  4358. var body io.Reader = nil
  4359. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  4360. if err != nil {
  4361. return nil, err
  4362. }
  4363. reqHeaders.Set("Content-Type", "application/json")
  4364. c.urlParams_.Set("alt", alt)
  4365. c.urlParams_.Set("prettyPrint", "false")
  4366. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  4367. urls += "?" + c.urlParams_.Encode()
  4368. req, err := http.NewRequest("PUT", urls, body)
  4369. if err != nil {
  4370. return nil, err
  4371. }
  4372. req.Header = reqHeaders
  4373. googleapi.Expand(req.URL, map[string]string{
  4374. "path": c.path,
  4375. })
  4376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4377. }
  4378. // Do executes the "tagmanager.accounts.containers.environments.update" call.
  4379. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  4380. // status code is an error. Response headers are in either
  4381. // *Environment.ServerResponse.Header or (if a response was returned at
  4382. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4383. // to check whether the returned error was because
  4384. // http.StatusNotModified was returned.
  4385. func (c *AccountsContainersEnvironmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  4386. gensupport.SetOptions(c.urlParams_, opts...)
  4387. res, err := c.doRequest("json")
  4388. if res != nil && res.StatusCode == http.StatusNotModified {
  4389. if res.Body != nil {
  4390. res.Body.Close()
  4391. }
  4392. return nil, &googleapi.Error{
  4393. Code: res.StatusCode,
  4394. Header: res.Header,
  4395. }
  4396. }
  4397. if err != nil {
  4398. return nil, err
  4399. }
  4400. defer googleapi.CloseBody(res)
  4401. if err := googleapi.CheckResponse(res); err != nil {
  4402. return nil, err
  4403. }
  4404. ret := &Environment{
  4405. ServerResponse: googleapi.ServerResponse{
  4406. Header: res.Header,
  4407. HTTPStatusCode: res.StatusCode,
  4408. },
  4409. }
  4410. target := &ret
  4411. if err := gensupport.DecodeResponse(target, res); err != nil {
  4412. return nil, err
  4413. }
  4414. return ret, nil
  4415. // {
  4416. // "description": "Updates a GTM Environment.",
  4417. // "httpMethod": "PUT",
  4418. // "id": "tagmanager.accounts.containers.environments.update",
  4419. // "parameterOrder": [
  4420. // "path"
  4421. // ],
  4422. // "parameters": {
  4423. // "fingerprint": {
  4424. // "description": "When provided, this fingerprint must match the fingerprint of the environment in storage.",
  4425. // "location": "query",
  4426. // "type": "string"
  4427. // },
  4428. // "path": {
  4429. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  4430. // "location": "path",
  4431. // "required": true,
  4432. // "type": "string"
  4433. // }
  4434. // },
  4435. // "path": "{+path}",
  4436. // "request": {
  4437. // "$ref": "Environment"
  4438. // },
  4439. // "response": {
  4440. // "$ref": "Environment"
  4441. // },
  4442. // "scopes": [
  4443. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4444. // ]
  4445. // }
  4446. }
  4447. // method id "tagmanager.accounts.containers.version_headers.latest":
  4448. type AccountsContainersVersionHeadersLatestCall struct {
  4449. s *Service
  4450. parent string
  4451. urlParams_ gensupport.URLParams
  4452. ifNoneMatch_ string
  4453. ctx_ context.Context
  4454. header_ http.Header
  4455. }
  4456. // Latest: Gets the latest container version header
  4457. func (r *AccountsContainersVersionHeadersService) Latest(parent string) *AccountsContainersVersionHeadersLatestCall {
  4458. c := &AccountsContainersVersionHeadersLatestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4459. c.parent = parent
  4460. return c
  4461. }
  4462. // Fields allows partial responses to be retrieved. See
  4463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4464. // for more information.
  4465. func (c *AccountsContainersVersionHeadersLatestCall) Fields(s ...googleapi.Field) *AccountsContainersVersionHeadersLatestCall {
  4466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4467. return c
  4468. }
  4469. // IfNoneMatch sets the optional parameter which makes the operation
  4470. // fail if the object's ETag matches the given value. This is useful for
  4471. // getting updates only after the object has changed since the last
  4472. // request. Use googleapi.IsNotModified to check whether the response
  4473. // error from Do is the result of In-None-Match.
  4474. func (c *AccountsContainersVersionHeadersLatestCall) IfNoneMatch(entityTag string) *AccountsContainersVersionHeadersLatestCall {
  4475. c.ifNoneMatch_ = entityTag
  4476. return c
  4477. }
  4478. // Context sets the context to be used in this call's Do method. Any
  4479. // pending HTTP request will be aborted if the provided context is
  4480. // canceled.
  4481. func (c *AccountsContainersVersionHeadersLatestCall) Context(ctx context.Context) *AccountsContainersVersionHeadersLatestCall {
  4482. c.ctx_ = ctx
  4483. return c
  4484. }
  4485. // Header returns an http.Header that can be modified by the caller to
  4486. // add HTTP headers to the request.
  4487. func (c *AccountsContainersVersionHeadersLatestCall) Header() http.Header {
  4488. if c.header_ == nil {
  4489. c.header_ = make(http.Header)
  4490. }
  4491. return c.header_
  4492. }
  4493. func (c *AccountsContainersVersionHeadersLatestCall) doRequest(alt string) (*http.Response, error) {
  4494. reqHeaders := make(http.Header)
  4495. for k, v := range c.header_ {
  4496. reqHeaders[k] = v
  4497. }
  4498. reqHeaders.Set("User-Agent", c.s.userAgent())
  4499. if c.ifNoneMatch_ != "" {
  4500. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4501. }
  4502. var body io.Reader = nil
  4503. c.urlParams_.Set("alt", alt)
  4504. c.urlParams_.Set("prettyPrint", "false")
  4505. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/version_headers:latest")
  4506. urls += "?" + c.urlParams_.Encode()
  4507. req, err := http.NewRequest("GET", urls, body)
  4508. if err != nil {
  4509. return nil, err
  4510. }
  4511. req.Header = reqHeaders
  4512. googleapi.Expand(req.URL, map[string]string{
  4513. "parent": c.parent,
  4514. })
  4515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4516. }
  4517. // Do executes the "tagmanager.accounts.containers.version_headers.latest" call.
  4518. // Exactly one of *ContainerVersionHeader or error will be non-nil. Any
  4519. // non-2xx status code is an error. Response headers are in either
  4520. // *ContainerVersionHeader.ServerResponse.Header or (if a response was
  4521. // returned at all) in error.(*googleapi.Error).Header. Use
  4522. // googleapi.IsNotModified to check whether the returned error was
  4523. // because http.StatusNotModified was returned.
  4524. func (c *AccountsContainersVersionHeadersLatestCall) Do(opts ...googleapi.CallOption) (*ContainerVersionHeader, error) {
  4525. gensupport.SetOptions(c.urlParams_, opts...)
  4526. res, err := c.doRequest("json")
  4527. if res != nil && res.StatusCode == http.StatusNotModified {
  4528. if res.Body != nil {
  4529. res.Body.Close()
  4530. }
  4531. return nil, &googleapi.Error{
  4532. Code: res.StatusCode,
  4533. Header: res.Header,
  4534. }
  4535. }
  4536. if err != nil {
  4537. return nil, err
  4538. }
  4539. defer googleapi.CloseBody(res)
  4540. if err := googleapi.CheckResponse(res); err != nil {
  4541. return nil, err
  4542. }
  4543. ret := &ContainerVersionHeader{
  4544. ServerResponse: googleapi.ServerResponse{
  4545. Header: res.Header,
  4546. HTTPStatusCode: res.StatusCode,
  4547. },
  4548. }
  4549. target := &ret
  4550. if err := gensupport.DecodeResponse(target, res); err != nil {
  4551. return nil, err
  4552. }
  4553. return ret, nil
  4554. // {
  4555. // "description": "Gets the latest container version header",
  4556. // "httpMethod": "GET",
  4557. // "id": "tagmanager.accounts.containers.version_headers.latest",
  4558. // "parameterOrder": [
  4559. // "parent"
  4560. // ],
  4561. // "parameters": {
  4562. // "parent": {
  4563. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  4564. // "location": "path",
  4565. // "required": true,
  4566. // "type": "string"
  4567. // }
  4568. // },
  4569. // "path": "{+parent}/version_headers:latest",
  4570. // "response": {
  4571. // "$ref": "ContainerVersionHeader"
  4572. // },
  4573. // "scopes": [
  4574. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4575. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4576. // ]
  4577. // }
  4578. }
  4579. // method id "tagmanager.accounts.containers.version_headers.list":
  4580. type AccountsContainersVersionHeadersListCall struct {
  4581. s *Service
  4582. parent string
  4583. urlParams_ gensupport.URLParams
  4584. ifNoneMatch_ string
  4585. ctx_ context.Context
  4586. header_ http.Header
  4587. }
  4588. // List: Lists all Container Versions of a GTM Container.
  4589. func (r *AccountsContainersVersionHeadersService) List(parent string) *AccountsContainersVersionHeadersListCall {
  4590. c := &AccountsContainersVersionHeadersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4591. c.parent = parent
  4592. return c
  4593. }
  4594. // IncludeDeleted sets the optional parameter "includeDeleted": Also
  4595. // retrieve deleted (archived) versions when true.
  4596. func (c *AccountsContainersVersionHeadersListCall) IncludeDeleted(includeDeleted bool) *AccountsContainersVersionHeadersListCall {
  4597. c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  4598. return c
  4599. }
  4600. // PageToken sets the optional parameter "pageToken": Continuation token
  4601. // for fetching the next page of results.
  4602. func (c *AccountsContainersVersionHeadersListCall) PageToken(pageToken string) *AccountsContainersVersionHeadersListCall {
  4603. c.urlParams_.Set("pageToken", pageToken)
  4604. return c
  4605. }
  4606. // Fields allows partial responses to be retrieved. See
  4607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4608. // for more information.
  4609. func (c *AccountsContainersVersionHeadersListCall) Fields(s ...googleapi.Field) *AccountsContainersVersionHeadersListCall {
  4610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4611. return c
  4612. }
  4613. // IfNoneMatch sets the optional parameter which makes the operation
  4614. // fail if the object's ETag matches the given value. This is useful for
  4615. // getting updates only after the object has changed since the last
  4616. // request. Use googleapi.IsNotModified to check whether the response
  4617. // error from Do is the result of In-None-Match.
  4618. func (c *AccountsContainersVersionHeadersListCall) IfNoneMatch(entityTag string) *AccountsContainersVersionHeadersListCall {
  4619. c.ifNoneMatch_ = entityTag
  4620. return c
  4621. }
  4622. // Context sets the context to be used in this call's Do method. Any
  4623. // pending HTTP request will be aborted if the provided context is
  4624. // canceled.
  4625. func (c *AccountsContainersVersionHeadersListCall) Context(ctx context.Context) *AccountsContainersVersionHeadersListCall {
  4626. c.ctx_ = ctx
  4627. return c
  4628. }
  4629. // Header returns an http.Header that can be modified by the caller to
  4630. // add HTTP headers to the request.
  4631. func (c *AccountsContainersVersionHeadersListCall) Header() http.Header {
  4632. if c.header_ == nil {
  4633. c.header_ = make(http.Header)
  4634. }
  4635. return c.header_
  4636. }
  4637. func (c *AccountsContainersVersionHeadersListCall) doRequest(alt string) (*http.Response, error) {
  4638. reqHeaders := make(http.Header)
  4639. for k, v := range c.header_ {
  4640. reqHeaders[k] = v
  4641. }
  4642. reqHeaders.Set("User-Agent", c.s.userAgent())
  4643. if c.ifNoneMatch_ != "" {
  4644. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4645. }
  4646. var body io.Reader = nil
  4647. c.urlParams_.Set("alt", alt)
  4648. c.urlParams_.Set("prettyPrint", "false")
  4649. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/version_headers")
  4650. urls += "?" + c.urlParams_.Encode()
  4651. req, err := http.NewRequest("GET", urls, body)
  4652. if err != nil {
  4653. return nil, err
  4654. }
  4655. req.Header = reqHeaders
  4656. googleapi.Expand(req.URL, map[string]string{
  4657. "parent": c.parent,
  4658. })
  4659. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4660. }
  4661. // Do executes the "tagmanager.accounts.containers.version_headers.list" call.
  4662. // Exactly one of *ListContainerVersionsResponse or error will be
  4663. // non-nil. Any non-2xx status code is an error. Response headers are in
  4664. // either *ListContainerVersionsResponse.ServerResponse.Header or (if a
  4665. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4666. // googleapi.IsNotModified to check whether the returned error was
  4667. // because http.StatusNotModified was returned.
  4668. func (c *AccountsContainersVersionHeadersListCall) Do(opts ...googleapi.CallOption) (*ListContainerVersionsResponse, error) {
  4669. gensupport.SetOptions(c.urlParams_, opts...)
  4670. res, err := c.doRequest("json")
  4671. if res != nil && res.StatusCode == http.StatusNotModified {
  4672. if res.Body != nil {
  4673. res.Body.Close()
  4674. }
  4675. return nil, &googleapi.Error{
  4676. Code: res.StatusCode,
  4677. Header: res.Header,
  4678. }
  4679. }
  4680. if err != nil {
  4681. return nil, err
  4682. }
  4683. defer googleapi.CloseBody(res)
  4684. if err := googleapi.CheckResponse(res); err != nil {
  4685. return nil, err
  4686. }
  4687. ret := &ListContainerVersionsResponse{
  4688. ServerResponse: googleapi.ServerResponse{
  4689. Header: res.Header,
  4690. HTTPStatusCode: res.StatusCode,
  4691. },
  4692. }
  4693. target := &ret
  4694. if err := gensupport.DecodeResponse(target, res); err != nil {
  4695. return nil, err
  4696. }
  4697. return ret, nil
  4698. // {
  4699. // "description": "Lists all Container Versions of a GTM Container.",
  4700. // "httpMethod": "GET",
  4701. // "id": "tagmanager.accounts.containers.version_headers.list",
  4702. // "parameterOrder": [
  4703. // "parent"
  4704. // ],
  4705. // "parameters": {
  4706. // "includeDeleted": {
  4707. // "description": "Also retrieve deleted (archived) versions when true.",
  4708. // "location": "query",
  4709. // "type": "boolean"
  4710. // },
  4711. // "pageToken": {
  4712. // "description": "Continuation token for fetching the next page of results.",
  4713. // "location": "query",
  4714. // "type": "string"
  4715. // },
  4716. // "parent": {
  4717. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  4718. // "location": "path",
  4719. // "required": true,
  4720. // "type": "string"
  4721. // }
  4722. // },
  4723. // "path": "{+parent}/version_headers",
  4724. // "response": {
  4725. // "$ref": "ListContainerVersionsResponse"
  4726. // },
  4727. // "scopes": [
  4728. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4729. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  4730. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4731. // ]
  4732. // }
  4733. }
  4734. // Pages invokes f for each page of results.
  4735. // A non-nil error returned from f will halt the iteration.
  4736. // The provided context supersedes any context provided to the Context method.
  4737. func (c *AccountsContainersVersionHeadersListCall) Pages(ctx context.Context, f func(*ListContainerVersionsResponse) error) error {
  4738. c.ctx_ = ctx
  4739. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4740. for {
  4741. x, err := c.Do()
  4742. if err != nil {
  4743. return err
  4744. }
  4745. if err := f(x); err != nil {
  4746. return err
  4747. }
  4748. if x.NextPageToken == "" {
  4749. return nil
  4750. }
  4751. c.PageToken(x.NextPageToken)
  4752. }
  4753. }
  4754. // method id "tagmanager.accounts.containers.versions.delete":
  4755. type AccountsContainersVersionsDeleteCall struct {
  4756. s *Service
  4757. path string
  4758. urlParams_ gensupport.URLParams
  4759. ctx_ context.Context
  4760. header_ http.Header
  4761. }
  4762. // Delete: Deletes a Container Version.
  4763. func (r *AccountsContainersVersionsService) Delete(path string) *AccountsContainersVersionsDeleteCall {
  4764. c := &AccountsContainersVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4765. c.path = path
  4766. return c
  4767. }
  4768. // Fields allows partial responses to be retrieved. See
  4769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4770. // for more information.
  4771. func (c *AccountsContainersVersionsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsDeleteCall {
  4772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4773. return c
  4774. }
  4775. // Context sets the context to be used in this call's Do method. Any
  4776. // pending HTTP request will be aborted if the provided context is
  4777. // canceled.
  4778. func (c *AccountsContainersVersionsDeleteCall) Context(ctx context.Context) *AccountsContainersVersionsDeleteCall {
  4779. c.ctx_ = ctx
  4780. return c
  4781. }
  4782. // Header returns an http.Header that can be modified by the caller to
  4783. // add HTTP headers to the request.
  4784. func (c *AccountsContainersVersionsDeleteCall) Header() http.Header {
  4785. if c.header_ == nil {
  4786. c.header_ = make(http.Header)
  4787. }
  4788. return c.header_
  4789. }
  4790. func (c *AccountsContainersVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4791. reqHeaders := make(http.Header)
  4792. for k, v := range c.header_ {
  4793. reqHeaders[k] = v
  4794. }
  4795. reqHeaders.Set("User-Agent", c.s.userAgent())
  4796. var body io.Reader = nil
  4797. c.urlParams_.Set("alt", alt)
  4798. c.urlParams_.Set("prettyPrint", "false")
  4799. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  4800. urls += "?" + c.urlParams_.Encode()
  4801. req, err := http.NewRequest("DELETE", urls, body)
  4802. if err != nil {
  4803. return nil, err
  4804. }
  4805. req.Header = reqHeaders
  4806. googleapi.Expand(req.URL, map[string]string{
  4807. "path": c.path,
  4808. })
  4809. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4810. }
  4811. // Do executes the "tagmanager.accounts.containers.versions.delete" call.
  4812. func (c *AccountsContainersVersionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4813. gensupport.SetOptions(c.urlParams_, opts...)
  4814. res, err := c.doRequest("json")
  4815. if err != nil {
  4816. return err
  4817. }
  4818. defer googleapi.CloseBody(res)
  4819. if err := googleapi.CheckResponse(res); err != nil {
  4820. return err
  4821. }
  4822. return nil
  4823. // {
  4824. // "description": "Deletes a Container Version.",
  4825. // "httpMethod": "DELETE",
  4826. // "id": "tagmanager.accounts.containers.versions.delete",
  4827. // "parameterOrder": [
  4828. // "path"
  4829. // ],
  4830. // "parameters": {
  4831. // "path": {
  4832. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  4833. // "location": "path",
  4834. // "required": true,
  4835. // "type": "string"
  4836. // }
  4837. // },
  4838. // "path": "{+path}",
  4839. // "scopes": [
  4840. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  4841. // ]
  4842. // }
  4843. }
  4844. // method id "tagmanager.accounts.containers.versions.get":
  4845. type AccountsContainersVersionsGetCall struct {
  4846. s *Service
  4847. path string
  4848. urlParams_ gensupport.URLParams
  4849. ifNoneMatch_ string
  4850. ctx_ context.Context
  4851. header_ http.Header
  4852. }
  4853. // Get: Gets a Container Version.
  4854. func (r *AccountsContainersVersionsService) Get(path string) *AccountsContainersVersionsGetCall {
  4855. c := &AccountsContainersVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4856. c.path = path
  4857. return c
  4858. }
  4859. // ContainerVersionId sets the optional parameter "containerVersionId":
  4860. // The GTM ContainerVersion ID. Specify published to retrieve the
  4861. // currently published version.
  4862. func (c *AccountsContainersVersionsGetCall) ContainerVersionId(containerVersionId string) *AccountsContainersVersionsGetCall {
  4863. c.urlParams_.Set("containerVersionId", containerVersionId)
  4864. return c
  4865. }
  4866. // Fields allows partial responses to be retrieved. See
  4867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4868. // for more information.
  4869. func (c *AccountsContainersVersionsGetCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsGetCall {
  4870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4871. return c
  4872. }
  4873. // IfNoneMatch sets the optional parameter which makes the operation
  4874. // fail if the object's ETag matches the given value. This is useful for
  4875. // getting updates only after the object has changed since the last
  4876. // request. Use googleapi.IsNotModified to check whether the response
  4877. // error from Do is the result of In-None-Match.
  4878. func (c *AccountsContainersVersionsGetCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsGetCall {
  4879. c.ifNoneMatch_ = entityTag
  4880. return c
  4881. }
  4882. // Context sets the context to be used in this call's Do method. Any
  4883. // pending HTTP request will be aborted if the provided context is
  4884. // canceled.
  4885. func (c *AccountsContainersVersionsGetCall) Context(ctx context.Context) *AccountsContainersVersionsGetCall {
  4886. c.ctx_ = ctx
  4887. return c
  4888. }
  4889. // Header returns an http.Header that can be modified by the caller to
  4890. // add HTTP headers to the request.
  4891. func (c *AccountsContainersVersionsGetCall) Header() http.Header {
  4892. if c.header_ == nil {
  4893. c.header_ = make(http.Header)
  4894. }
  4895. return c.header_
  4896. }
  4897. func (c *AccountsContainersVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  4898. reqHeaders := make(http.Header)
  4899. for k, v := range c.header_ {
  4900. reqHeaders[k] = v
  4901. }
  4902. reqHeaders.Set("User-Agent", c.s.userAgent())
  4903. if c.ifNoneMatch_ != "" {
  4904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4905. }
  4906. var body io.Reader = nil
  4907. c.urlParams_.Set("alt", alt)
  4908. c.urlParams_.Set("prettyPrint", "false")
  4909. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  4910. urls += "?" + c.urlParams_.Encode()
  4911. req, err := http.NewRequest("GET", urls, body)
  4912. if err != nil {
  4913. return nil, err
  4914. }
  4915. req.Header = reqHeaders
  4916. googleapi.Expand(req.URL, map[string]string{
  4917. "path": c.path,
  4918. })
  4919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4920. }
  4921. // Do executes the "tagmanager.accounts.containers.versions.get" call.
  4922. // Exactly one of *ContainerVersion or error will be non-nil. Any
  4923. // non-2xx status code is an error. Response headers are in either
  4924. // *ContainerVersion.ServerResponse.Header or (if a response was
  4925. // returned at all) in error.(*googleapi.Error).Header. Use
  4926. // googleapi.IsNotModified to check whether the returned error was
  4927. // because http.StatusNotModified was returned.
  4928. func (c *AccountsContainersVersionsGetCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  4929. gensupport.SetOptions(c.urlParams_, opts...)
  4930. res, err := c.doRequest("json")
  4931. if res != nil && res.StatusCode == http.StatusNotModified {
  4932. if res.Body != nil {
  4933. res.Body.Close()
  4934. }
  4935. return nil, &googleapi.Error{
  4936. Code: res.StatusCode,
  4937. Header: res.Header,
  4938. }
  4939. }
  4940. if err != nil {
  4941. return nil, err
  4942. }
  4943. defer googleapi.CloseBody(res)
  4944. if err := googleapi.CheckResponse(res); err != nil {
  4945. return nil, err
  4946. }
  4947. ret := &ContainerVersion{
  4948. ServerResponse: googleapi.ServerResponse{
  4949. Header: res.Header,
  4950. HTTPStatusCode: res.StatusCode,
  4951. },
  4952. }
  4953. target := &ret
  4954. if err := gensupport.DecodeResponse(target, res); err != nil {
  4955. return nil, err
  4956. }
  4957. return ret, nil
  4958. // {
  4959. // "description": "Gets a Container Version.",
  4960. // "httpMethod": "GET",
  4961. // "id": "tagmanager.accounts.containers.versions.get",
  4962. // "parameterOrder": [
  4963. // "path"
  4964. // ],
  4965. // "parameters": {
  4966. // "containerVersionId": {
  4967. // "description": "The GTM ContainerVersion ID. Specify published to retrieve the currently published version.",
  4968. // "location": "query",
  4969. // "type": "string"
  4970. // },
  4971. // "path": {
  4972. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  4973. // "location": "path",
  4974. // "required": true,
  4975. // "type": "string"
  4976. // }
  4977. // },
  4978. // "path": "{+path}",
  4979. // "response": {
  4980. // "$ref": "ContainerVersion"
  4981. // },
  4982. // "scopes": [
  4983. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4984. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  4985. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4986. // ]
  4987. // }
  4988. }
  4989. // method id "tagmanager.accounts.containers.versions.live":
  4990. type AccountsContainersVersionsLiveCall struct {
  4991. s *Service
  4992. parent string
  4993. urlParams_ gensupport.URLParams
  4994. ifNoneMatch_ string
  4995. ctx_ context.Context
  4996. header_ http.Header
  4997. }
  4998. // Live: Gets the live (i.e. published) container version
  4999. func (r *AccountsContainersVersionsService) Live(parent string) *AccountsContainersVersionsLiveCall {
  5000. c := &AccountsContainersVersionsLiveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5001. c.parent = parent
  5002. return c
  5003. }
  5004. // Fields allows partial responses to be retrieved. See
  5005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5006. // for more information.
  5007. func (c *AccountsContainersVersionsLiveCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsLiveCall {
  5008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5009. return c
  5010. }
  5011. // IfNoneMatch sets the optional parameter which makes the operation
  5012. // fail if the object's ETag matches the given value. This is useful for
  5013. // getting updates only after the object has changed since the last
  5014. // request. Use googleapi.IsNotModified to check whether the response
  5015. // error from Do is the result of In-None-Match.
  5016. func (c *AccountsContainersVersionsLiveCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsLiveCall {
  5017. c.ifNoneMatch_ = entityTag
  5018. return c
  5019. }
  5020. // Context sets the context to be used in this call's Do method. Any
  5021. // pending HTTP request will be aborted if the provided context is
  5022. // canceled.
  5023. func (c *AccountsContainersVersionsLiveCall) Context(ctx context.Context) *AccountsContainersVersionsLiveCall {
  5024. c.ctx_ = ctx
  5025. return c
  5026. }
  5027. // Header returns an http.Header that can be modified by the caller to
  5028. // add HTTP headers to the request.
  5029. func (c *AccountsContainersVersionsLiveCall) Header() http.Header {
  5030. if c.header_ == nil {
  5031. c.header_ = make(http.Header)
  5032. }
  5033. return c.header_
  5034. }
  5035. func (c *AccountsContainersVersionsLiveCall) doRequest(alt string) (*http.Response, error) {
  5036. reqHeaders := make(http.Header)
  5037. for k, v := range c.header_ {
  5038. reqHeaders[k] = v
  5039. }
  5040. reqHeaders.Set("User-Agent", c.s.userAgent())
  5041. if c.ifNoneMatch_ != "" {
  5042. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5043. }
  5044. var body io.Reader = nil
  5045. c.urlParams_.Set("alt", alt)
  5046. c.urlParams_.Set("prettyPrint", "false")
  5047. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/versions:live")
  5048. urls += "?" + c.urlParams_.Encode()
  5049. req, err := http.NewRequest("GET", urls, body)
  5050. if err != nil {
  5051. return nil, err
  5052. }
  5053. req.Header = reqHeaders
  5054. googleapi.Expand(req.URL, map[string]string{
  5055. "parent": c.parent,
  5056. })
  5057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5058. }
  5059. // Do executes the "tagmanager.accounts.containers.versions.live" call.
  5060. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5061. // non-2xx status code is an error. Response headers are in either
  5062. // *ContainerVersion.ServerResponse.Header or (if a response was
  5063. // returned at all) in error.(*googleapi.Error).Header. Use
  5064. // googleapi.IsNotModified to check whether the returned error was
  5065. // because http.StatusNotModified was returned.
  5066. func (c *AccountsContainersVersionsLiveCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5067. gensupport.SetOptions(c.urlParams_, opts...)
  5068. res, err := c.doRequest("json")
  5069. if res != nil && res.StatusCode == http.StatusNotModified {
  5070. if res.Body != nil {
  5071. res.Body.Close()
  5072. }
  5073. return nil, &googleapi.Error{
  5074. Code: res.StatusCode,
  5075. Header: res.Header,
  5076. }
  5077. }
  5078. if err != nil {
  5079. return nil, err
  5080. }
  5081. defer googleapi.CloseBody(res)
  5082. if err := googleapi.CheckResponse(res); err != nil {
  5083. return nil, err
  5084. }
  5085. ret := &ContainerVersion{
  5086. ServerResponse: googleapi.ServerResponse{
  5087. Header: res.Header,
  5088. HTTPStatusCode: res.StatusCode,
  5089. },
  5090. }
  5091. target := &ret
  5092. if err := gensupport.DecodeResponse(target, res); err != nil {
  5093. return nil, err
  5094. }
  5095. return ret, nil
  5096. // {
  5097. // "description": "Gets the live (i.e. published) container version",
  5098. // "httpMethod": "GET",
  5099. // "id": "tagmanager.accounts.containers.versions.live",
  5100. // "parameterOrder": [
  5101. // "parent"
  5102. // ],
  5103. // "parameters": {
  5104. // "parent": {
  5105. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  5106. // "location": "path",
  5107. // "required": true,
  5108. // "type": "string"
  5109. // }
  5110. // },
  5111. // "path": "{+parent}/versions:live",
  5112. // "response": {
  5113. // "$ref": "ContainerVersion"
  5114. // },
  5115. // "scopes": [
  5116. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  5117. // "https://www.googleapis.com/auth/tagmanager.readonly"
  5118. // ]
  5119. // }
  5120. }
  5121. // method id "tagmanager.accounts.containers.versions.publish":
  5122. type AccountsContainersVersionsPublishCall struct {
  5123. s *Service
  5124. path string
  5125. urlParams_ gensupport.URLParams
  5126. ctx_ context.Context
  5127. header_ http.Header
  5128. }
  5129. // Publish: Publishes a Container Version.
  5130. func (r *AccountsContainersVersionsService) Publish(path string) *AccountsContainersVersionsPublishCall {
  5131. c := &AccountsContainersVersionsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5132. c.path = path
  5133. return c
  5134. }
  5135. // Fingerprint sets the optional parameter "fingerprint": When provided,
  5136. // this fingerprint must match the fingerprint of the container version
  5137. // in storage.
  5138. func (c *AccountsContainersVersionsPublishCall) Fingerprint(fingerprint string) *AccountsContainersVersionsPublishCall {
  5139. c.urlParams_.Set("fingerprint", fingerprint)
  5140. return c
  5141. }
  5142. // Fields allows partial responses to be retrieved. See
  5143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5144. // for more information.
  5145. func (c *AccountsContainersVersionsPublishCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsPublishCall {
  5146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5147. return c
  5148. }
  5149. // Context sets the context to be used in this call's Do method. Any
  5150. // pending HTTP request will be aborted if the provided context is
  5151. // canceled.
  5152. func (c *AccountsContainersVersionsPublishCall) Context(ctx context.Context) *AccountsContainersVersionsPublishCall {
  5153. c.ctx_ = ctx
  5154. return c
  5155. }
  5156. // Header returns an http.Header that can be modified by the caller to
  5157. // add HTTP headers to the request.
  5158. func (c *AccountsContainersVersionsPublishCall) Header() http.Header {
  5159. if c.header_ == nil {
  5160. c.header_ = make(http.Header)
  5161. }
  5162. return c.header_
  5163. }
  5164. func (c *AccountsContainersVersionsPublishCall) doRequest(alt string) (*http.Response, error) {
  5165. reqHeaders := make(http.Header)
  5166. for k, v := range c.header_ {
  5167. reqHeaders[k] = v
  5168. }
  5169. reqHeaders.Set("User-Agent", c.s.userAgent())
  5170. var body io.Reader = nil
  5171. c.urlParams_.Set("alt", alt)
  5172. c.urlParams_.Set("prettyPrint", "false")
  5173. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:publish")
  5174. urls += "?" + c.urlParams_.Encode()
  5175. req, err := http.NewRequest("POST", urls, body)
  5176. if err != nil {
  5177. return nil, err
  5178. }
  5179. req.Header = reqHeaders
  5180. googleapi.Expand(req.URL, map[string]string{
  5181. "path": c.path,
  5182. })
  5183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5184. }
  5185. // Do executes the "tagmanager.accounts.containers.versions.publish" call.
  5186. // Exactly one of *PublishContainerVersionResponse or error will be
  5187. // non-nil. Any non-2xx status code is an error. Response headers are in
  5188. // either *PublishContainerVersionResponse.ServerResponse.Header or (if
  5189. // a response was returned at all) in error.(*googleapi.Error).Header.
  5190. // Use googleapi.IsNotModified to check whether the returned error was
  5191. // because http.StatusNotModified was returned.
  5192. func (c *AccountsContainersVersionsPublishCall) Do(opts ...googleapi.CallOption) (*PublishContainerVersionResponse, error) {
  5193. gensupport.SetOptions(c.urlParams_, opts...)
  5194. res, err := c.doRequest("json")
  5195. if res != nil && res.StatusCode == http.StatusNotModified {
  5196. if res.Body != nil {
  5197. res.Body.Close()
  5198. }
  5199. return nil, &googleapi.Error{
  5200. Code: res.StatusCode,
  5201. Header: res.Header,
  5202. }
  5203. }
  5204. if err != nil {
  5205. return nil, err
  5206. }
  5207. defer googleapi.CloseBody(res)
  5208. if err := googleapi.CheckResponse(res); err != nil {
  5209. return nil, err
  5210. }
  5211. ret := &PublishContainerVersionResponse{
  5212. ServerResponse: googleapi.ServerResponse{
  5213. Header: res.Header,
  5214. HTTPStatusCode: res.StatusCode,
  5215. },
  5216. }
  5217. target := &ret
  5218. if err := gensupport.DecodeResponse(target, res); err != nil {
  5219. return nil, err
  5220. }
  5221. return ret, nil
  5222. // {
  5223. // "description": "Publishes a Container Version.",
  5224. // "httpMethod": "POST",
  5225. // "id": "tagmanager.accounts.containers.versions.publish",
  5226. // "parameterOrder": [
  5227. // "path"
  5228. // ],
  5229. // "parameters": {
  5230. // "fingerprint": {
  5231. // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.",
  5232. // "location": "query",
  5233. // "type": "string"
  5234. // },
  5235. // "path": {
  5236. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5237. // "location": "path",
  5238. // "required": true,
  5239. // "type": "string"
  5240. // }
  5241. // },
  5242. // "path": "{+path}:publish",
  5243. // "response": {
  5244. // "$ref": "PublishContainerVersionResponse"
  5245. // },
  5246. // "scopes": [
  5247. // "https://www.googleapis.com/auth/tagmanager.publish"
  5248. // ]
  5249. // }
  5250. }
  5251. // method id "tagmanager.accounts.containers.versions.set_latest":
  5252. type AccountsContainersVersionsSetLatestCall struct {
  5253. s *Service
  5254. path string
  5255. urlParams_ gensupport.URLParams
  5256. ctx_ context.Context
  5257. header_ http.Header
  5258. }
  5259. // SetLatest: Sets the latest version used for synchronization of
  5260. // workspaces when detecting conflicts and errors.
  5261. func (r *AccountsContainersVersionsService) SetLatest(path string) *AccountsContainersVersionsSetLatestCall {
  5262. c := &AccountsContainersVersionsSetLatestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5263. c.path = path
  5264. return c
  5265. }
  5266. // Fields allows partial responses to be retrieved. See
  5267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5268. // for more information.
  5269. func (c *AccountsContainersVersionsSetLatestCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsSetLatestCall {
  5270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5271. return c
  5272. }
  5273. // Context sets the context to be used in this call's Do method. Any
  5274. // pending HTTP request will be aborted if the provided context is
  5275. // canceled.
  5276. func (c *AccountsContainersVersionsSetLatestCall) Context(ctx context.Context) *AccountsContainersVersionsSetLatestCall {
  5277. c.ctx_ = ctx
  5278. return c
  5279. }
  5280. // Header returns an http.Header that can be modified by the caller to
  5281. // add HTTP headers to the request.
  5282. func (c *AccountsContainersVersionsSetLatestCall) Header() http.Header {
  5283. if c.header_ == nil {
  5284. c.header_ = make(http.Header)
  5285. }
  5286. return c.header_
  5287. }
  5288. func (c *AccountsContainersVersionsSetLatestCall) doRequest(alt string) (*http.Response, error) {
  5289. reqHeaders := make(http.Header)
  5290. for k, v := range c.header_ {
  5291. reqHeaders[k] = v
  5292. }
  5293. reqHeaders.Set("User-Agent", c.s.userAgent())
  5294. var body io.Reader = nil
  5295. c.urlParams_.Set("alt", alt)
  5296. c.urlParams_.Set("prettyPrint", "false")
  5297. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:set_latest")
  5298. urls += "?" + c.urlParams_.Encode()
  5299. req, err := http.NewRequest("POST", urls, body)
  5300. if err != nil {
  5301. return nil, err
  5302. }
  5303. req.Header = reqHeaders
  5304. googleapi.Expand(req.URL, map[string]string{
  5305. "path": c.path,
  5306. })
  5307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5308. }
  5309. // Do executes the "tagmanager.accounts.containers.versions.set_latest" call.
  5310. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5311. // non-2xx status code is an error. Response headers are in either
  5312. // *ContainerVersion.ServerResponse.Header or (if a response was
  5313. // returned at all) in error.(*googleapi.Error).Header. Use
  5314. // googleapi.IsNotModified to check whether the returned error was
  5315. // because http.StatusNotModified was returned.
  5316. func (c *AccountsContainersVersionsSetLatestCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5317. gensupport.SetOptions(c.urlParams_, opts...)
  5318. res, err := c.doRequest("json")
  5319. if res != nil && res.StatusCode == http.StatusNotModified {
  5320. if res.Body != nil {
  5321. res.Body.Close()
  5322. }
  5323. return nil, &googleapi.Error{
  5324. Code: res.StatusCode,
  5325. Header: res.Header,
  5326. }
  5327. }
  5328. if err != nil {
  5329. return nil, err
  5330. }
  5331. defer googleapi.CloseBody(res)
  5332. if err := googleapi.CheckResponse(res); err != nil {
  5333. return nil, err
  5334. }
  5335. ret := &ContainerVersion{
  5336. ServerResponse: googleapi.ServerResponse{
  5337. Header: res.Header,
  5338. HTTPStatusCode: res.StatusCode,
  5339. },
  5340. }
  5341. target := &ret
  5342. if err := gensupport.DecodeResponse(target, res); err != nil {
  5343. return nil, err
  5344. }
  5345. return ret, nil
  5346. // {
  5347. // "description": "Sets the latest version used for synchronization of workspaces when detecting conflicts and errors.",
  5348. // "httpMethod": "POST",
  5349. // "id": "tagmanager.accounts.containers.versions.set_latest",
  5350. // "parameterOrder": [
  5351. // "path"
  5352. // ],
  5353. // "parameters": {
  5354. // "path": {
  5355. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5356. // "location": "path",
  5357. // "required": true,
  5358. // "type": "string"
  5359. // }
  5360. // },
  5361. // "path": "{+path}:set_latest",
  5362. // "response": {
  5363. // "$ref": "ContainerVersion"
  5364. // },
  5365. // "scopes": [
  5366. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5367. // ]
  5368. // }
  5369. }
  5370. // method id "tagmanager.accounts.containers.versions.undelete":
  5371. type AccountsContainersVersionsUndeleteCall struct {
  5372. s *Service
  5373. path string
  5374. urlParams_ gensupport.URLParams
  5375. ctx_ context.Context
  5376. header_ http.Header
  5377. }
  5378. // Undelete: Undeletes a Container Version.
  5379. func (r *AccountsContainersVersionsService) Undelete(path string) *AccountsContainersVersionsUndeleteCall {
  5380. c := &AccountsContainersVersionsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5381. c.path = path
  5382. return c
  5383. }
  5384. // Fields allows partial responses to be retrieved. See
  5385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5386. // for more information.
  5387. func (c *AccountsContainersVersionsUndeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUndeleteCall {
  5388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5389. return c
  5390. }
  5391. // Context sets the context to be used in this call's Do method. Any
  5392. // pending HTTP request will be aborted if the provided context is
  5393. // canceled.
  5394. func (c *AccountsContainersVersionsUndeleteCall) Context(ctx context.Context) *AccountsContainersVersionsUndeleteCall {
  5395. c.ctx_ = ctx
  5396. return c
  5397. }
  5398. // Header returns an http.Header that can be modified by the caller to
  5399. // add HTTP headers to the request.
  5400. func (c *AccountsContainersVersionsUndeleteCall) Header() http.Header {
  5401. if c.header_ == nil {
  5402. c.header_ = make(http.Header)
  5403. }
  5404. return c.header_
  5405. }
  5406. func (c *AccountsContainersVersionsUndeleteCall) doRequest(alt string) (*http.Response, error) {
  5407. reqHeaders := make(http.Header)
  5408. for k, v := range c.header_ {
  5409. reqHeaders[k] = v
  5410. }
  5411. reqHeaders.Set("User-Agent", c.s.userAgent())
  5412. var body io.Reader = nil
  5413. c.urlParams_.Set("alt", alt)
  5414. c.urlParams_.Set("prettyPrint", "false")
  5415. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:undelete")
  5416. urls += "?" + c.urlParams_.Encode()
  5417. req, err := http.NewRequest("POST", urls, body)
  5418. if err != nil {
  5419. return nil, err
  5420. }
  5421. req.Header = reqHeaders
  5422. googleapi.Expand(req.URL, map[string]string{
  5423. "path": c.path,
  5424. })
  5425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5426. }
  5427. // Do executes the "tagmanager.accounts.containers.versions.undelete" call.
  5428. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5429. // non-2xx status code is an error. Response headers are in either
  5430. // *ContainerVersion.ServerResponse.Header or (if a response was
  5431. // returned at all) in error.(*googleapi.Error).Header. Use
  5432. // googleapi.IsNotModified to check whether the returned error was
  5433. // because http.StatusNotModified was returned.
  5434. func (c *AccountsContainersVersionsUndeleteCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5435. gensupport.SetOptions(c.urlParams_, opts...)
  5436. res, err := c.doRequest("json")
  5437. if res != nil && res.StatusCode == http.StatusNotModified {
  5438. if res.Body != nil {
  5439. res.Body.Close()
  5440. }
  5441. return nil, &googleapi.Error{
  5442. Code: res.StatusCode,
  5443. Header: res.Header,
  5444. }
  5445. }
  5446. if err != nil {
  5447. return nil, err
  5448. }
  5449. defer googleapi.CloseBody(res)
  5450. if err := googleapi.CheckResponse(res); err != nil {
  5451. return nil, err
  5452. }
  5453. ret := &ContainerVersion{
  5454. ServerResponse: googleapi.ServerResponse{
  5455. Header: res.Header,
  5456. HTTPStatusCode: res.StatusCode,
  5457. },
  5458. }
  5459. target := &ret
  5460. if err := gensupport.DecodeResponse(target, res); err != nil {
  5461. return nil, err
  5462. }
  5463. return ret, nil
  5464. // {
  5465. // "description": "Undeletes a Container Version.",
  5466. // "httpMethod": "POST",
  5467. // "id": "tagmanager.accounts.containers.versions.undelete",
  5468. // "parameterOrder": [
  5469. // "path"
  5470. // ],
  5471. // "parameters": {
  5472. // "path": {
  5473. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5474. // "location": "path",
  5475. // "required": true,
  5476. // "type": "string"
  5477. // }
  5478. // },
  5479. // "path": "{+path}:undelete",
  5480. // "response": {
  5481. // "$ref": "ContainerVersion"
  5482. // },
  5483. // "scopes": [
  5484. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  5485. // ]
  5486. // }
  5487. }
  5488. // method id "tagmanager.accounts.containers.versions.update":
  5489. type AccountsContainersVersionsUpdateCall struct {
  5490. s *Service
  5491. path string
  5492. containerversion *ContainerVersion
  5493. urlParams_ gensupport.URLParams
  5494. ctx_ context.Context
  5495. header_ http.Header
  5496. }
  5497. // Update: Updates a Container Version.
  5498. func (r *AccountsContainersVersionsService) Update(path string, containerversion *ContainerVersion) *AccountsContainersVersionsUpdateCall {
  5499. c := &AccountsContainersVersionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5500. c.path = path
  5501. c.containerversion = containerversion
  5502. return c
  5503. }
  5504. // Fingerprint sets the optional parameter "fingerprint": When provided,
  5505. // this fingerprint must match the fingerprint of the container version
  5506. // in storage.
  5507. func (c *AccountsContainersVersionsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersVersionsUpdateCall {
  5508. c.urlParams_.Set("fingerprint", fingerprint)
  5509. return c
  5510. }
  5511. // Fields allows partial responses to be retrieved. See
  5512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5513. // for more information.
  5514. func (c *AccountsContainersVersionsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUpdateCall {
  5515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5516. return c
  5517. }
  5518. // Context sets the context to be used in this call's Do method. Any
  5519. // pending HTTP request will be aborted if the provided context is
  5520. // canceled.
  5521. func (c *AccountsContainersVersionsUpdateCall) Context(ctx context.Context) *AccountsContainersVersionsUpdateCall {
  5522. c.ctx_ = ctx
  5523. return c
  5524. }
  5525. // Header returns an http.Header that can be modified by the caller to
  5526. // add HTTP headers to the request.
  5527. func (c *AccountsContainersVersionsUpdateCall) Header() http.Header {
  5528. if c.header_ == nil {
  5529. c.header_ = make(http.Header)
  5530. }
  5531. return c.header_
  5532. }
  5533. func (c *AccountsContainersVersionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5534. reqHeaders := make(http.Header)
  5535. for k, v := range c.header_ {
  5536. reqHeaders[k] = v
  5537. }
  5538. reqHeaders.Set("User-Agent", c.s.userAgent())
  5539. var body io.Reader = nil
  5540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerversion)
  5541. if err != nil {
  5542. return nil, err
  5543. }
  5544. reqHeaders.Set("Content-Type", "application/json")
  5545. c.urlParams_.Set("alt", alt)
  5546. c.urlParams_.Set("prettyPrint", "false")
  5547. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  5548. urls += "?" + c.urlParams_.Encode()
  5549. req, err := http.NewRequest("PUT", urls, body)
  5550. if err != nil {
  5551. return nil, err
  5552. }
  5553. req.Header = reqHeaders
  5554. googleapi.Expand(req.URL, map[string]string{
  5555. "path": c.path,
  5556. })
  5557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5558. }
  5559. // Do executes the "tagmanager.accounts.containers.versions.update" call.
  5560. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5561. // non-2xx status code is an error. Response headers are in either
  5562. // *ContainerVersion.ServerResponse.Header or (if a response was
  5563. // returned at all) in error.(*googleapi.Error).Header. Use
  5564. // googleapi.IsNotModified to check whether the returned error was
  5565. // because http.StatusNotModified was returned.
  5566. func (c *AccountsContainersVersionsUpdateCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5567. gensupport.SetOptions(c.urlParams_, opts...)
  5568. res, err := c.doRequest("json")
  5569. if res != nil && res.StatusCode == http.StatusNotModified {
  5570. if res.Body != nil {
  5571. res.Body.Close()
  5572. }
  5573. return nil, &googleapi.Error{
  5574. Code: res.StatusCode,
  5575. Header: res.Header,
  5576. }
  5577. }
  5578. if err != nil {
  5579. return nil, err
  5580. }
  5581. defer googleapi.CloseBody(res)
  5582. if err := googleapi.CheckResponse(res); err != nil {
  5583. return nil, err
  5584. }
  5585. ret := &ContainerVersion{
  5586. ServerResponse: googleapi.ServerResponse{
  5587. Header: res.Header,
  5588. HTTPStatusCode: res.StatusCode,
  5589. },
  5590. }
  5591. target := &ret
  5592. if err := gensupport.DecodeResponse(target, res); err != nil {
  5593. return nil, err
  5594. }
  5595. return ret, nil
  5596. // {
  5597. // "description": "Updates a Container Version.",
  5598. // "httpMethod": "PUT",
  5599. // "id": "tagmanager.accounts.containers.versions.update",
  5600. // "parameterOrder": [
  5601. // "path"
  5602. // ],
  5603. // "parameters": {
  5604. // "fingerprint": {
  5605. // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.",
  5606. // "location": "query",
  5607. // "type": "string"
  5608. // },
  5609. // "path": {
  5610. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5611. // "location": "path",
  5612. // "required": true,
  5613. // "type": "string"
  5614. // }
  5615. // },
  5616. // "path": "{+path}",
  5617. // "request": {
  5618. // "$ref": "ContainerVersion"
  5619. // },
  5620. // "response": {
  5621. // "$ref": "ContainerVersion"
  5622. // },
  5623. // "scopes": [
  5624. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  5625. // ]
  5626. // }
  5627. }
  5628. // method id "tagmanager.accounts.containers.workspaces.create":
  5629. type AccountsContainersWorkspacesCreateCall struct {
  5630. s *Service
  5631. parent string
  5632. workspace *Workspace
  5633. urlParams_ gensupport.URLParams
  5634. ctx_ context.Context
  5635. header_ http.Header
  5636. }
  5637. // Create: Creates a Workspace.
  5638. func (r *AccountsContainersWorkspacesService) Create(parent string, workspace *Workspace) *AccountsContainersWorkspacesCreateCall {
  5639. c := &AccountsContainersWorkspacesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5640. c.parent = parent
  5641. c.workspace = workspace
  5642. return c
  5643. }
  5644. // Fields allows partial responses to be retrieved. See
  5645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5646. // for more information.
  5647. func (c *AccountsContainersWorkspacesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesCreateCall {
  5648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5649. return c
  5650. }
  5651. // Context sets the context to be used in this call's Do method. Any
  5652. // pending HTTP request will be aborted if the provided context is
  5653. // canceled.
  5654. func (c *AccountsContainersWorkspacesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesCreateCall {
  5655. c.ctx_ = ctx
  5656. return c
  5657. }
  5658. // Header returns an http.Header that can be modified by the caller to
  5659. // add HTTP headers to the request.
  5660. func (c *AccountsContainersWorkspacesCreateCall) Header() http.Header {
  5661. if c.header_ == nil {
  5662. c.header_ = make(http.Header)
  5663. }
  5664. return c.header_
  5665. }
  5666. func (c *AccountsContainersWorkspacesCreateCall) doRequest(alt string) (*http.Response, error) {
  5667. reqHeaders := make(http.Header)
  5668. for k, v := range c.header_ {
  5669. reqHeaders[k] = v
  5670. }
  5671. reqHeaders.Set("User-Agent", c.s.userAgent())
  5672. var body io.Reader = nil
  5673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace)
  5674. if err != nil {
  5675. return nil, err
  5676. }
  5677. reqHeaders.Set("Content-Type", "application/json")
  5678. c.urlParams_.Set("alt", alt)
  5679. c.urlParams_.Set("prettyPrint", "false")
  5680. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/workspaces")
  5681. urls += "?" + c.urlParams_.Encode()
  5682. req, err := http.NewRequest("POST", urls, body)
  5683. if err != nil {
  5684. return nil, err
  5685. }
  5686. req.Header = reqHeaders
  5687. googleapi.Expand(req.URL, map[string]string{
  5688. "parent": c.parent,
  5689. })
  5690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5691. }
  5692. // Do executes the "tagmanager.accounts.containers.workspaces.create" call.
  5693. // Exactly one of *Workspace or error will be non-nil. Any non-2xx
  5694. // status code is an error. Response headers are in either
  5695. // *Workspace.ServerResponse.Header or (if a response was returned at
  5696. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5697. // to check whether the returned error was because
  5698. // http.StatusNotModified was returned.
  5699. func (c *AccountsContainersWorkspacesCreateCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
  5700. gensupport.SetOptions(c.urlParams_, opts...)
  5701. res, err := c.doRequest("json")
  5702. if res != nil && res.StatusCode == http.StatusNotModified {
  5703. if res.Body != nil {
  5704. res.Body.Close()
  5705. }
  5706. return nil, &googleapi.Error{
  5707. Code: res.StatusCode,
  5708. Header: res.Header,
  5709. }
  5710. }
  5711. if err != nil {
  5712. return nil, err
  5713. }
  5714. defer googleapi.CloseBody(res)
  5715. if err := googleapi.CheckResponse(res); err != nil {
  5716. return nil, err
  5717. }
  5718. ret := &Workspace{
  5719. ServerResponse: googleapi.ServerResponse{
  5720. Header: res.Header,
  5721. HTTPStatusCode: res.StatusCode,
  5722. },
  5723. }
  5724. target := &ret
  5725. if err := gensupport.DecodeResponse(target, res); err != nil {
  5726. return nil, err
  5727. }
  5728. return ret, nil
  5729. // {
  5730. // "description": "Creates a Workspace.",
  5731. // "httpMethod": "POST",
  5732. // "id": "tagmanager.accounts.containers.workspaces.create",
  5733. // "parameterOrder": [
  5734. // "parent"
  5735. // ],
  5736. // "parameters": {
  5737. // "parent": {
  5738. // "description": "GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  5739. // "location": "path",
  5740. // "required": true,
  5741. // "type": "string"
  5742. // }
  5743. // },
  5744. // "path": "{+parent}/workspaces",
  5745. // "request": {
  5746. // "$ref": "Workspace"
  5747. // },
  5748. // "response": {
  5749. // "$ref": "Workspace"
  5750. // },
  5751. // "scopes": [
  5752. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5753. // ]
  5754. // }
  5755. }
  5756. // method id "tagmanager.accounts.containers.workspaces.create_version":
  5757. type AccountsContainersWorkspacesCreateVersionCall struct {
  5758. s *Service
  5759. path string
  5760. createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions
  5761. urlParams_ gensupport.URLParams
  5762. ctx_ context.Context
  5763. header_ http.Header
  5764. }
  5765. // CreateVersion: Creates a Container Version from the entities present
  5766. // in the workspace, deletes the workspace, and sets the base container
  5767. // version to the newly created version.
  5768. func (r *AccountsContainersWorkspacesService) CreateVersion(path string, createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions) *AccountsContainersWorkspacesCreateVersionCall {
  5769. c := &AccountsContainersWorkspacesCreateVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5770. c.path = path
  5771. c.createcontainerversionrequestversionoptions = createcontainerversionrequestversionoptions
  5772. return c
  5773. }
  5774. // Fields allows partial responses to be retrieved. See
  5775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5776. // for more information.
  5777. func (c *AccountsContainersWorkspacesCreateVersionCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesCreateVersionCall {
  5778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5779. return c
  5780. }
  5781. // Context sets the context to be used in this call's Do method. Any
  5782. // pending HTTP request will be aborted if the provided context is
  5783. // canceled.
  5784. func (c *AccountsContainersWorkspacesCreateVersionCall) Context(ctx context.Context) *AccountsContainersWorkspacesCreateVersionCall {
  5785. c.ctx_ = ctx
  5786. return c
  5787. }
  5788. // Header returns an http.Header that can be modified by the caller to
  5789. // add HTTP headers to the request.
  5790. func (c *AccountsContainersWorkspacesCreateVersionCall) Header() http.Header {
  5791. if c.header_ == nil {
  5792. c.header_ = make(http.Header)
  5793. }
  5794. return c.header_
  5795. }
  5796. func (c *AccountsContainersWorkspacesCreateVersionCall) doRequest(alt string) (*http.Response, error) {
  5797. reqHeaders := make(http.Header)
  5798. for k, v := range c.header_ {
  5799. reqHeaders[k] = v
  5800. }
  5801. reqHeaders.Set("User-Agent", c.s.userAgent())
  5802. var body io.Reader = nil
  5803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontainerversionrequestversionoptions)
  5804. if err != nil {
  5805. return nil, err
  5806. }
  5807. reqHeaders.Set("Content-Type", "application/json")
  5808. c.urlParams_.Set("alt", alt)
  5809. c.urlParams_.Set("prettyPrint", "false")
  5810. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:create_version")
  5811. urls += "?" + c.urlParams_.Encode()
  5812. req, err := http.NewRequest("POST", urls, body)
  5813. if err != nil {
  5814. return nil, err
  5815. }
  5816. req.Header = reqHeaders
  5817. googleapi.Expand(req.URL, map[string]string{
  5818. "path": c.path,
  5819. })
  5820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5821. }
  5822. // Do executes the "tagmanager.accounts.containers.workspaces.create_version" call.
  5823. // Exactly one of *CreateContainerVersionResponse or error will be
  5824. // non-nil. Any non-2xx status code is an error. Response headers are in
  5825. // either *CreateContainerVersionResponse.ServerResponse.Header or (if a
  5826. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5827. // googleapi.IsNotModified to check whether the returned error was
  5828. // because http.StatusNotModified was returned.
  5829. func (c *AccountsContainersWorkspacesCreateVersionCall) Do(opts ...googleapi.CallOption) (*CreateContainerVersionResponse, error) {
  5830. gensupport.SetOptions(c.urlParams_, opts...)
  5831. res, err := c.doRequest("json")
  5832. if res != nil && res.StatusCode == http.StatusNotModified {
  5833. if res.Body != nil {
  5834. res.Body.Close()
  5835. }
  5836. return nil, &googleapi.Error{
  5837. Code: res.StatusCode,
  5838. Header: res.Header,
  5839. }
  5840. }
  5841. if err != nil {
  5842. return nil, err
  5843. }
  5844. defer googleapi.CloseBody(res)
  5845. if err := googleapi.CheckResponse(res); err != nil {
  5846. return nil, err
  5847. }
  5848. ret := &CreateContainerVersionResponse{
  5849. ServerResponse: googleapi.ServerResponse{
  5850. Header: res.Header,
  5851. HTTPStatusCode: res.StatusCode,
  5852. },
  5853. }
  5854. target := &ret
  5855. if err := gensupport.DecodeResponse(target, res); err != nil {
  5856. return nil, err
  5857. }
  5858. return ret, nil
  5859. // {
  5860. // "description": "Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version.",
  5861. // "httpMethod": "POST",
  5862. // "id": "tagmanager.accounts.containers.workspaces.create_version",
  5863. // "parameterOrder": [
  5864. // "path"
  5865. // ],
  5866. // "parameters": {
  5867. // "path": {
  5868. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  5869. // "location": "path",
  5870. // "required": true,
  5871. // "type": "string"
  5872. // }
  5873. // },
  5874. // "path": "{+path}:create_version",
  5875. // "request": {
  5876. // "$ref": "CreateContainerVersionRequestVersionOptions"
  5877. // },
  5878. // "response": {
  5879. // "$ref": "CreateContainerVersionResponse"
  5880. // },
  5881. // "scopes": [
  5882. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  5883. // ]
  5884. // }
  5885. }
  5886. // method id "tagmanager.accounts.containers.workspaces.delete":
  5887. type AccountsContainersWorkspacesDeleteCall struct {
  5888. s *Service
  5889. path string
  5890. urlParams_ gensupport.URLParams
  5891. ctx_ context.Context
  5892. header_ http.Header
  5893. }
  5894. // Delete: Deletes a Workspace.
  5895. func (r *AccountsContainersWorkspacesService) Delete(path string) *AccountsContainersWorkspacesDeleteCall {
  5896. c := &AccountsContainersWorkspacesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5897. c.path = path
  5898. return c
  5899. }
  5900. // Fields allows partial responses to be retrieved. See
  5901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5902. // for more information.
  5903. func (c *AccountsContainersWorkspacesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesDeleteCall {
  5904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5905. return c
  5906. }
  5907. // Context sets the context to be used in this call's Do method. Any
  5908. // pending HTTP request will be aborted if the provided context is
  5909. // canceled.
  5910. func (c *AccountsContainersWorkspacesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesDeleteCall {
  5911. c.ctx_ = ctx
  5912. return c
  5913. }
  5914. // Header returns an http.Header that can be modified by the caller to
  5915. // add HTTP headers to the request.
  5916. func (c *AccountsContainersWorkspacesDeleteCall) Header() http.Header {
  5917. if c.header_ == nil {
  5918. c.header_ = make(http.Header)
  5919. }
  5920. return c.header_
  5921. }
  5922. func (c *AccountsContainersWorkspacesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5923. reqHeaders := make(http.Header)
  5924. for k, v := range c.header_ {
  5925. reqHeaders[k] = v
  5926. }
  5927. reqHeaders.Set("User-Agent", c.s.userAgent())
  5928. var body io.Reader = nil
  5929. c.urlParams_.Set("alt", alt)
  5930. c.urlParams_.Set("prettyPrint", "false")
  5931. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  5932. urls += "?" + c.urlParams_.Encode()
  5933. req, err := http.NewRequest("DELETE", urls, body)
  5934. if err != nil {
  5935. return nil, err
  5936. }
  5937. req.Header = reqHeaders
  5938. googleapi.Expand(req.URL, map[string]string{
  5939. "path": c.path,
  5940. })
  5941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5942. }
  5943. // Do executes the "tagmanager.accounts.containers.workspaces.delete" call.
  5944. func (c *AccountsContainersWorkspacesDeleteCall) Do(opts ...googleapi.CallOption) error {
  5945. gensupport.SetOptions(c.urlParams_, opts...)
  5946. res, err := c.doRequest("json")
  5947. if err != nil {
  5948. return err
  5949. }
  5950. defer googleapi.CloseBody(res)
  5951. if err := googleapi.CheckResponse(res); err != nil {
  5952. return err
  5953. }
  5954. return nil
  5955. // {
  5956. // "description": "Deletes a Workspace.",
  5957. // "httpMethod": "DELETE",
  5958. // "id": "tagmanager.accounts.containers.workspaces.delete",
  5959. // "parameterOrder": [
  5960. // "path"
  5961. // ],
  5962. // "parameters": {
  5963. // "path": {
  5964. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  5965. // "location": "path",
  5966. // "required": true,
  5967. // "type": "string"
  5968. // }
  5969. // },
  5970. // "path": "{+path}",
  5971. // "scopes": [
  5972. // "https://www.googleapis.com/auth/tagmanager.delete.containers"
  5973. // ]
  5974. // }
  5975. }
  5976. // method id "tagmanager.accounts.containers.workspaces.get":
  5977. type AccountsContainersWorkspacesGetCall struct {
  5978. s *Service
  5979. path string
  5980. urlParams_ gensupport.URLParams
  5981. ifNoneMatch_ string
  5982. ctx_ context.Context
  5983. header_ http.Header
  5984. }
  5985. // Get: Gets a Workspace.
  5986. func (r *AccountsContainersWorkspacesService) Get(path string) *AccountsContainersWorkspacesGetCall {
  5987. c := &AccountsContainersWorkspacesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5988. c.path = path
  5989. return c
  5990. }
  5991. // Fields allows partial responses to be retrieved. See
  5992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5993. // for more information.
  5994. func (c *AccountsContainersWorkspacesGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesGetCall {
  5995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5996. return c
  5997. }
  5998. // IfNoneMatch sets the optional parameter which makes the operation
  5999. // fail if the object's ETag matches the given value. This is useful for
  6000. // getting updates only after the object has changed since the last
  6001. // request. Use googleapi.IsNotModified to check whether the response
  6002. // error from Do is the result of In-None-Match.
  6003. func (c *AccountsContainersWorkspacesGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesGetCall {
  6004. c.ifNoneMatch_ = entityTag
  6005. return c
  6006. }
  6007. // Context sets the context to be used in this call's Do method. Any
  6008. // pending HTTP request will be aborted if the provided context is
  6009. // canceled.
  6010. func (c *AccountsContainersWorkspacesGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesGetCall {
  6011. c.ctx_ = ctx
  6012. return c
  6013. }
  6014. // Header returns an http.Header that can be modified by the caller to
  6015. // add HTTP headers to the request.
  6016. func (c *AccountsContainersWorkspacesGetCall) Header() http.Header {
  6017. if c.header_ == nil {
  6018. c.header_ = make(http.Header)
  6019. }
  6020. return c.header_
  6021. }
  6022. func (c *AccountsContainersWorkspacesGetCall) doRequest(alt string) (*http.Response, error) {
  6023. reqHeaders := make(http.Header)
  6024. for k, v := range c.header_ {
  6025. reqHeaders[k] = v
  6026. }
  6027. reqHeaders.Set("User-Agent", c.s.userAgent())
  6028. if c.ifNoneMatch_ != "" {
  6029. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6030. }
  6031. var body io.Reader = nil
  6032. c.urlParams_.Set("alt", alt)
  6033. c.urlParams_.Set("prettyPrint", "false")
  6034. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  6035. urls += "?" + c.urlParams_.Encode()
  6036. req, err := http.NewRequest("GET", urls, body)
  6037. if err != nil {
  6038. return nil, err
  6039. }
  6040. req.Header = reqHeaders
  6041. googleapi.Expand(req.URL, map[string]string{
  6042. "path": c.path,
  6043. })
  6044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6045. }
  6046. // Do executes the "tagmanager.accounts.containers.workspaces.get" call.
  6047. // Exactly one of *Workspace or error will be non-nil. Any non-2xx
  6048. // status code is an error. Response headers are in either
  6049. // *Workspace.ServerResponse.Header or (if a response was returned at
  6050. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6051. // to check whether the returned error was because
  6052. // http.StatusNotModified was returned.
  6053. func (c *AccountsContainersWorkspacesGetCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
  6054. gensupport.SetOptions(c.urlParams_, opts...)
  6055. res, err := c.doRequest("json")
  6056. if res != nil && res.StatusCode == http.StatusNotModified {
  6057. if res.Body != nil {
  6058. res.Body.Close()
  6059. }
  6060. return nil, &googleapi.Error{
  6061. Code: res.StatusCode,
  6062. Header: res.Header,
  6063. }
  6064. }
  6065. if err != nil {
  6066. return nil, err
  6067. }
  6068. defer googleapi.CloseBody(res)
  6069. if err := googleapi.CheckResponse(res); err != nil {
  6070. return nil, err
  6071. }
  6072. ret := &Workspace{
  6073. ServerResponse: googleapi.ServerResponse{
  6074. Header: res.Header,
  6075. HTTPStatusCode: res.StatusCode,
  6076. },
  6077. }
  6078. target := &ret
  6079. if err := gensupport.DecodeResponse(target, res); err != nil {
  6080. return nil, err
  6081. }
  6082. return ret, nil
  6083. // {
  6084. // "description": "Gets a Workspace.",
  6085. // "httpMethod": "GET",
  6086. // "id": "tagmanager.accounts.containers.workspaces.get",
  6087. // "parameterOrder": [
  6088. // "path"
  6089. // ],
  6090. // "parameters": {
  6091. // "path": {
  6092. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6093. // "location": "path",
  6094. // "required": true,
  6095. // "type": "string"
  6096. // }
  6097. // },
  6098. // "path": "{+path}",
  6099. // "response": {
  6100. // "$ref": "Workspace"
  6101. // },
  6102. // "scopes": [
  6103. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6104. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6105. // ]
  6106. // }
  6107. }
  6108. // method id "tagmanager.accounts.containers.workspaces.getStatus":
  6109. type AccountsContainersWorkspacesGetStatusCall struct {
  6110. s *Service
  6111. path string
  6112. urlParams_ gensupport.URLParams
  6113. ifNoneMatch_ string
  6114. ctx_ context.Context
  6115. header_ http.Header
  6116. }
  6117. // GetStatus: Finds conflicting and modified entities in the workspace.
  6118. func (r *AccountsContainersWorkspacesService) GetStatus(path string) *AccountsContainersWorkspacesGetStatusCall {
  6119. c := &AccountsContainersWorkspacesGetStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6120. c.path = path
  6121. return c
  6122. }
  6123. // Fields allows partial responses to be retrieved. See
  6124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6125. // for more information.
  6126. func (c *AccountsContainersWorkspacesGetStatusCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesGetStatusCall {
  6127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6128. return c
  6129. }
  6130. // IfNoneMatch sets the optional parameter which makes the operation
  6131. // fail if the object's ETag matches the given value. This is useful for
  6132. // getting updates only after the object has changed since the last
  6133. // request. Use googleapi.IsNotModified to check whether the response
  6134. // error from Do is the result of In-None-Match.
  6135. func (c *AccountsContainersWorkspacesGetStatusCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesGetStatusCall {
  6136. c.ifNoneMatch_ = entityTag
  6137. return c
  6138. }
  6139. // Context sets the context to be used in this call's Do method. Any
  6140. // pending HTTP request will be aborted if the provided context is
  6141. // canceled.
  6142. func (c *AccountsContainersWorkspacesGetStatusCall) Context(ctx context.Context) *AccountsContainersWorkspacesGetStatusCall {
  6143. c.ctx_ = ctx
  6144. return c
  6145. }
  6146. // Header returns an http.Header that can be modified by the caller to
  6147. // add HTTP headers to the request.
  6148. func (c *AccountsContainersWorkspacesGetStatusCall) Header() http.Header {
  6149. if c.header_ == nil {
  6150. c.header_ = make(http.Header)
  6151. }
  6152. return c.header_
  6153. }
  6154. func (c *AccountsContainersWorkspacesGetStatusCall) doRequest(alt string) (*http.Response, error) {
  6155. reqHeaders := make(http.Header)
  6156. for k, v := range c.header_ {
  6157. reqHeaders[k] = v
  6158. }
  6159. reqHeaders.Set("User-Agent", c.s.userAgent())
  6160. if c.ifNoneMatch_ != "" {
  6161. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6162. }
  6163. var body io.Reader = nil
  6164. c.urlParams_.Set("alt", alt)
  6165. c.urlParams_.Set("prettyPrint", "false")
  6166. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}/status")
  6167. urls += "?" + c.urlParams_.Encode()
  6168. req, err := http.NewRequest("GET", urls, body)
  6169. if err != nil {
  6170. return nil, err
  6171. }
  6172. req.Header = reqHeaders
  6173. googleapi.Expand(req.URL, map[string]string{
  6174. "path": c.path,
  6175. })
  6176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6177. }
  6178. // Do executes the "tagmanager.accounts.containers.workspaces.getStatus" call.
  6179. // Exactly one of *GetWorkspaceStatusResponse or error will be non-nil.
  6180. // Any non-2xx status code is an error. Response headers are in either
  6181. // *GetWorkspaceStatusResponse.ServerResponse.Header or (if a response
  6182. // was returned at all) in error.(*googleapi.Error).Header. Use
  6183. // googleapi.IsNotModified to check whether the returned error was
  6184. // because http.StatusNotModified was returned.
  6185. func (c *AccountsContainersWorkspacesGetStatusCall) Do(opts ...googleapi.CallOption) (*GetWorkspaceStatusResponse, error) {
  6186. gensupport.SetOptions(c.urlParams_, opts...)
  6187. res, err := c.doRequest("json")
  6188. if res != nil && res.StatusCode == http.StatusNotModified {
  6189. if res.Body != nil {
  6190. res.Body.Close()
  6191. }
  6192. return nil, &googleapi.Error{
  6193. Code: res.StatusCode,
  6194. Header: res.Header,
  6195. }
  6196. }
  6197. if err != nil {
  6198. return nil, err
  6199. }
  6200. defer googleapi.CloseBody(res)
  6201. if err := googleapi.CheckResponse(res); err != nil {
  6202. return nil, err
  6203. }
  6204. ret := &GetWorkspaceStatusResponse{
  6205. ServerResponse: googleapi.ServerResponse{
  6206. Header: res.Header,
  6207. HTTPStatusCode: res.StatusCode,
  6208. },
  6209. }
  6210. target := &ret
  6211. if err := gensupport.DecodeResponse(target, res); err != nil {
  6212. return nil, err
  6213. }
  6214. return ret, nil
  6215. // {
  6216. // "description": "Finds conflicting and modified entities in the workspace.",
  6217. // "httpMethod": "GET",
  6218. // "id": "tagmanager.accounts.containers.workspaces.getStatus",
  6219. // "parameterOrder": [
  6220. // "path"
  6221. // ],
  6222. // "parameters": {
  6223. // "path": {
  6224. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6225. // "location": "path",
  6226. // "required": true,
  6227. // "type": "string"
  6228. // }
  6229. // },
  6230. // "path": "{+path}/status",
  6231. // "response": {
  6232. // "$ref": "GetWorkspaceStatusResponse"
  6233. // },
  6234. // "scopes": [
  6235. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6236. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6237. // ]
  6238. // }
  6239. }
  6240. // method id "tagmanager.accounts.containers.workspaces.list":
  6241. type AccountsContainersWorkspacesListCall struct {
  6242. s *Service
  6243. parent string
  6244. urlParams_ gensupport.URLParams
  6245. ifNoneMatch_ string
  6246. ctx_ context.Context
  6247. header_ http.Header
  6248. }
  6249. // List: Lists all Workspaces that belong to a GTM Container.
  6250. func (r *AccountsContainersWorkspacesService) List(parent string) *AccountsContainersWorkspacesListCall {
  6251. c := &AccountsContainersWorkspacesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6252. c.parent = parent
  6253. return c
  6254. }
  6255. // PageToken sets the optional parameter "pageToken": Continuation token
  6256. // for fetching the next page of results.
  6257. func (c *AccountsContainersWorkspacesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesListCall {
  6258. c.urlParams_.Set("pageToken", pageToken)
  6259. return c
  6260. }
  6261. // Fields allows partial responses to be retrieved. See
  6262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6263. // for more information.
  6264. func (c *AccountsContainersWorkspacesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesListCall {
  6265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6266. return c
  6267. }
  6268. // IfNoneMatch sets the optional parameter which makes the operation
  6269. // fail if the object's ETag matches the given value. This is useful for
  6270. // getting updates only after the object has changed since the last
  6271. // request. Use googleapi.IsNotModified to check whether the response
  6272. // error from Do is the result of In-None-Match.
  6273. func (c *AccountsContainersWorkspacesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesListCall {
  6274. c.ifNoneMatch_ = entityTag
  6275. return c
  6276. }
  6277. // Context sets the context to be used in this call's Do method. Any
  6278. // pending HTTP request will be aborted if the provided context is
  6279. // canceled.
  6280. func (c *AccountsContainersWorkspacesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesListCall {
  6281. c.ctx_ = ctx
  6282. return c
  6283. }
  6284. // Header returns an http.Header that can be modified by the caller to
  6285. // add HTTP headers to the request.
  6286. func (c *AccountsContainersWorkspacesListCall) Header() http.Header {
  6287. if c.header_ == nil {
  6288. c.header_ = make(http.Header)
  6289. }
  6290. return c.header_
  6291. }
  6292. func (c *AccountsContainersWorkspacesListCall) doRequest(alt string) (*http.Response, error) {
  6293. reqHeaders := make(http.Header)
  6294. for k, v := range c.header_ {
  6295. reqHeaders[k] = v
  6296. }
  6297. reqHeaders.Set("User-Agent", c.s.userAgent())
  6298. if c.ifNoneMatch_ != "" {
  6299. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6300. }
  6301. var body io.Reader = nil
  6302. c.urlParams_.Set("alt", alt)
  6303. c.urlParams_.Set("prettyPrint", "false")
  6304. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/workspaces")
  6305. urls += "?" + c.urlParams_.Encode()
  6306. req, err := http.NewRequest("GET", urls, body)
  6307. if err != nil {
  6308. return nil, err
  6309. }
  6310. req.Header = reqHeaders
  6311. googleapi.Expand(req.URL, map[string]string{
  6312. "parent": c.parent,
  6313. })
  6314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6315. }
  6316. // Do executes the "tagmanager.accounts.containers.workspaces.list" call.
  6317. // Exactly one of *ListWorkspacesResponse or error will be non-nil. Any
  6318. // non-2xx status code is an error. Response headers are in either
  6319. // *ListWorkspacesResponse.ServerResponse.Header or (if a response was
  6320. // returned at all) in error.(*googleapi.Error).Header. Use
  6321. // googleapi.IsNotModified to check whether the returned error was
  6322. // because http.StatusNotModified was returned.
  6323. func (c *AccountsContainersWorkspacesListCall) Do(opts ...googleapi.CallOption) (*ListWorkspacesResponse, error) {
  6324. gensupport.SetOptions(c.urlParams_, opts...)
  6325. res, err := c.doRequest("json")
  6326. if res != nil && res.StatusCode == http.StatusNotModified {
  6327. if res.Body != nil {
  6328. res.Body.Close()
  6329. }
  6330. return nil, &googleapi.Error{
  6331. Code: res.StatusCode,
  6332. Header: res.Header,
  6333. }
  6334. }
  6335. if err != nil {
  6336. return nil, err
  6337. }
  6338. defer googleapi.CloseBody(res)
  6339. if err := googleapi.CheckResponse(res); err != nil {
  6340. return nil, err
  6341. }
  6342. ret := &ListWorkspacesResponse{
  6343. ServerResponse: googleapi.ServerResponse{
  6344. Header: res.Header,
  6345. HTTPStatusCode: res.StatusCode,
  6346. },
  6347. }
  6348. target := &ret
  6349. if err := gensupport.DecodeResponse(target, res); err != nil {
  6350. return nil, err
  6351. }
  6352. return ret, nil
  6353. // {
  6354. // "description": "Lists all Workspaces that belong to a GTM Container.",
  6355. // "httpMethod": "GET",
  6356. // "id": "tagmanager.accounts.containers.workspaces.list",
  6357. // "parameterOrder": [
  6358. // "parent"
  6359. // ],
  6360. // "parameters": {
  6361. // "pageToken": {
  6362. // "description": "Continuation token for fetching the next page of results.",
  6363. // "location": "query",
  6364. // "type": "string"
  6365. // },
  6366. // "parent": {
  6367. // "description": "GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  6368. // "location": "path",
  6369. // "required": true,
  6370. // "type": "string"
  6371. // }
  6372. // },
  6373. // "path": "{+parent}/workspaces",
  6374. // "response": {
  6375. // "$ref": "ListWorkspacesResponse"
  6376. // },
  6377. // "scopes": [
  6378. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6379. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6380. // ]
  6381. // }
  6382. }
  6383. // Pages invokes f for each page of results.
  6384. // A non-nil error returned from f will halt the iteration.
  6385. // The provided context supersedes any context provided to the Context method.
  6386. func (c *AccountsContainersWorkspacesListCall) Pages(ctx context.Context, f func(*ListWorkspacesResponse) error) error {
  6387. c.ctx_ = ctx
  6388. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6389. for {
  6390. x, err := c.Do()
  6391. if err != nil {
  6392. return err
  6393. }
  6394. if err := f(x); err != nil {
  6395. return err
  6396. }
  6397. if x.NextPageToken == "" {
  6398. return nil
  6399. }
  6400. c.PageToken(x.NextPageToken)
  6401. }
  6402. }
  6403. // method id "tagmanager.accounts.containers.workspaces.quick_preview":
  6404. type AccountsContainersWorkspacesQuickPreviewCall struct {
  6405. s *Service
  6406. path string
  6407. urlParams_ gensupport.URLParams
  6408. ctx_ context.Context
  6409. header_ http.Header
  6410. }
  6411. // QuickPreview: Quick previews a workspace by creating a fake container
  6412. // version from all entities in the provided workspace.
  6413. func (r *AccountsContainersWorkspacesService) QuickPreview(path string) *AccountsContainersWorkspacesQuickPreviewCall {
  6414. c := &AccountsContainersWorkspacesQuickPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6415. c.path = path
  6416. return c
  6417. }
  6418. // Fields allows partial responses to be retrieved. See
  6419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6420. // for more information.
  6421. func (c *AccountsContainersWorkspacesQuickPreviewCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesQuickPreviewCall {
  6422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6423. return c
  6424. }
  6425. // Context sets the context to be used in this call's Do method. Any
  6426. // pending HTTP request will be aborted if the provided context is
  6427. // canceled.
  6428. func (c *AccountsContainersWorkspacesQuickPreviewCall) Context(ctx context.Context) *AccountsContainersWorkspacesQuickPreviewCall {
  6429. c.ctx_ = ctx
  6430. return c
  6431. }
  6432. // Header returns an http.Header that can be modified by the caller to
  6433. // add HTTP headers to the request.
  6434. func (c *AccountsContainersWorkspacesQuickPreviewCall) Header() http.Header {
  6435. if c.header_ == nil {
  6436. c.header_ = make(http.Header)
  6437. }
  6438. return c.header_
  6439. }
  6440. func (c *AccountsContainersWorkspacesQuickPreviewCall) doRequest(alt string) (*http.Response, error) {
  6441. reqHeaders := make(http.Header)
  6442. for k, v := range c.header_ {
  6443. reqHeaders[k] = v
  6444. }
  6445. reqHeaders.Set("User-Agent", c.s.userAgent())
  6446. var body io.Reader = nil
  6447. c.urlParams_.Set("alt", alt)
  6448. c.urlParams_.Set("prettyPrint", "false")
  6449. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:quick_preview")
  6450. urls += "?" + c.urlParams_.Encode()
  6451. req, err := http.NewRequest("POST", urls, body)
  6452. if err != nil {
  6453. return nil, err
  6454. }
  6455. req.Header = reqHeaders
  6456. googleapi.Expand(req.URL, map[string]string{
  6457. "path": c.path,
  6458. })
  6459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6460. }
  6461. // Do executes the "tagmanager.accounts.containers.workspaces.quick_preview" call.
  6462. // Exactly one of *QuickPreviewResponse or error will be non-nil. Any
  6463. // non-2xx status code is an error. Response headers are in either
  6464. // *QuickPreviewResponse.ServerResponse.Header or (if a response was
  6465. // returned at all) in error.(*googleapi.Error).Header. Use
  6466. // googleapi.IsNotModified to check whether the returned error was
  6467. // because http.StatusNotModified was returned.
  6468. func (c *AccountsContainersWorkspacesQuickPreviewCall) Do(opts ...googleapi.CallOption) (*QuickPreviewResponse, error) {
  6469. gensupport.SetOptions(c.urlParams_, opts...)
  6470. res, err := c.doRequest("json")
  6471. if res != nil && res.StatusCode == http.StatusNotModified {
  6472. if res.Body != nil {
  6473. res.Body.Close()
  6474. }
  6475. return nil, &googleapi.Error{
  6476. Code: res.StatusCode,
  6477. Header: res.Header,
  6478. }
  6479. }
  6480. if err != nil {
  6481. return nil, err
  6482. }
  6483. defer googleapi.CloseBody(res)
  6484. if err := googleapi.CheckResponse(res); err != nil {
  6485. return nil, err
  6486. }
  6487. ret := &QuickPreviewResponse{
  6488. ServerResponse: googleapi.ServerResponse{
  6489. Header: res.Header,
  6490. HTTPStatusCode: res.StatusCode,
  6491. },
  6492. }
  6493. target := &ret
  6494. if err := gensupport.DecodeResponse(target, res); err != nil {
  6495. return nil, err
  6496. }
  6497. return ret, nil
  6498. // {
  6499. // "description": "Quick previews a workspace by creating a fake container version from all entities in the provided workspace.",
  6500. // "httpMethod": "POST",
  6501. // "id": "tagmanager.accounts.containers.workspaces.quick_preview",
  6502. // "parameterOrder": [
  6503. // "path"
  6504. // ],
  6505. // "parameters": {
  6506. // "path": {
  6507. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6508. // "location": "path",
  6509. // "required": true,
  6510. // "type": "string"
  6511. // }
  6512. // },
  6513. // "path": "{+path}:quick_preview",
  6514. // "response": {
  6515. // "$ref": "QuickPreviewResponse"
  6516. // },
  6517. // "scopes": [
  6518. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  6519. // ]
  6520. // }
  6521. }
  6522. // method id "tagmanager.accounts.containers.workspaces.resolve_conflict":
  6523. type AccountsContainersWorkspacesResolveConflictCall struct {
  6524. s *Service
  6525. path string
  6526. entity *Entity
  6527. urlParams_ gensupport.URLParams
  6528. ctx_ context.Context
  6529. header_ http.Header
  6530. }
  6531. // ResolveConflict: Resolves a merge conflict for a workspace entity by
  6532. // updating it to the resolved entity passed in the request.
  6533. func (r *AccountsContainersWorkspacesService) ResolveConflict(path string, entity *Entity) *AccountsContainersWorkspacesResolveConflictCall {
  6534. c := &AccountsContainersWorkspacesResolveConflictCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6535. c.path = path
  6536. c.entity = entity
  6537. return c
  6538. }
  6539. // Fingerprint sets the optional parameter "fingerprint": When provided,
  6540. // this fingerprint must match the fingerprint of the
  6541. // entity_in_workspace in the merge conflict.
  6542. func (c *AccountsContainersWorkspacesResolveConflictCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesResolveConflictCall {
  6543. c.urlParams_.Set("fingerprint", fingerprint)
  6544. return c
  6545. }
  6546. // Fields allows partial responses to be retrieved. See
  6547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6548. // for more information.
  6549. func (c *AccountsContainersWorkspacesResolveConflictCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesResolveConflictCall {
  6550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6551. return c
  6552. }
  6553. // Context sets the context to be used in this call's Do method. Any
  6554. // pending HTTP request will be aborted if the provided context is
  6555. // canceled.
  6556. func (c *AccountsContainersWorkspacesResolveConflictCall) Context(ctx context.Context) *AccountsContainersWorkspacesResolveConflictCall {
  6557. c.ctx_ = ctx
  6558. return c
  6559. }
  6560. // Header returns an http.Header that can be modified by the caller to
  6561. // add HTTP headers to the request.
  6562. func (c *AccountsContainersWorkspacesResolveConflictCall) Header() http.Header {
  6563. if c.header_ == nil {
  6564. c.header_ = make(http.Header)
  6565. }
  6566. return c.header_
  6567. }
  6568. func (c *AccountsContainersWorkspacesResolveConflictCall) doRequest(alt string) (*http.Response, error) {
  6569. reqHeaders := make(http.Header)
  6570. for k, v := range c.header_ {
  6571. reqHeaders[k] = v
  6572. }
  6573. reqHeaders.Set("User-Agent", c.s.userAgent())
  6574. var body io.Reader = nil
  6575. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity)
  6576. if err != nil {
  6577. return nil, err
  6578. }
  6579. reqHeaders.Set("Content-Type", "application/json")
  6580. c.urlParams_.Set("alt", alt)
  6581. c.urlParams_.Set("prettyPrint", "false")
  6582. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:resolve_conflict")
  6583. urls += "?" + c.urlParams_.Encode()
  6584. req, err := http.NewRequest("POST", urls, body)
  6585. if err != nil {
  6586. return nil, err
  6587. }
  6588. req.Header = reqHeaders
  6589. googleapi.Expand(req.URL, map[string]string{
  6590. "path": c.path,
  6591. })
  6592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6593. }
  6594. // Do executes the "tagmanager.accounts.containers.workspaces.resolve_conflict" call.
  6595. func (c *AccountsContainersWorkspacesResolveConflictCall) Do(opts ...googleapi.CallOption) error {
  6596. gensupport.SetOptions(c.urlParams_, opts...)
  6597. res, err := c.doRequest("json")
  6598. if err != nil {
  6599. return err
  6600. }
  6601. defer googleapi.CloseBody(res)
  6602. if err := googleapi.CheckResponse(res); err != nil {
  6603. return err
  6604. }
  6605. return nil
  6606. // {
  6607. // "description": "Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request.",
  6608. // "httpMethod": "POST",
  6609. // "id": "tagmanager.accounts.containers.workspaces.resolve_conflict",
  6610. // "parameterOrder": [
  6611. // "path"
  6612. // ],
  6613. // "parameters": {
  6614. // "fingerprint": {
  6615. // "description": "When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict.",
  6616. // "location": "query",
  6617. // "type": "string"
  6618. // },
  6619. // "path": {
  6620. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6621. // "location": "path",
  6622. // "required": true,
  6623. // "type": "string"
  6624. // }
  6625. // },
  6626. // "path": "{+path}:resolve_conflict",
  6627. // "request": {
  6628. // "$ref": "Entity"
  6629. // },
  6630. // "scopes": [
  6631. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6632. // ]
  6633. // }
  6634. }
  6635. // method id "tagmanager.accounts.containers.workspaces.sync":
  6636. type AccountsContainersWorkspacesSyncCall struct {
  6637. s *Service
  6638. path string
  6639. urlParams_ gensupport.URLParams
  6640. ctx_ context.Context
  6641. header_ http.Header
  6642. }
  6643. // Sync: Syncs a workspace to the latest container version by updating
  6644. // all unmodified workspace entities and displaying conflicts for
  6645. // modified entities.
  6646. func (r *AccountsContainersWorkspacesService) Sync(path string) *AccountsContainersWorkspacesSyncCall {
  6647. c := &AccountsContainersWorkspacesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6648. c.path = path
  6649. return c
  6650. }
  6651. // Fields allows partial responses to be retrieved. See
  6652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6653. // for more information.
  6654. func (c *AccountsContainersWorkspacesSyncCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesSyncCall {
  6655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6656. return c
  6657. }
  6658. // Context sets the context to be used in this call's Do method. Any
  6659. // pending HTTP request will be aborted if the provided context is
  6660. // canceled.
  6661. func (c *AccountsContainersWorkspacesSyncCall) Context(ctx context.Context) *AccountsContainersWorkspacesSyncCall {
  6662. c.ctx_ = ctx
  6663. return c
  6664. }
  6665. // Header returns an http.Header that can be modified by the caller to
  6666. // add HTTP headers to the request.
  6667. func (c *AccountsContainersWorkspacesSyncCall) Header() http.Header {
  6668. if c.header_ == nil {
  6669. c.header_ = make(http.Header)
  6670. }
  6671. return c.header_
  6672. }
  6673. func (c *AccountsContainersWorkspacesSyncCall) doRequest(alt string) (*http.Response, error) {
  6674. reqHeaders := make(http.Header)
  6675. for k, v := range c.header_ {
  6676. reqHeaders[k] = v
  6677. }
  6678. reqHeaders.Set("User-Agent", c.s.userAgent())
  6679. var body io.Reader = nil
  6680. c.urlParams_.Set("alt", alt)
  6681. c.urlParams_.Set("prettyPrint", "false")
  6682. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:sync")
  6683. urls += "?" + c.urlParams_.Encode()
  6684. req, err := http.NewRequest("POST", urls, body)
  6685. if err != nil {
  6686. return nil, err
  6687. }
  6688. req.Header = reqHeaders
  6689. googleapi.Expand(req.URL, map[string]string{
  6690. "path": c.path,
  6691. })
  6692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6693. }
  6694. // Do executes the "tagmanager.accounts.containers.workspaces.sync" call.
  6695. // Exactly one of *SyncWorkspaceResponse or error will be non-nil. Any
  6696. // non-2xx status code is an error. Response headers are in either
  6697. // *SyncWorkspaceResponse.ServerResponse.Header or (if a response was
  6698. // returned at all) in error.(*googleapi.Error).Header. Use
  6699. // googleapi.IsNotModified to check whether the returned error was
  6700. // because http.StatusNotModified was returned.
  6701. func (c *AccountsContainersWorkspacesSyncCall) Do(opts ...googleapi.CallOption) (*SyncWorkspaceResponse, error) {
  6702. gensupport.SetOptions(c.urlParams_, opts...)
  6703. res, err := c.doRequest("json")
  6704. if res != nil && res.StatusCode == http.StatusNotModified {
  6705. if res.Body != nil {
  6706. res.Body.Close()
  6707. }
  6708. return nil, &googleapi.Error{
  6709. Code: res.StatusCode,
  6710. Header: res.Header,
  6711. }
  6712. }
  6713. if err != nil {
  6714. return nil, err
  6715. }
  6716. defer googleapi.CloseBody(res)
  6717. if err := googleapi.CheckResponse(res); err != nil {
  6718. return nil, err
  6719. }
  6720. ret := &SyncWorkspaceResponse{
  6721. ServerResponse: googleapi.ServerResponse{
  6722. Header: res.Header,
  6723. HTTPStatusCode: res.StatusCode,
  6724. },
  6725. }
  6726. target := &ret
  6727. if err := gensupport.DecodeResponse(target, res); err != nil {
  6728. return nil, err
  6729. }
  6730. return ret, nil
  6731. // {
  6732. // "description": "Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities.",
  6733. // "httpMethod": "POST",
  6734. // "id": "tagmanager.accounts.containers.workspaces.sync",
  6735. // "parameterOrder": [
  6736. // "path"
  6737. // ],
  6738. // "parameters": {
  6739. // "path": {
  6740. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6741. // "location": "path",
  6742. // "required": true,
  6743. // "type": "string"
  6744. // }
  6745. // },
  6746. // "path": "{+path}:sync",
  6747. // "response": {
  6748. // "$ref": "SyncWorkspaceResponse"
  6749. // },
  6750. // "scopes": [
  6751. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6752. // ]
  6753. // }
  6754. }
  6755. // method id "tagmanager.accounts.containers.workspaces.update":
  6756. type AccountsContainersWorkspacesUpdateCall struct {
  6757. s *Service
  6758. path string
  6759. workspace *Workspace
  6760. urlParams_ gensupport.URLParams
  6761. ctx_ context.Context
  6762. header_ http.Header
  6763. }
  6764. // Update: Updates a Workspace.
  6765. func (r *AccountsContainersWorkspacesService) Update(path string, workspace *Workspace) *AccountsContainersWorkspacesUpdateCall {
  6766. c := &AccountsContainersWorkspacesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6767. c.path = path
  6768. c.workspace = workspace
  6769. return c
  6770. }
  6771. // Fingerprint sets the optional parameter "fingerprint": When provided,
  6772. // this fingerprint must match the fingerprint of the workspace in
  6773. // storage.
  6774. func (c *AccountsContainersWorkspacesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesUpdateCall {
  6775. c.urlParams_.Set("fingerprint", fingerprint)
  6776. return c
  6777. }
  6778. // Fields allows partial responses to be retrieved. See
  6779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6780. // for more information.
  6781. func (c *AccountsContainersWorkspacesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesUpdateCall {
  6782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6783. return c
  6784. }
  6785. // Context sets the context to be used in this call's Do method. Any
  6786. // pending HTTP request will be aborted if the provided context is
  6787. // canceled.
  6788. func (c *AccountsContainersWorkspacesUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesUpdateCall {
  6789. c.ctx_ = ctx
  6790. return c
  6791. }
  6792. // Header returns an http.Header that can be modified by the caller to
  6793. // add HTTP headers to the request.
  6794. func (c *AccountsContainersWorkspacesUpdateCall) Header() http.Header {
  6795. if c.header_ == nil {
  6796. c.header_ = make(http.Header)
  6797. }
  6798. return c.header_
  6799. }
  6800. func (c *AccountsContainersWorkspacesUpdateCall) doRequest(alt string) (*http.Response, error) {
  6801. reqHeaders := make(http.Header)
  6802. for k, v := range c.header_ {
  6803. reqHeaders[k] = v
  6804. }
  6805. reqHeaders.Set("User-Agent", c.s.userAgent())
  6806. var body io.Reader = nil
  6807. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace)
  6808. if err != nil {
  6809. return nil, err
  6810. }
  6811. reqHeaders.Set("Content-Type", "application/json")
  6812. c.urlParams_.Set("alt", alt)
  6813. c.urlParams_.Set("prettyPrint", "false")
  6814. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  6815. urls += "?" + c.urlParams_.Encode()
  6816. req, err := http.NewRequest("PUT", urls, body)
  6817. if err != nil {
  6818. return nil, err
  6819. }
  6820. req.Header = reqHeaders
  6821. googleapi.Expand(req.URL, map[string]string{
  6822. "path": c.path,
  6823. })
  6824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6825. }
  6826. // Do executes the "tagmanager.accounts.containers.workspaces.update" call.
  6827. // Exactly one of *Workspace or error will be non-nil. Any non-2xx
  6828. // status code is an error. Response headers are in either
  6829. // *Workspace.ServerResponse.Header or (if a response was returned at
  6830. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6831. // to check whether the returned error was because
  6832. // http.StatusNotModified was returned.
  6833. func (c *AccountsContainersWorkspacesUpdateCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
  6834. gensupport.SetOptions(c.urlParams_, opts...)
  6835. res, err := c.doRequest("json")
  6836. if res != nil && res.StatusCode == http.StatusNotModified {
  6837. if res.Body != nil {
  6838. res.Body.Close()
  6839. }
  6840. return nil, &googleapi.Error{
  6841. Code: res.StatusCode,
  6842. Header: res.Header,
  6843. }
  6844. }
  6845. if err != nil {
  6846. return nil, err
  6847. }
  6848. defer googleapi.CloseBody(res)
  6849. if err := googleapi.CheckResponse(res); err != nil {
  6850. return nil, err
  6851. }
  6852. ret := &Workspace{
  6853. ServerResponse: googleapi.ServerResponse{
  6854. Header: res.Header,
  6855. HTTPStatusCode: res.StatusCode,
  6856. },
  6857. }
  6858. target := &ret
  6859. if err := gensupport.DecodeResponse(target, res); err != nil {
  6860. return nil, err
  6861. }
  6862. return ret, nil
  6863. // {
  6864. // "description": "Updates a Workspace.",
  6865. // "httpMethod": "PUT",
  6866. // "id": "tagmanager.accounts.containers.workspaces.update",
  6867. // "parameterOrder": [
  6868. // "path"
  6869. // ],
  6870. // "parameters": {
  6871. // "fingerprint": {
  6872. // "description": "When provided, this fingerprint must match the fingerprint of the workspace in storage.",
  6873. // "location": "query",
  6874. // "type": "string"
  6875. // },
  6876. // "path": {
  6877. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6878. // "location": "path",
  6879. // "required": true,
  6880. // "type": "string"
  6881. // }
  6882. // },
  6883. // "path": "{+path}",
  6884. // "request": {
  6885. // "$ref": "Workspace"
  6886. // },
  6887. // "response": {
  6888. // "$ref": "Workspace"
  6889. // },
  6890. // "scopes": [
  6891. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6892. // ]
  6893. // }
  6894. }
  6895. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.create":
  6896. type AccountsContainersWorkspacesBuiltInVariablesCreateCall struct {
  6897. s *Service
  6898. parent string
  6899. urlParams_ gensupport.URLParams
  6900. ctx_ context.Context
  6901. header_ http.Header
  6902. }
  6903. // Create: Creates one or more GTM Built-In Variables.
  6904. func (r *AccountsContainersWorkspacesBuiltInVariablesService) Create(parent string) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  6905. c := &AccountsContainersWorkspacesBuiltInVariablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6906. c.parent = parent
  6907. return c
  6908. }
  6909. // Type sets the optional parameter "type": The types of built-in
  6910. // variables to enable.
  6911. //
  6912. // Possible values:
  6913. // "advertiserId"
  6914. // "advertisingTrackingEnabled"
  6915. // "ampBrowserLanguage"
  6916. // "ampCanonicalHost"
  6917. // "ampCanonicalPath"
  6918. // "ampCanonicalUrl"
  6919. // "ampClientId"
  6920. // "ampClientMaxScrollX"
  6921. // "ampClientMaxScrollY"
  6922. // "ampClientScreenHeight"
  6923. // "ampClientScreenWidth"
  6924. // "ampClientScrollX"
  6925. // "ampClientScrollY"
  6926. // "ampClientTimestamp"
  6927. // "ampClientTimezone"
  6928. // "ampGtmEvent"
  6929. // "ampPageDownloadTime"
  6930. // "ampPageLoadTime"
  6931. // "ampPageViewId"
  6932. // "ampReferrer"
  6933. // "ampTitle"
  6934. // "ampTotalEngagedTime"
  6935. // "appId"
  6936. // "appName"
  6937. // "appVersionCode"
  6938. // "appVersionName"
  6939. // "builtInVariableTypeUnspecified"
  6940. // "clickClasses"
  6941. // "clickElement"
  6942. // "clickId"
  6943. // "clickTarget"
  6944. // "clickText"
  6945. // "clickUrl"
  6946. // "containerId"
  6947. // "containerVersion"
  6948. // "debugMode"
  6949. // "deviceName"
  6950. // "elementVisibilityFirstTime"
  6951. // "elementVisibilityRatio"
  6952. // "elementVisibilityRecentTime"
  6953. // "elementVisibilityTime"
  6954. // "environmentName"
  6955. // "errorLine"
  6956. // "errorMessage"
  6957. // "errorUrl"
  6958. // "event"
  6959. // "eventName"
  6960. // "firebaseEventParameterCampaign"
  6961. // "firebaseEventParameterCampaignAclid"
  6962. // "firebaseEventParameterCampaignAnid"
  6963. // "firebaseEventParameterCampaignClickTimestamp"
  6964. // "firebaseEventParameterCampaignContent"
  6965. // "firebaseEventParameterCampaignCp1"
  6966. // "firebaseEventParameterCampaignGclid"
  6967. // "firebaseEventParameterCampaignSource"
  6968. // "firebaseEventParameterCampaignTerm"
  6969. // "firebaseEventParameterCurrency"
  6970. // "firebaseEventParameterDynamicLinkAcceptTime"
  6971. // "firebaseEventParameterDynamicLinkLinkid"
  6972. // "firebaseEventParameterNotificationMessageDeviceTime"
  6973. // "firebaseEventParameterNotificationMessageId"
  6974. // "firebaseEventParameterNotificationMessageName"
  6975. // "firebaseEventParameterNotificationMessageTime"
  6976. // "firebaseEventParameterNotificationTopic"
  6977. // "firebaseEventParameterPreviousAppVersion"
  6978. // "firebaseEventParameterPreviousOsVersion"
  6979. // "firebaseEventParameterPrice"
  6980. // "firebaseEventParameterProductId"
  6981. // "firebaseEventParameterQuantity"
  6982. // "firebaseEventParameterValue"
  6983. // "formClasses"
  6984. // "formElement"
  6985. // "formId"
  6986. // "formTarget"
  6987. // "formText"
  6988. // "formUrl"
  6989. // "historySource"
  6990. // "htmlId"
  6991. // "language"
  6992. // "newHistoryFragment"
  6993. // "newHistoryState"
  6994. // "oldHistoryFragment"
  6995. // "oldHistoryState"
  6996. // "osVersion"
  6997. // "pageHostname"
  6998. // "pagePath"
  6999. // "pageUrl"
  7000. // "platform"
  7001. // "randomNumber"
  7002. // "referrer"
  7003. // "resolution"
  7004. // "scrollDepthDirection"
  7005. // "scrollDepthThreshold"
  7006. // "scrollDepthUnits"
  7007. // "sdkVersion"
  7008. // "videoCurrentTime"
  7009. // "videoDuration"
  7010. // "videoPercent"
  7011. // "videoProvider"
  7012. // "videoStatus"
  7013. // "videoTitle"
  7014. // "videoUrl"
  7015. // "videoVisible"
  7016. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Type(type_ ...string) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7017. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  7018. return c
  7019. }
  7020. // Fields allows partial responses to be retrieved. See
  7021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7022. // for more information.
  7023. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7025. return c
  7026. }
  7027. // Context sets the context to be used in this call's Do method. Any
  7028. // pending HTTP request will be aborted if the provided context is
  7029. // canceled.
  7030. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7031. c.ctx_ = ctx
  7032. return c
  7033. }
  7034. // Header returns an http.Header that can be modified by the caller to
  7035. // add HTTP headers to the request.
  7036. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Header() http.Header {
  7037. if c.header_ == nil {
  7038. c.header_ = make(http.Header)
  7039. }
  7040. return c.header_
  7041. }
  7042. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) doRequest(alt string) (*http.Response, error) {
  7043. reqHeaders := make(http.Header)
  7044. for k, v := range c.header_ {
  7045. reqHeaders[k] = v
  7046. }
  7047. reqHeaders.Set("User-Agent", c.s.userAgent())
  7048. var body io.Reader = nil
  7049. c.urlParams_.Set("alt", alt)
  7050. c.urlParams_.Set("prettyPrint", "false")
  7051. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/built_in_variables")
  7052. urls += "?" + c.urlParams_.Encode()
  7053. req, err := http.NewRequest("POST", urls, body)
  7054. if err != nil {
  7055. return nil, err
  7056. }
  7057. req.Header = reqHeaders
  7058. googleapi.Expand(req.URL, map[string]string{
  7059. "parent": c.parent,
  7060. })
  7061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7062. }
  7063. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.create" call.
  7064. // Exactly one of *CreateBuiltInVariableResponse or error will be
  7065. // non-nil. Any non-2xx status code is an error. Response headers are in
  7066. // either *CreateBuiltInVariableResponse.ServerResponse.Header or (if a
  7067. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7068. // googleapi.IsNotModified to check whether the returned error was
  7069. // because http.StatusNotModified was returned.
  7070. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Do(opts ...googleapi.CallOption) (*CreateBuiltInVariableResponse, error) {
  7071. gensupport.SetOptions(c.urlParams_, opts...)
  7072. res, err := c.doRequest("json")
  7073. if res != nil && res.StatusCode == http.StatusNotModified {
  7074. if res.Body != nil {
  7075. res.Body.Close()
  7076. }
  7077. return nil, &googleapi.Error{
  7078. Code: res.StatusCode,
  7079. Header: res.Header,
  7080. }
  7081. }
  7082. if err != nil {
  7083. return nil, err
  7084. }
  7085. defer googleapi.CloseBody(res)
  7086. if err := googleapi.CheckResponse(res); err != nil {
  7087. return nil, err
  7088. }
  7089. ret := &CreateBuiltInVariableResponse{
  7090. ServerResponse: googleapi.ServerResponse{
  7091. Header: res.Header,
  7092. HTTPStatusCode: res.StatusCode,
  7093. },
  7094. }
  7095. target := &ret
  7096. if err := gensupport.DecodeResponse(target, res); err != nil {
  7097. return nil, err
  7098. }
  7099. return ret, nil
  7100. // {
  7101. // "description": "Creates one or more GTM Built-In Variables.",
  7102. // "httpMethod": "POST",
  7103. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.create",
  7104. // "parameterOrder": [
  7105. // "parent"
  7106. // ],
  7107. // "parameters": {
  7108. // "parent": {
  7109. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  7110. // "location": "path",
  7111. // "required": true,
  7112. // "type": "string"
  7113. // },
  7114. // "type": {
  7115. // "description": "The types of built-in variables to enable.",
  7116. // "enum": [
  7117. // "advertiserId",
  7118. // "advertisingTrackingEnabled",
  7119. // "ampBrowserLanguage",
  7120. // "ampCanonicalHost",
  7121. // "ampCanonicalPath",
  7122. // "ampCanonicalUrl",
  7123. // "ampClientId",
  7124. // "ampClientMaxScrollX",
  7125. // "ampClientMaxScrollY",
  7126. // "ampClientScreenHeight",
  7127. // "ampClientScreenWidth",
  7128. // "ampClientScrollX",
  7129. // "ampClientScrollY",
  7130. // "ampClientTimestamp",
  7131. // "ampClientTimezone",
  7132. // "ampGtmEvent",
  7133. // "ampPageDownloadTime",
  7134. // "ampPageLoadTime",
  7135. // "ampPageViewId",
  7136. // "ampReferrer",
  7137. // "ampTitle",
  7138. // "ampTotalEngagedTime",
  7139. // "appId",
  7140. // "appName",
  7141. // "appVersionCode",
  7142. // "appVersionName",
  7143. // "builtInVariableTypeUnspecified",
  7144. // "clickClasses",
  7145. // "clickElement",
  7146. // "clickId",
  7147. // "clickTarget",
  7148. // "clickText",
  7149. // "clickUrl",
  7150. // "containerId",
  7151. // "containerVersion",
  7152. // "debugMode",
  7153. // "deviceName",
  7154. // "elementVisibilityFirstTime",
  7155. // "elementVisibilityRatio",
  7156. // "elementVisibilityRecentTime",
  7157. // "elementVisibilityTime",
  7158. // "environmentName",
  7159. // "errorLine",
  7160. // "errorMessage",
  7161. // "errorUrl",
  7162. // "event",
  7163. // "eventName",
  7164. // "firebaseEventParameterCampaign",
  7165. // "firebaseEventParameterCampaignAclid",
  7166. // "firebaseEventParameterCampaignAnid",
  7167. // "firebaseEventParameterCampaignClickTimestamp",
  7168. // "firebaseEventParameterCampaignContent",
  7169. // "firebaseEventParameterCampaignCp1",
  7170. // "firebaseEventParameterCampaignGclid",
  7171. // "firebaseEventParameterCampaignSource",
  7172. // "firebaseEventParameterCampaignTerm",
  7173. // "firebaseEventParameterCurrency",
  7174. // "firebaseEventParameterDynamicLinkAcceptTime",
  7175. // "firebaseEventParameterDynamicLinkLinkid",
  7176. // "firebaseEventParameterNotificationMessageDeviceTime",
  7177. // "firebaseEventParameterNotificationMessageId",
  7178. // "firebaseEventParameterNotificationMessageName",
  7179. // "firebaseEventParameterNotificationMessageTime",
  7180. // "firebaseEventParameterNotificationTopic",
  7181. // "firebaseEventParameterPreviousAppVersion",
  7182. // "firebaseEventParameterPreviousOsVersion",
  7183. // "firebaseEventParameterPrice",
  7184. // "firebaseEventParameterProductId",
  7185. // "firebaseEventParameterQuantity",
  7186. // "firebaseEventParameterValue",
  7187. // "formClasses",
  7188. // "formElement",
  7189. // "formId",
  7190. // "formTarget",
  7191. // "formText",
  7192. // "formUrl",
  7193. // "historySource",
  7194. // "htmlId",
  7195. // "language",
  7196. // "newHistoryFragment",
  7197. // "newHistoryState",
  7198. // "oldHistoryFragment",
  7199. // "oldHistoryState",
  7200. // "osVersion",
  7201. // "pageHostname",
  7202. // "pagePath",
  7203. // "pageUrl",
  7204. // "platform",
  7205. // "randomNumber",
  7206. // "referrer",
  7207. // "resolution",
  7208. // "scrollDepthDirection",
  7209. // "scrollDepthThreshold",
  7210. // "scrollDepthUnits",
  7211. // "sdkVersion",
  7212. // "videoCurrentTime",
  7213. // "videoDuration",
  7214. // "videoPercent",
  7215. // "videoProvider",
  7216. // "videoStatus",
  7217. // "videoTitle",
  7218. // "videoUrl",
  7219. // "videoVisible"
  7220. // ],
  7221. // "enumDescriptions": [
  7222. // "",
  7223. // "",
  7224. // "",
  7225. // "",
  7226. // "",
  7227. // "",
  7228. // "",
  7229. // "",
  7230. // "",
  7231. // "",
  7232. // "",
  7233. // "",
  7234. // "",
  7235. // "",
  7236. // "",
  7237. // "",
  7238. // "",
  7239. // "",
  7240. // "",
  7241. // "",
  7242. // "",
  7243. // "",
  7244. // "",
  7245. // "",
  7246. // "",
  7247. // "",
  7248. // "",
  7249. // "",
  7250. // "",
  7251. // "",
  7252. // "",
  7253. // "",
  7254. // "",
  7255. // "",
  7256. // "",
  7257. // "",
  7258. // "",
  7259. // "",
  7260. // "",
  7261. // "",
  7262. // "",
  7263. // "",
  7264. // "",
  7265. // "",
  7266. // "",
  7267. // "",
  7268. // "",
  7269. // "",
  7270. // "",
  7271. // "",
  7272. // "",
  7273. // "",
  7274. // "",
  7275. // "",
  7276. // "",
  7277. // "",
  7278. // "",
  7279. // "",
  7280. // "",
  7281. // "",
  7282. // "",
  7283. // "",
  7284. // "",
  7285. // "",
  7286. // "",
  7287. // "",
  7288. // "",
  7289. // "",
  7290. // "",
  7291. // "",
  7292. // "",
  7293. // "",
  7294. // "",
  7295. // "",
  7296. // "",
  7297. // "",
  7298. // "",
  7299. // "",
  7300. // "",
  7301. // "",
  7302. // "",
  7303. // "",
  7304. // "",
  7305. // "",
  7306. // "",
  7307. // "",
  7308. // "",
  7309. // "",
  7310. // "",
  7311. // "",
  7312. // "",
  7313. // "",
  7314. // "",
  7315. // "",
  7316. // "",
  7317. // "",
  7318. // "",
  7319. // "",
  7320. // "",
  7321. // "",
  7322. // "",
  7323. // "",
  7324. // ""
  7325. // ],
  7326. // "location": "query",
  7327. // "repeated": true,
  7328. // "type": "string"
  7329. // }
  7330. // },
  7331. // "path": "{+parent}/built_in_variables",
  7332. // "response": {
  7333. // "$ref": "CreateBuiltInVariableResponse"
  7334. // },
  7335. // "scopes": [
  7336. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  7337. // ]
  7338. // }
  7339. }
  7340. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.delete":
  7341. type AccountsContainersWorkspacesBuiltInVariablesDeleteCall struct {
  7342. s *Service
  7343. path string
  7344. urlParams_ gensupport.URLParams
  7345. ctx_ context.Context
  7346. header_ http.Header
  7347. }
  7348. // Delete: Deletes one or more GTM Built-In Variables.
  7349. func (r *AccountsContainersWorkspacesBuiltInVariablesService) Delete(path string) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7350. c := &AccountsContainersWorkspacesBuiltInVariablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7351. c.path = path
  7352. return c
  7353. }
  7354. // Type sets the optional parameter "type": The types of built-in
  7355. // variables to delete.
  7356. //
  7357. // Possible values:
  7358. // "advertiserId"
  7359. // "advertisingTrackingEnabled"
  7360. // "ampBrowserLanguage"
  7361. // "ampCanonicalHost"
  7362. // "ampCanonicalPath"
  7363. // "ampCanonicalUrl"
  7364. // "ampClientId"
  7365. // "ampClientMaxScrollX"
  7366. // "ampClientMaxScrollY"
  7367. // "ampClientScreenHeight"
  7368. // "ampClientScreenWidth"
  7369. // "ampClientScrollX"
  7370. // "ampClientScrollY"
  7371. // "ampClientTimestamp"
  7372. // "ampClientTimezone"
  7373. // "ampGtmEvent"
  7374. // "ampPageDownloadTime"
  7375. // "ampPageLoadTime"
  7376. // "ampPageViewId"
  7377. // "ampReferrer"
  7378. // "ampTitle"
  7379. // "ampTotalEngagedTime"
  7380. // "appId"
  7381. // "appName"
  7382. // "appVersionCode"
  7383. // "appVersionName"
  7384. // "builtInVariableTypeUnspecified"
  7385. // "clickClasses"
  7386. // "clickElement"
  7387. // "clickId"
  7388. // "clickTarget"
  7389. // "clickText"
  7390. // "clickUrl"
  7391. // "containerId"
  7392. // "containerVersion"
  7393. // "debugMode"
  7394. // "deviceName"
  7395. // "elementVisibilityFirstTime"
  7396. // "elementVisibilityRatio"
  7397. // "elementVisibilityRecentTime"
  7398. // "elementVisibilityTime"
  7399. // "environmentName"
  7400. // "errorLine"
  7401. // "errorMessage"
  7402. // "errorUrl"
  7403. // "event"
  7404. // "eventName"
  7405. // "firebaseEventParameterCampaign"
  7406. // "firebaseEventParameterCampaignAclid"
  7407. // "firebaseEventParameterCampaignAnid"
  7408. // "firebaseEventParameterCampaignClickTimestamp"
  7409. // "firebaseEventParameterCampaignContent"
  7410. // "firebaseEventParameterCampaignCp1"
  7411. // "firebaseEventParameterCampaignGclid"
  7412. // "firebaseEventParameterCampaignSource"
  7413. // "firebaseEventParameterCampaignTerm"
  7414. // "firebaseEventParameterCurrency"
  7415. // "firebaseEventParameterDynamicLinkAcceptTime"
  7416. // "firebaseEventParameterDynamicLinkLinkid"
  7417. // "firebaseEventParameterNotificationMessageDeviceTime"
  7418. // "firebaseEventParameterNotificationMessageId"
  7419. // "firebaseEventParameterNotificationMessageName"
  7420. // "firebaseEventParameterNotificationMessageTime"
  7421. // "firebaseEventParameterNotificationTopic"
  7422. // "firebaseEventParameterPreviousAppVersion"
  7423. // "firebaseEventParameterPreviousOsVersion"
  7424. // "firebaseEventParameterPrice"
  7425. // "firebaseEventParameterProductId"
  7426. // "firebaseEventParameterQuantity"
  7427. // "firebaseEventParameterValue"
  7428. // "formClasses"
  7429. // "formElement"
  7430. // "formId"
  7431. // "formTarget"
  7432. // "formText"
  7433. // "formUrl"
  7434. // "historySource"
  7435. // "htmlId"
  7436. // "language"
  7437. // "newHistoryFragment"
  7438. // "newHistoryState"
  7439. // "oldHistoryFragment"
  7440. // "oldHistoryState"
  7441. // "osVersion"
  7442. // "pageHostname"
  7443. // "pagePath"
  7444. // "pageUrl"
  7445. // "platform"
  7446. // "randomNumber"
  7447. // "referrer"
  7448. // "resolution"
  7449. // "scrollDepthDirection"
  7450. // "scrollDepthThreshold"
  7451. // "scrollDepthUnits"
  7452. // "sdkVersion"
  7453. // "videoCurrentTime"
  7454. // "videoDuration"
  7455. // "videoPercent"
  7456. // "videoProvider"
  7457. // "videoStatus"
  7458. // "videoTitle"
  7459. // "videoUrl"
  7460. // "videoVisible"
  7461. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Type(type_ ...string) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7462. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  7463. return c
  7464. }
  7465. // Fields allows partial responses to be retrieved. See
  7466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7467. // for more information.
  7468. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7470. return c
  7471. }
  7472. // Context sets the context to be used in this call's Do method. Any
  7473. // pending HTTP request will be aborted if the provided context is
  7474. // canceled.
  7475. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7476. c.ctx_ = ctx
  7477. return c
  7478. }
  7479. // Header returns an http.Header that can be modified by the caller to
  7480. // add HTTP headers to the request.
  7481. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Header() http.Header {
  7482. if c.header_ == nil {
  7483. c.header_ = make(http.Header)
  7484. }
  7485. return c.header_
  7486. }
  7487. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7488. reqHeaders := make(http.Header)
  7489. for k, v := range c.header_ {
  7490. reqHeaders[k] = v
  7491. }
  7492. reqHeaders.Set("User-Agent", c.s.userAgent())
  7493. var body io.Reader = nil
  7494. c.urlParams_.Set("alt", alt)
  7495. c.urlParams_.Set("prettyPrint", "false")
  7496. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  7497. urls += "?" + c.urlParams_.Encode()
  7498. req, err := http.NewRequest("DELETE", urls, body)
  7499. if err != nil {
  7500. return nil, err
  7501. }
  7502. req.Header = reqHeaders
  7503. googleapi.Expand(req.URL, map[string]string{
  7504. "path": c.path,
  7505. })
  7506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7507. }
  7508. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.delete" call.
  7509. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  7510. gensupport.SetOptions(c.urlParams_, opts...)
  7511. res, err := c.doRequest("json")
  7512. if err != nil {
  7513. return err
  7514. }
  7515. defer googleapi.CloseBody(res)
  7516. if err := googleapi.CheckResponse(res); err != nil {
  7517. return err
  7518. }
  7519. return nil
  7520. // {
  7521. // "description": "Deletes one or more GTM Built-In Variables.",
  7522. // "httpMethod": "DELETE",
  7523. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.delete",
  7524. // "parameterOrder": [
  7525. // "path"
  7526. // ],
  7527. // "parameters": {
  7528. // "path": {
  7529. // "description": "GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables",
  7530. // "location": "path",
  7531. // "required": true,
  7532. // "type": "string"
  7533. // },
  7534. // "type": {
  7535. // "description": "The types of built-in variables to delete.",
  7536. // "enum": [
  7537. // "advertiserId",
  7538. // "advertisingTrackingEnabled",
  7539. // "ampBrowserLanguage",
  7540. // "ampCanonicalHost",
  7541. // "ampCanonicalPath",
  7542. // "ampCanonicalUrl",
  7543. // "ampClientId",
  7544. // "ampClientMaxScrollX",
  7545. // "ampClientMaxScrollY",
  7546. // "ampClientScreenHeight",
  7547. // "ampClientScreenWidth",
  7548. // "ampClientScrollX",
  7549. // "ampClientScrollY",
  7550. // "ampClientTimestamp",
  7551. // "ampClientTimezone",
  7552. // "ampGtmEvent",
  7553. // "ampPageDownloadTime",
  7554. // "ampPageLoadTime",
  7555. // "ampPageViewId",
  7556. // "ampReferrer",
  7557. // "ampTitle",
  7558. // "ampTotalEngagedTime",
  7559. // "appId",
  7560. // "appName",
  7561. // "appVersionCode",
  7562. // "appVersionName",
  7563. // "builtInVariableTypeUnspecified",
  7564. // "clickClasses",
  7565. // "clickElement",
  7566. // "clickId",
  7567. // "clickTarget",
  7568. // "clickText",
  7569. // "clickUrl",
  7570. // "containerId",
  7571. // "containerVersion",
  7572. // "debugMode",
  7573. // "deviceName",
  7574. // "elementVisibilityFirstTime",
  7575. // "elementVisibilityRatio",
  7576. // "elementVisibilityRecentTime",
  7577. // "elementVisibilityTime",
  7578. // "environmentName",
  7579. // "errorLine",
  7580. // "errorMessage",
  7581. // "errorUrl",
  7582. // "event",
  7583. // "eventName",
  7584. // "firebaseEventParameterCampaign",
  7585. // "firebaseEventParameterCampaignAclid",
  7586. // "firebaseEventParameterCampaignAnid",
  7587. // "firebaseEventParameterCampaignClickTimestamp",
  7588. // "firebaseEventParameterCampaignContent",
  7589. // "firebaseEventParameterCampaignCp1",
  7590. // "firebaseEventParameterCampaignGclid",
  7591. // "firebaseEventParameterCampaignSource",
  7592. // "firebaseEventParameterCampaignTerm",
  7593. // "firebaseEventParameterCurrency",
  7594. // "firebaseEventParameterDynamicLinkAcceptTime",
  7595. // "firebaseEventParameterDynamicLinkLinkid",
  7596. // "firebaseEventParameterNotificationMessageDeviceTime",
  7597. // "firebaseEventParameterNotificationMessageId",
  7598. // "firebaseEventParameterNotificationMessageName",
  7599. // "firebaseEventParameterNotificationMessageTime",
  7600. // "firebaseEventParameterNotificationTopic",
  7601. // "firebaseEventParameterPreviousAppVersion",
  7602. // "firebaseEventParameterPreviousOsVersion",
  7603. // "firebaseEventParameterPrice",
  7604. // "firebaseEventParameterProductId",
  7605. // "firebaseEventParameterQuantity",
  7606. // "firebaseEventParameterValue",
  7607. // "formClasses",
  7608. // "formElement",
  7609. // "formId",
  7610. // "formTarget",
  7611. // "formText",
  7612. // "formUrl",
  7613. // "historySource",
  7614. // "htmlId",
  7615. // "language",
  7616. // "newHistoryFragment",
  7617. // "newHistoryState",
  7618. // "oldHistoryFragment",
  7619. // "oldHistoryState",
  7620. // "osVersion",
  7621. // "pageHostname",
  7622. // "pagePath",
  7623. // "pageUrl",
  7624. // "platform",
  7625. // "randomNumber",
  7626. // "referrer",
  7627. // "resolution",
  7628. // "scrollDepthDirection",
  7629. // "scrollDepthThreshold",
  7630. // "scrollDepthUnits",
  7631. // "sdkVersion",
  7632. // "videoCurrentTime",
  7633. // "videoDuration",
  7634. // "videoPercent",
  7635. // "videoProvider",
  7636. // "videoStatus",
  7637. // "videoTitle",
  7638. // "videoUrl",
  7639. // "videoVisible"
  7640. // ],
  7641. // "enumDescriptions": [
  7642. // "",
  7643. // "",
  7644. // "",
  7645. // "",
  7646. // "",
  7647. // "",
  7648. // "",
  7649. // "",
  7650. // "",
  7651. // "",
  7652. // "",
  7653. // "",
  7654. // "",
  7655. // "",
  7656. // "",
  7657. // "",
  7658. // "",
  7659. // "",
  7660. // "",
  7661. // "",
  7662. // "",
  7663. // "",
  7664. // "",
  7665. // "",
  7666. // "",
  7667. // "",
  7668. // "",
  7669. // "",
  7670. // "",
  7671. // "",
  7672. // "",
  7673. // "",
  7674. // "",
  7675. // "",
  7676. // "",
  7677. // "",
  7678. // "",
  7679. // "",
  7680. // "",
  7681. // "",
  7682. // "",
  7683. // "",
  7684. // "",
  7685. // "",
  7686. // "",
  7687. // "",
  7688. // "",
  7689. // "",
  7690. // "",
  7691. // "",
  7692. // "",
  7693. // "",
  7694. // "",
  7695. // "",
  7696. // "",
  7697. // "",
  7698. // "",
  7699. // "",
  7700. // "",
  7701. // "",
  7702. // "",
  7703. // "",
  7704. // "",
  7705. // "",
  7706. // "",
  7707. // "",
  7708. // "",
  7709. // "",
  7710. // "",
  7711. // "",
  7712. // "",
  7713. // "",
  7714. // "",
  7715. // "",
  7716. // "",
  7717. // "",
  7718. // "",
  7719. // "",
  7720. // "",
  7721. // "",
  7722. // "",
  7723. // "",
  7724. // "",
  7725. // "",
  7726. // "",
  7727. // "",
  7728. // "",
  7729. // "",
  7730. // "",
  7731. // "",
  7732. // "",
  7733. // "",
  7734. // "",
  7735. // "",
  7736. // "",
  7737. // "",
  7738. // "",
  7739. // "",
  7740. // "",
  7741. // "",
  7742. // "",
  7743. // "",
  7744. // ""
  7745. // ],
  7746. // "location": "query",
  7747. // "repeated": true,
  7748. // "type": "string"
  7749. // }
  7750. // },
  7751. // "path": "{+path}",
  7752. // "scopes": [
  7753. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  7754. // ]
  7755. // }
  7756. }
  7757. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.list":
  7758. type AccountsContainersWorkspacesBuiltInVariablesListCall struct {
  7759. s *Service
  7760. parent string
  7761. urlParams_ gensupport.URLParams
  7762. ifNoneMatch_ string
  7763. ctx_ context.Context
  7764. header_ http.Header
  7765. }
  7766. // List: Lists all the enabled Built-In Variables of a GTM Container.
  7767. func (r *AccountsContainersWorkspacesBuiltInVariablesService) List(parent string) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  7768. c := &AccountsContainersWorkspacesBuiltInVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7769. c.parent = parent
  7770. return c
  7771. }
  7772. // PageToken sets the optional parameter "pageToken": Continuation token
  7773. // for fetching the next page of results.
  7774. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  7775. c.urlParams_.Set("pageToken", pageToken)
  7776. return c
  7777. }
  7778. // Fields allows partial responses to be retrieved. See
  7779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7780. // for more information.
  7781. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  7782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7783. return c
  7784. }
  7785. // IfNoneMatch sets the optional parameter which makes the operation
  7786. // fail if the object's ETag matches the given value. This is useful for
  7787. // getting updates only after the object has changed since the last
  7788. // request. Use googleapi.IsNotModified to check whether the response
  7789. // error from Do is the result of In-None-Match.
  7790. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  7791. c.ifNoneMatch_ = entityTag
  7792. return c
  7793. }
  7794. // Context sets the context to be used in this call's Do method. Any
  7795. // pending HTTP request will be aborted if the provided context is
  7796. // canceled.
  7797. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  7798. c.ctx_ = ctx
  7799. return c
  7800. }
  7801. // Header returns an http.Header that can be modified by the caller to
  7802. // add HTTP headers to the request.
  7803. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Header() http.Header {
  7804. if c.header_ == nil {
  7805. c.header_ = make(http.Header)
  7806. }
  7807. return c.header_
  7808. }
  7809. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) doRequest(alt string) (*http.Response, error) {
  7810. reqHeaders := make(http.Header)
  7811. for k, v := range c.header_ {
  7812. reqHeaders[k] = v
  7813. }
  7814. reqHeaders.Set("User-Agent", c.s.userAgent())
  7815. if c.ifNoneMatch_ != "" {
  7816. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7817. }
  7818. var body io.Reader = nil
  7819. c.urlParams_.Set("alt", alt)
  7820. c.urlParams_.Set("prettyPrint", "false")
  7821. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/built_in_variables")
  7822. urls += "?" + c.urlParams_.Encode()
  7823. req, err := http.NewRequest("GET", urls, body)
  7824. if err != nil {
  7825. return nil, err
  7826. }
  7827. req.Header = reqHeaders
  7828. googleapi.Expand(req.URL, map[string]string{
  7829. "parent": c.parent,
  7830. })
  7831. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7832. }
  7833. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.list" call.
  7834. // Exactly one of *ListEnabledBuiltInVariablesResponse or error will be
  7835. // non-nil. Any non-2xx status code is an error. Response headers are in
  7836. // either *ListEnabledBuiltInVariablesResponse.ServerResponse.Header or
  7837. // (if a response was returned at all) in
  7838. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7839. // whether the returned error was because http.StatusNotModified was
  7840. // returned.
  7841. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Do(opts ...googleapi.CallOption) (*ListEnabledBuiltInVariablesResponse, error) {
  7842. gensupport.SetOptions(c.urlParams_, opts...)
  7843. res, err := c.doRequest("json")
  7844. if res != nil && res.StatusCode == http.StatusNotModified {
  7845. if res.Body != nil {
  7846. res.Body.Close()
  7847. }
  7848. return nil, &googleapi.Error{
  7849. Code: res.StatusCode,
  7850. Header: res.Header,
  7851. }
  7852. }
  7853. if err != nil {
  7854. return nil, err
  7855. }
  7856. defer googleapi.CloseBody(res)
  7857. if err := googleapi.CheckResponse(res); err != nil {
  7858. return nil, err
  7859. }
  7860. ret := &ListEnabledBuiltInVariablesResponse{
  7861. ServerResponse: googleapi.ServerResponse{
  7862. Header: res.Header,
  7863. HTTPStatusCode: res.StatusCode,
  7864. },
  7865. }
  7866. target := &ret
  7867. if err := gensupport.DecodeResponse(target, res); err != nil {
  7868. return nil, err
  7869. }
  7870. return ret, nil
  7871. // {
  7872. // "description": "Lists all the enabled Built-In Variables of a GTM Container.",
  7873. // "httpMethod": "GET",
  7874. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.list",
  7875. // "parameterOrder": [
  7876. // "parent"
  7877. // ],
  7878. // "parameters": {
  7879. // "pageToken": {
  7880. // "description": "Continuation token for fetching the next page of results.",
  7881. // "location": "query",
  7882. // "type": "string"
  7883. // },
  7884. // "parent": {
  7885. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  7886. // "location": "path",
  7887. // "required": true,
  7888. // "type": "string"
  7889. // }
  7890. // },
  7891. // "path": "{+parent}/built_in_variables",
  7892. // "response": {
  7893. // "$ref": "ListEnabledBuiltInVariablesResponse"
  7894. // },
  7895. // "scopes": [
  7896. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  7897. // "https://www.googleapis.com/auth/tagmanager.readonly"
  7898. // ]
  7899. // }
  7900. }
  7901. // Pages invokes f for each page of results.
  7902. // A non-nil error returned from f will halt the iteration.
  7903. // The provided context supersedes any context provided to the Context method.
  7904. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Pages(ctx context.Context, f func(*ListEnabledBuiltInVariablesResponse) error) error {
  7905. c.ctx_ = ctx
  7906. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7907. for {
  7908. x, err := c.Do()
  7909. if err != nil {
  7910. return err
  7911. }
  7912. if err := f(x); err != nil {
  7913. return err
  7914. }
  7915. if x.NextPageToken == "" {
  7916. return nil
  7917. }
  7918. c.PageToken(x.NextPageToken)
  7919. }
  7920. }
  7921. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.revert":
  7922. type AccountsContainersWorkspacesBuiltInVariablesRevertCall struct {
  7923. s *Service
  7924. path string
  7925. urlParams_ gensupport.URLParams
  7926. ctx_ context.Context
  7927. header_ http.Header
  7928. }
  7929. // Revert: Reverts changes to a GTM Built-In Variables in a GTM
  7930. // Workspace.
  7931. func (r *AccountsContainersWorkspacesBuiltInVariablesService) Revert(path string) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  7932. c := &AccountsContainersWorkspacesBuiltInVariablesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7933. c.path = path
  7934. return c
  7935. }
  7936. // Type sets the optional parameter "type": The type of built-in
  7937. // variable to revert.
  7938. //
  7939. // Possible values:
  7940. // "advertiserId"
  7941. // "advertisingTrackingEnabled"
  7942. // "ampBrowserLanguage"
  7943. // "ampCanonicalHost"
  7944. // "ampCanonicalPath"
  7945. // "ampCanonicalUrl"
  7946. // "ampClientId"
  7947. // "ampClientMaxScrollX"
  7948. // "ampClientMaxScrollY"
  7949. // "ampClientScreenHeight"
  7950. // "ampClientScreenWidth"
  7951. // "ampClientScrollX"
  7952. // "ampClientScrollY"
  7953. // "ampClientTimestamp"
  7954. // "ampClientTimezone"
  7955. // "ampGtmEvent"
  7956. // "ampPageDownloadTime"
  7957. // "ampPageLoadTime"
  7958. // "ampPageViewId"
  7959. // "ampReferrer"
  7960. // "ampTitle"
  7961. // "ampTotalEngagedTime"
  7962. // "appId"
  7963. // "appName"
  7964. // "appVersionCode"
  7965. // "appVersionName"
  7966. // "builtInVariableTypeUnspecified"
  7967. // "clickClasses"
  7968. // "clickElement"
  7969. // "clickId"
  7970. // "clickTarget"
  7971. // "clickText"
  7972. // "clickUrl"
  7973. // "containerId"
  7974. // "containerVersion"
  7975. // "debugMode"
  7976. // "deviceName"
  7977. // "elementVisibilityFirstTime"
  7978. // "elementVisibilityRatio"
  7979. // "elementVisibilityRecentTime"
  7980. // "elementVisibilityTime"
  7981. // "environmentName"
  7982. // "errorLine"
  7983. // "errorMessage"
  7984. // "errorUrl"
  7985. // "event"
  7986. // "eventName"
  7987. // "firebaseEventParameterCampaign"
  7988. // "firebaseEventParameterCampaignAclid"
  7989. // "firebaseEventParameterCampaignAnid"
  7990. // "firebaseEventParameterCampaignClickTimestamp"
  7991. // "firebaseEventParameterCampaignContent"
  7992. // "firebaseEventParameterCampaignCp1"
  7993. // "firebaseEventParameterCampaignGclid"
  7994. // "firebaseEventParameterCampaignSource"
  7995. // "firebaseEventParameterCampaignTerm"
  7996. // "firebaseEventParameterCurrency"
  7997. // "firebaseEventParameterDynamicLinkAcceptTime"
  7998. // "firebaseEventParameterDynamicLinkLinkid"
  7999. // "firebaseEventParameterNotificationMessageDeviceTime"
  8000. // "firebaseEventParameterNotificationMessageId"
  8001. // "firebaseEventParameterNotificationMessageName"
  8002. // "firebaseEventParameterNotificationMessageTime"
  8003. // "firebaseEventParameterNotificationTopic"
  8004. // "firebaseEventParameterPreviousAppVersion"
  8005. // "firebaseEventParameterPreviousOsVersion"
  8006. // "firebaseEventParameterPrice"
  8007. // "firebaseEventParameterProductId"
  8008. // "firebaseEventParameterQuantity"
  8009. // "firebaseEventParameterValue"
  8010. // "formClasses"
  8011. // "formElement"
  8012. // "formId"
  8013. // "formTarget"
  8014. // "formText"
  8015. // "formUrl"
  8016. // "historySource"
  8017. // "htmlId"
  8018. // "language"
  8019. // "newHistoryFragment"
  8020. // "newHistoryState"
  8021. // "oldHistoryFragment"
  8022. // "oldHistoryState"
  8023. // "osVersion"
  8024. // "pageHostname"
  8025. // "pagePath"
  8026. // "pageUrl"
  8027. // "platform"
  8028. // "randomNumber"
  8029. // "referrer"
  8030. // "resolution"
  8031. // "scrollDepthDirection"
  8032. // "scrollDepthThreshold"
  8033. // "scrollDepthUnits"
  8034. // "sdkVersion"
  8035. // "videoCurrentTime"
  8036. // "videoDuration"
  8037. // "videoPercent"
  8038. // "videoProvider"
  8039. // "videoStatus"
  8040. // "videoTitle"
  8041. // "videoUrl"
  8042. // "videoVisible"
  8043. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Type(type_ string) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8044. c.urlParams_.Set("type", type_)
  8045. return c
  8046. }
  8047. // Fields allows partial responses to be retrieved. See
  8048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8049. // for more information.
  8050. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8052. return c
  8053. }
  8054. // Context sets the context to be used in this call's Do method. Any
  8055. // pending HTTP request will be aborted if the provided context is
  8056. // canceled.
  8057. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8058. c.ctx_ = ctx
  8059. return c
  8060. }
  8061. // Header returns an http.Header that can be modified by the caller to
  8062. // add HTTP headers to the request.
  8063. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Header() http.Header {
  8064. if c.header_ == nil {
  8065. c.header_ = make(http.Header)
  8066. }
  8067. return c.header_
  8068. }
  8069. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) doRequest(alt string) (*http.Response, error) {
  8070. reqHeaders := make(http.Header)
  8071. for k, v := range c.header_ {
  8072. reqHeaders[k] = v
  8073. }
  8074. reqHeaders.Set("User-Agent", c.s.userAgent())
  8075. var body io.Reader = nil
  8076. c.urlParams_.Set("alt", alt)
  8077. c.urlParams_.Set("prettyPrint", "false")
  8078. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}/built_in_variables:revert")
  8079. urls += "?" + c.urlParams_.Encode()
  8080. req, err := http.NewRequest("POST", urls, body)
  8081. if err != nil {
  8082. return nil, err
  8083. }
  8084. req.Header = reqHeaders
  8085. googleapi.Expand(req.URL, map[string]string{
  8086. "path": c.path,
  8087. })
  8088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8089. }
  8090. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.revert" call.
  8091. // Exactly one of *RevertBuiltInVariableResponse or error will be
  8092. // non-nil. Any non-2xx status code is an error. Response headers are in
  8093. // either *RevertBuiltInVariableResponse.ServerResponse.Header or (if a
  8094. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8095. // googleapi.IsNotModified to check whether the returned error was
  8096. // because http.StatusNotModified was returned.
  8097. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Do(opts ...googleapi.CallOption) (*RevertBuiltInVariableResponse, error) {
  8098. gensupport.SetOptions(c.urlParams_, opts...)
  8099. res, err := c.doRequest("json")
  8100. if res != nil && res.StatusCode == http.StatusNotModified {
  8101. if res.Body != nil {
  8102. res.Body.Close()
  8103. }
  8104. return nil, &googleapi.Error{
  8105. Code: res.StatusCode,
  8106. Header: res.Header,
  8107. }
  8108. }
  8109. if err != nil {
  8110. return nil, err
  8111. }
  8112. defer googleapi.CloseBody(res)
  8113. if err := googleapi.CheckResponse(res); err != nil {
  8114. return nil, err
  8115. }
  8116. ret := &RevertBuiltInVariableResponse{
  8117. ServerResponse: googleapi.ServerResponse{
  8118. Header: res.Header,
  8119. HTTPStatusCode: res.StatusCode,
  8120. },
  8121. }
  8122. target := &ret
  8123. if err := gensupport.DecodeResponse(target, res); err != nil {
  8124. return nil, err
  8125. }
  8126. return ret, nil
  8127. // {
  8128. // "description": "Reverts changes to a GTM Built-In Variables in a GTM Workspace.",
  8129. // "httpMethod": "POST",
  8130. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.revert",
  8131. // "parameterOrder": [
  8132. // "path"
  8133. // ],
  8134. // "parameters": {
  8135. // "path": {
  8136. // "description": "GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables",
  8137. // "location": "path",
  8138. // "required": true,
  8139. // "type": "string"
  8140. // },
  8141. // "type": {
  8142. // "description": "The type of built-in variable to revert.",
  8143. // "enum": [
  8144. // "advertiserId",
  8145. // "advertisingTrackingEnabled",
  8146. // "ampBrowserLanguage",
  8147. // "ampCanonicalHost",
  8148. // "ampCanonicalPath",
  8149. // "ampCanonicalUrl",
  8150. // "ampClientId",
  8151. // "ampClientMaxScrollX",
  8152. // "ampClientMaxScrollY",
  8153. // "ampClientScreenHeight",
  8154. // "ampClientScreenWidth",
  8155. // "ampClientScrollX",
  8156. // "ampClientScrollY",
  8157. // "ampClientTimestamp",
  8158. // "ampClientTimezone",
  8159. // "ampGtmEvent",
  8160. // "ampPageDownloadTime",
  8161. // "ampPageLoadTime",
  8162. // "ampPageViewId",
  8163. // "ampReferrer",
  8164. // "ampTitle",
  8165. // "ampTotalEngagedTime",
  8166. // "appId",
  8167. // "appName",
  8168. // "appVersionCode",
  8169. // "appVersionName",
  8170. // "builtInVariableTypeUnspecified",
  8171. // "clickClasses",
  8172. // "clickElement",
  8173. // "clickId",
  8174. // "clickTarget",
  8175. // "clickText",
  8176. // "clickUrl",
  8177. // "containerId",
  8178. // "containerVersion",
  8179. // "debugMode",
  8180. // "deviceName",
  8181. // "elementVisibilityFirstTime",
  8182. // "elementVisibilityRatio",
  8183. // "elementVisibilityRecentTime",
  8184. // "elementVisibilityTime",
  8185. // "environmentName",
  8186. // "errorLine",
  8187. // "errorMessage",
  8188. // "errorUrl",
  8189. // "event",
  8190. // "eventName",
  8191. // "firebaseEventParameterCampaign",
  8192. // "firebaseEventParameterCampaignAclid",
  8193. // "firebaseEventParameterCampaignAnid",
  8194. // "firebaseEventParameterCampaignClickTimestamp",
  8195. // "firebaseEventParameterCampaignContent",
  8196. // "firebaseEventParameterCampaignCp1",
  8197. // "firebaseEventParameterCampaignGclid",
  8198. // "firebaseEventParameterCampaignSource",
  8199. // "firebaseEventParameterCampaignTerm",
  8200. // "firebaseEventParameterCurrency",
  8201. // "firebaseEventParameterDynamicLinkAcceptTime",
  8202. // "firebaseEventParameterDynamicLinkLinkid",
  8203. // "firebaseEventParameterNotificationMessageDeviceTime",
  8204. // "firebaseEventParameterNotificationMessageId",
  8205. // "firebaseEventParameterNotificationMessageName",
  8206. // "firebaseEventParameterNotificationMessageTime",
  8207. // "firebaseEventParameterNotificationTopic",
  8208. // "firebaseEventParameterPreviousAppVersion",
  8209. // "firebaseEventParameterPreviousOsVersion",
  8210. // "firebaseEventParameterPrice",
  8211. // "firebaseEventParameterProductId",
  8212. // "firebaseEventParameterQuantity",
  8213. // "firebaseEventParameterValue",
  8214. // "formClasses",
  8215. // "formElement",
  8216. // "formId",
  8217. // "formTarget",
  8218. // "formText",
  8219. // "formUrl",
  8220. // "historySource",
  8221. // "htmlId",
  8222. // "language",
  8223. // "newHistoryFragment",
  8224. // "newHistoryState",
  8225. // "oldHistoryFragment",
  8226. // "oldHistoryState",
  8227. // "osVersion",
  8228. // "pageHostname",
  8229. // "pagePath",
  8230. // "pageUrl",
  8231. // "platform",
  8232. // "randomNumber",
  8233. // "referrer",
  8234. // "resolution",
  8235. // "scrollDepthDirection",
  8236. // "scrollDepthThreshold",
  8237. // "scrollDepthUnits",
  8238. // "sdkVersion",
  8239. // "videoCurrentTime",
  8240. // "videoDuration",
  8241. // "videoPercent",
  8242. // "videoProvider",
  8243. // "videoStatus",
  8244. // "videoTitle",
  8245. // "videoUrl",
  8246. // "videoVisible"
  8247. // ],
  8248. // "enumDescriptions": [
  8249. // "",
  8250. // "",
  8251. // "",
  8252. // "",
  8253. // "",
  8254. // "",
  8255. // "",
  8256. // "",
  8257. // "",
  8258. // "",
  8259. // "",
  8260. // "",
  8261. // "",
  8262. // "",
  8263. // "",
  8264. // "",
  8265. // "",
  8266. // "",
  8267. // "",
  8268. // "",
  8269. // "",
  8270. // "",
  8271. // "",
  8272. // "",
  8273. // "",
  8274. // "",
  8275. // "",
  8276. // "",
  8277. // "",
  8278. // "",
  8279. // "",
  8280. // "",
  8281. // "",
  8282. // "",
  8283. // "",
  8284. // "",
  8285. // "",
  8286. // "",
  8287. // "",
  8288. // "",
  8289. // "",
  8290. // "",
  8291. // "",
  8292. // "",
  8293. // "",
  8294. // "",
  8295. // "",
  8296. // "",
  8297. // "",
  8298. // "",
  8299. // "",
  8300. // "",
  8301. // "",
  8302. // "",
  8303. // "",
  8304. // "",
  8305. // "",
  8306. // "",
  8307. // "",
  8308. // "",
  8309. // "",
  8310. // "",
  8311. // "",
  8312. // "",
  8313. // "",
  8314. // "",
  8315. // "",
  8316. // "",
  8317. // "",
  8318. // "",
  8319. // "",
  8320. // "",
  8321. // "",
  8322. // "",
  8323. // "",
  8324. // "",
  8325. // "",
  8326. // "",
  8327. // "",
  8328. // "",
  8329. // "",
  8330. // "",
  8331. // "",
  8332. // "",
  8333. // "",
  8334. // "",
  8335. // "",
  8336. // "",
  8337. // "",
  8338. // "",
  8339. // "",
  8340. // "",
  8341. // "",
  8342. // "",
  8343. // "",
  8344. // "",
  8345. // "",
  8346. // "",
  8347. // "",
  8348. // "",
  8349. // "",
  8350. // "",
  8351. // ""
  8352. // ],
  8353. // "location": "query",
  8354. // "type": "string"
  8355. // }
  8356. // },
  8357. // "path": "{+path}/built_in_variables:revert",
  8358. // "response": {
  8359. // "$ref": "RevertBuiltInVariableResponse"
  8360. // },
  8361. // "scopes": [
  8362. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8363. // ]
  8364. // }
  8365. }
  8366. // method id "tagmanager.accounts.containers.workspaces.folders.create":
  8367. type AccountsContainersWorkspacesFoldersCreateCall struct {
  8368. s *Service
  8369. parent string
  8370. folder *Folder
  8371. urlParams_ gensupport.URLParams
  8372. ctx_ context.Context
  8373. header_ http.Header
  8374. }
  8375. // Create: Creates a GTM Folder.
  8376. func (r *AccountsContainersWorkspacesFoldersService) Create(parent string, folder *Folder) *AccountsContainersWorkspacesFoldersCreateCall {
  8377. c := &AccountsContainersWorkspacesFoldersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8378. c.parent = parent
  8379. c.folder = folder
  8380. return c
  8381. }
  8382. // Fields allows partial responses to be retrieved. See
  8383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8384. // for more information.
  8385. func (c *AccountsContainersWorkspacesFoldersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersCreateCall {
  8386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8387. return c
  8388. }
  8389. // Context sets the context to be used in this call's Do method. Any
  8390. // pending HTTP request will be aborted if the provided context is
  8391. // canceled.
  8392. func (c *AccountsContainersWorkspacesFoldersCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersCreateCall {
  8393. c.ctx_ = ctx
  8394. return c
  8395. }
  8396. // Header returns an http.Header that can be modified by the caller to
  8397. // add HTTP headers to the request.
  8398. func (c *AccountsContainersWorkspacesFoldersCreateCall) Header() http.Header {
  8399. if c.header_ == nil {
  8400. c.header_ = make(http.Header)
  8401. }
  8402. return c.header_
  8403. }
  8404. func (c *AccountsContainersWorkspacesFoldersCreateCall) doRequest(alt string) (*http.Response, error) {
  8405. reqHeaders := make(http.Header)
  8406. for k, v := range c.header_ {
  8407. reqHeaders[k] = v
  8408. }
  8409. reqHeaders.Set("User-Agent", c.s.userAgent())
  8410. var body io.Reader = nil
  8411. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  8412. if err != nil {
  8413. return nil, err
  8414. }
  8415. reqHeaders.Set("Content-Type", "application/json")
  8416. c.urlParams_.Set("alt", alt)
  8417. c.urlParams_.Set("prettyPrint", "false")
  8418. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/folders")
  8419. urls += "?" + c.urlParams_.Encode()
  8420. req, err := http.NewRequest("POST", urls, body)
  8421. if err != nil {
  8422. return nil, err
  8423. }
  8424. req.Header = reqHeaders
  8425. googleapi.Expand(req.URL, map[string]string{
  8426. "parent": c.parent,
  8427. })
  8428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8429. }
  8430. // Do executes the "tagmanager.accounts.containers.workspaces.folders.create" call.
  8431. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  8432. // code is an error. Response headers are in either
  8433. // *Folder.ServerResponse.Header or (if a response was returned at all)
  8434. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8435. // check whether the returned error was because http.StatusNotModified
  8436. // was returned.
  8437. func (c *AccountsContainersWorkspacesFoldersCreateCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  8438. gensupport.SetOptions(c.urlParams_, opts...)
  8439. res, err := c.doRequest("json")
  8440. if res != nil && res.StatusCode == http.StatusNotModified {
  8441. if res.Body != nil {
  8442. res.Body.Close()
  8443. }
  8444. return nil, &googleapi.Error{
  8445. Code: res.StatusCode,
  8446. Header: res.Header,
  8447. }
  8448. }
  8449. if err != nil {
  8450. return nil, err
  8451. }
  8452. defer googleapi.CloseBody(res)
  8453. if err := googleapi.CheckResponse(res); err != nil {
  8454. return nil, err
  8455. }
  8456. ret := &Folder{
  8457. ServerResponse: googleapi.ServerResponse{
  8458. Header: res.Header,
  8459. HTTPStatusCode: res.StatusCode,
  8460. },
  8461. }
  8462. target := &ret
  8463. if err := gensupport.DecodeResponse(target, res); err != nil {
  8464. return nil, err
  8465. }
  8466. return ret, nil
  8467. // {
  8468. // "description": "Creates a GTM Folder.",
  8469. // "httpMethod": "POST",
  8470. // "id": "tagmanager.accounts.containers.workspaces.folders.create",
  8471. // "parameterOrder": [
  8472. // "parent"
  8473. // ],
  8474. // "parameters": {
  8475. // "parent": {
  8476. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  8477. // "location": "path",
  8478. // "required": true,
  8479. // "type": "string"
  8480. // }
  8481. // },
  8482. // "path": "{+parent}/folders",
  8483. // "request": {
  8484. // "$ref": "Folder"
  8485. // },
  8486. // "response": {
  8487. // "$ref": "Folder"
  8488. // },
  8489. // "scopes": [
  8490. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8491. // ]
  8492. // }
  8493. }
  8494. // method id "tagmanager.accounts.containers.workspaces.folders.delete":
  8495. type AccountsContainersWorkspacesFoldersDeleteCall struct {
  8496. s *Service
  8497. path string
  8498. urlParams_ gensupport.URLParams
  8499. ctx_ context.Context
  8500. header_ http.Header
  8501. }
  8502. // Delete: Deletes a GTM Folder.
  8503. func (r *AccountsContainersWorkspacesFoldersService) Delete(path string) *AccountsContainersWorkspacesFoldersDeleteCall {
  8504. c := &AccountsContainersWorkspacesFoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8505. c.path = path
  8506. return c
  8507. }
  8508. // Fields allows partial responses to be retrieved. See
  8509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8510. // for more information.
  8511. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersDeleteCall {
  8512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8513. return c
  8514. }
  8515. // Context sets the context to be used in this call's Do method. Any
  8516. // pending HTTP request will be aborted if the provided context is
  8517. // canceled.
  8518. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersDeleteCall {
  8519. c.ctx_ = ctx
  8520. return c
  8521. }
  8522. // Header returns an http.Header that can be modified by the caller to
  8523. // add HTTP headers to the request.
  8524. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Header() http.Header {
  8525. if c.header_ == nil {
  8526. c.header_ = make(http.Header)
  8527. }
  8528. return c.header_
  8529. }
  8530. func (c *AccountsContainersWorkspacesFoldersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8531. reqHeaders := make(http.Header)
  8532. for k, v := range c.header_ {
  8533. reqHeaders[k] = v
  8534. }
  8535. reqHeaders.Set("User-Agent", c.s.userAgent())
  8536. var body io.Reader = nil
  8537. c.urlParams_.Set("alt", alt)
  8538. c.urlParams_.Set("prettyPrint", "false")
  8539. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  8540. urls += "?" + c.urlParams_.Encode()
  8541. req, err := http.NewRequest("DELETE", urls, body)
  8542. if err != nil {
  8543. return nil, err
  8544. }
  8545. req.Header = reqHeaders
  8546. googleapi.Expand(req.URL, map[string]string{
  8547. "path": c.path,
  8548. })
  8549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8550. }
  8551. // Do executes the "tagmanager.accounts.containers.workspaces.folders.delete" call.
  8552. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Do(opts ...googleapi.CallOption) error {
  8553. gensupport.SetOptions(c.urlParams_, opts...)
  8554. res, err := c.doRequest("json")
  8555. if err != nil {
  8556. return err
  8557. }
  8558. defer googleapi.CloseBody(res)
  8559. if err := googleapi.CheckResponse(res); err != nil {
  8560. return err
  8561. }
  8562. return nil
  8563. // {
  8564. // "description": "Deletes a GTM Folder.",
  8565. // "httpMethod": "DELETE",
  8566. // "id": "tagmanager.accounts.containers.workspaces.folders.delete",
  8567. // "parameterOrder": [
  8568. // "path"
  8569. // ],
  8570. // "parameters": {
  8571. // "path": {
  8572. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  8573. // "location": "path",
  8574. // "required": true,
  8575. // "type": "string"
  8576. // }
  8577. // },
  8578. // "path": "{+path}",
  8579. // "scopes": [
  8580. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8581. // ]
  8582. // }
  8583. }
  8584. // method id "tagmanager.accounts.containers.workspaces.folders.entities":
  8585. type AccountsContainersWorkspacesFoldersEntitiesCall struct {
  8586. s *Service
  8587. path string
  8588. urlParams_ gensupport.URLParams
  8589. ctx_ context.Context
  8590. header_ http.Header
  8591. }
  8592. // Entities: List all entities in a GTM Folder.
  8593. func (r *AccountsContainersWorkspacesFoldersService) Entities(path string) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8594. c := &AccountsContainersWorkspacesFoldersEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8595. c.path = path
  8596. return c
  8597. }
  8598. // PageToken sets the optional parameter "pageToken": Continuation token
  8599. // for fetching the next page of results.
  8600. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) PageToken(pageToken string) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8601. c.urlParams_.Set("pageToken", pageToken)
  8602. return c
  8603. }
  8604. // Fields allows partial responses to be retrieved. See
  8605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8606. // for more information.
  8607. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8609. return c
  8610. }
  8611. // Context sets the context to be used in this call's Do method. Any
  8612. // pending HTTP request will be aborted if the provided context is
  8613. // canceled.
  8614. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8615. c.ctx_ = ctx
  8616. return c
  8617. }
  8618. // Header returns an http.Header that can be modified by the caller to
  8619. // add HTTP headers to the request.
  8620. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Header() http.Header {
  8621. if c.header_ == nil {
  8622. c.header_ = make(http.Header)
  8623. }
  8624. return c.header_
  8625. }
  8626. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) doRequest(alt string) (*http.Response, error) {
  8627. reqHeaders := make(http.Header)
  8628. for k, v := range c.header_ {
  8629. reqHeaders[k] = v
  8630. }
  8631. reqHeaders.Set("User-Agent", c.s.userAgent())
  8632. var body io.Reader = nil
  8633. c.urlParams_.Set("alt", alt)
  8634. c.urlParams_.Set("prettyPrint", "false")
  8635. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:entities")
  8636. urls += "?" + c.urlParams_.Encode()
  8637. req, err := http.NewRequest("POST", urls, body)
  8638. if err != nil {
  8639. return nil, err
  8640. }
  8641. req.Header = reqHeaders
  8642. googleapi.Expand(req.URL, map[string]string{
  8643. "path": c.path,
  8644. })
  8645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8646. }
  8647. // Do executes the "tagmanager.accounts.containers.workspaces.folders.entities" call.
  8648. // Exactly one of *FolderEntities or error will be non-nil. Any non-2xx
  8649. // status code is an error. Response headers are in either
  8650. // *FolderEntities.ServerResponse.Header or (if a response was returned
  8651. // at all) in error.(*googleapi.Error).Header. Use
  8652. // googleapi.IsNotModified to check whether the returned error was
  8653. // because http.StatusNotModified was returned.
  8654. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Do(opts ...googleapi.CallOption) (*FolderEntities, error) {
  8655. gensupport.SetOptions(c.urlParams_, opts...)
  8656. res, err := c.doRequest("json")
  8657. if res != nil && res.StatusCode == http.StatusNotModified {
  8658. if res.Body != nil {
  8659. res.Body.Close()
  8660. }
  8661. return nil, &googleapi.Error{
  8662. Code: res.StatusCode,
  8663. Header: res.Header,
  8664. }
  8665. }
  8666. if err != nil {
  8667. return nil, err
  8668. }
  8669. defer googleapi.CloseBody(res)
  8670. if err := googleapi.CheckResponse(res); err != nil {
  8671. return nil, err
  8672. }
  8673. ret := &FolderEntities{
  8674. ServerResponse: googleapi.ServerResponse{
  8675. Header: res.Header,
  8676. HTTPStatusCode: res.StatusCode,
  8677. },
  8678. }
  8679. target := &ret
  8680. if err := gensupport.DecodeResponse(target, res); err != nil {
  8681. return nil, err
  8682. }
  8683. return ret, nil
  8684. // {
  8685. // "description": "List all entities in a GTM Folder.",
  8686. // "httpMethod": "POST",
  8687. // "id": "tagmanager.accounts.containers.workspaces.folders.entities",
  8688. // "parameterOrder": [
  8689. // "path"
  8690. // ],
  8691. // "parameters": {
  8692. // "pageToken": {
  8693. // "description": "Continuation token for fetching the next page of results.",
  8694. // "location": "query",
  8695. // "type": "string"
  8696. // },
  8697. // "path": {
  8698. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  8699. // "location": "path",
  8700. // "required": true,
  8701. // "type": "string"
  8702. // }
  8703. // },
  8704. // "path": "{+path}:entities",
  8705. // "response": {
  8706. // "$ref": "FolderEntities"
  8707. // },
  8708. // "scopes": [
  8709. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  8710. // "https://www.googleapis.com/auth/tagmanager.readonly"
  8711. // ]
  8712. // }
  8713. }
  8714. // Pages invokes f for each page of results.
  8715. // A non-nil error returned from f will halt the iteration.
  8716. // The provided context supersedes any context provided to the Context method.
  8717. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Pages(ctx context.Context, f func(*FolderEntities) error) error {
  8718. c.ctx_ = ctx
  8719. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8720. for {
  8721. x, err := c.Do()
  8722. if err != nil {
  8723. return err
  8724. }
  8725. if err := f(x); err != nil {
  8726. return err
  8727. }
  8728. if x.NextPageToken == "" {
  8729. return nil
  8730. }
  8731. c.PageToken(x.NextPageToken)
  8732. }
  8733. }
  8734. // method id "tagmanager.accounts.containers.workspaces.folders.get":
  8735. type AccountsContainersWorkspacesFoldersGetCall struct {
  8736. s *Service
  8737. path string
  8738. urlParams_ gensupport.URLParams
  8739. ifNoneMatch_ string
  8740. ctx_ context.Context
  8741. header_ http.Header
  8742. }
  8743. // Get: Gets a GTM Folder.
  8744. func (r *AccountsContainersWorkspacesFoldersService) Get(path string) *AccountsContainersWorkspacesFoldersGetCall {
  8745. c := &AccountsContainersWorkspacesFoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8746. c.path = path
  8747. return c
  8748. }
  8749. // Fields allows partial responses to be retrieved. See
  8750. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8751. // for more information.
  8752. func (c *AccountsContainersWorkspacesFoldersGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersGetCall {
  8753. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8754. return c
  8755. }
  8756. // IfNoneMatch sets the optional parameter which makes the operation
  8757. // fail if the object's ETag matches the given value. This is useful for
  8758. // getting updates only after the object has changed since the last
  8759. // request. Use googleapi.IsNotModified to check whether the response
  8760. // error from Do is the result of In-None-Match.
  8761. func (c *AccountsContainersWorkspacesFoldersGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesFoldersGetCall {
  8762. c.ifNoneMatch_ = entityTag
  8763. return c
  8764. }
  8765. // Context sets the context to be used in this call's Do method. Any
  8766. // pending HTTP request will be aborted if the provided context is
  8767. // canceled.
  8768. func (c *AccountsContainersWorkspacesFoldersGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersGetCall {
  8769. c.ctx_ = ctx
  8770. return c
  8771. }
  8772. // Header returns an http.Header that can be modified by the caller to
  8773. // add HTTP headers to the request.
  8774. func (c *AccountsContainersWorkspacesFoldersGetCall) Header() http.Header {
  8775. if c.header_ == nil {
  8776. c.header_ = make(http.Header)
  8777. }
  8778. return c.header_
  8779. }
  8780. func (c *AccountsContainersWorkspacesFoldersGetCall) doRequest(alt string) (*http.Response, error) {
  8781. reqHeaders := make(http.Header)
  8782. for k, v := range c.header_ {
  8783. reqHeaders[k] = v
  8784. }
  8785. reqHeaders.Set("User-Agent", c.s.userAgent())
  8786. if c.ifNoneMatch_ != "" {
  8787. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8788. }
  8789. var body io.Reader = nil
  8790. c.urlParams_.Set("alt", alt)
  8791. c.urlParams_.Set("prettyPrint", "false")
  8792. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  8793. urls += "?" + c.urlParams_.Encode()
  8794. req, err := http.NewRequest("GET", urls, body)
  8795. if err != nil {
  8796. return nil, err
  8797. }
  8798. req.Header = reqHeaders
  8799. googleapi.Expand(req.URL, map[string]string{
  8800. "path": c.path,
  8801. })
  8802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8803. }
  8804. // Do executes the "tagmanager.accounts.containers.workspaces.folders.get" call.
  8805. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  8806. // code is an error. Response headers are in either
  8807. // *Folder.ServerResponse.Header or (if a response was returned at all)
  8808. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8809. // check whether the returned error was because http.StatusNotModified
  8810. // was returned.
  8811. func (c *AccountsContainersWorkspacesFoldersGetCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  8812. gensupport.SetOptions(c.urlParams_, opts...)
  8813. res, err := c.doRequest("json")
  8814. if res != nil && res.StatusCode == http.StatusNotModified {
  8815. if res.Body != nil {
  8816. res.Body.Close()
  8817. }
  8818. return nil, &googleapi.Error{
  8819. Code: res.StatusCode,
  8820. Header: res.Header,
  8821. }
  8822. }
  8823. if err != nil {
  8824. return nil, err
  8825. }
  8826. defer googleapi.CloseBody(res)
  8827. if err := googleapi.CheckResponse(res); err != nil {
  8828. return nil, err
  8829. }
  8830. ret := &Folder{
  8831. ServerResponse: googleapi.ServerResponse{
  8832. Header: res.Header,
  8833. HTTPStatusCode: res.StatusCode,
  8834. },
  8835. }
  8836. target := &ret
  8837. if err := gensupport.DecodeResponse(target, res); err != nil {
  8838. return nil, err
  8839. }
  8840. return ret, nil
  8841. // {
  8842. // "description": "Gets a GTM Folder.",
  8843. // "httpMethod": "GET",
  8844. // "id": "tagmanager.accounts.containers.workspaces.folders.get",
  8845. // "parameterOrder": [
  8846. // "path"
  8847. // ],
  8848. // "parameters": {
  8849. // "path": {
  8850. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  8851. // "location": "path",
  8852. // "required": true,
  8853. // "type": "string"
  8854. // }
  8855. // },
  8856. // "path": "{+path}",
  8857. // "response": {
  8858. // "$ref": "Folder"
  8859. // },
  8860. // "scopes": [
  8861. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  8862. // "https://www.googleapis.com/auth/tagmanager.readonly"
  8863. // ]
  8864. // }
  8865. }
  8866. // method id "tagmanager.accounts.containers.workspaces.folders.list":
  8867. type AccountsContainersWorkspacesFoldersListCall struct {
  8868. s *Service
  8869. parent string
  8870. urlParams_ gensupport.URLParams
  8871. ifNoneMatch_ string
  8872. ctx_ context.Context
  8873. header_ http.Header
  8874. }
  8875. // List: Lists all GTM Folders of a Container.
  8876. func (r *AccountsContainersWorkspacesFoldersService) List(parent string) *AccountsContainersWorkspacesFoldersListCall {
  8877. c := &AccountsContainersWorkspacesFoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8878. c.parent = parent
  8879. return c
  8880. }
  8881. // PageToken sets the optional parameter "pageToken": Continuation token
  8882. // for fetching the next page of results.
  8883. func (c *AccountsContainersWorkspacesFoldersListCall) PageToken(pageToken string) *AccountsContainersWorkspacesFoldersListCall {
  8884. c.urlParams_.Set("pageToken", pageToken)
  8885. return c
  8886. }
  8887. // Fields allows partial responses to be retrieved. See
  8888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8889. // for more information.
  8890. func (c *AccountsContainersWorkspacesFoldersListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersListCall {
  8891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8892. return c
  8893. }
  8894. // IfNoneMatch sets the optional parameter which makes the operation
  8895. // fail if the object's ETag matches the given value. This is useful for
  8896. // getting updates only after the object has changed since the last
  8897. // request. Use googleapi.IsNotModified to check whether the response
  8898. // error from Do is the result of In-None-Match.
  8899. func (c *AccountsContainersWorkspacesFoldersListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesFoldersListCall {
  8900. c.ifNoneMatch_ = entityTag
  8901. return c
  8902. }
  8903. // Context sets the context to be used in this call's Do method. Any
  8904. // pending HTTP request will be aborted if the provided context is
  8905. // canceled.
  8906. func (c *AccountsContainersWorkspacesFoldersListCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersListCall {
  8907. c.ctx_ = ctx
  8908. return c
  8909. }
  8910. // Header returns an http.Header that can be modified by the caller to
  8911. // add HTTP headers to the request.
  8912. func (c *AccountsContainersWorkspacesFoldersListCall) Header() http.Header {
  8913. if c.header_ == nil {
  8914. c.header_ = make(http.Header)
  8915. }
  8916. return c.header_
  8917. }
  8918. func (c *AccountsContainersWorkspacesFoldersListCall) doRequest(alt string) (*http.Response, error) {
  8919. reqHeaders := make(http.Header)
  8920. for k, v := range c.header_ {
  8921. reqHeaders[k] = v
  8922. }
  8923. reqHeaders.Set("User-Agent", c.s.userAgent())
  8924. if c.ifNoneMatch_ != "" {
  8925. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8926. }
  8927. var body io.Reader = nil
  8928. c.urlParams_.Set("alt", alt)
  8929. c.urlParams_.Set("prettyPrint", "false")
  8930. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/folders")
  8931. urls += "?" + c.urlParams_.Encode()
  8932. req, err := http.NewRequest("GET", urls, body)
  8933. if err != nil {
  8934. return nil, err
  8935. }
  8936. req.Header = reqHeaders
  8937. googleapi.Expand(req.URL, map[string]string{
  8938. "parent": c.parent,
  8939. })
  8940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8941. }
  8942. // Do executes the "tagmanager.accounts.containers.workspaces.folders.list" call.
  8943. // Exactly one of *ListFoldersResponse or error will be non-nil. Any
  8944. // non-2xx status code is an error. Response headers are in either
  8945. // *ListFoldersResponse.ServerResponse.Header or (if a response was
  8946. // returned at all) in error.(*googleapi.Error).Header. Use
  8947. // googleapi.IsNotModified to check whether the returned error was
  8948. // because http.StatusNotModified was returned.
  8949. func (c *AccountsContainersWorkspacesFoldersListCall) Do(opts ...googleapi.CallOption) (*ListFoldersResponse, error) {
  8950. gensupport.SetOptions(c.urlParams_, opts...)
  8951. res, err := c.doRequest("json")
  8952. if res != nil && res.StatusCode == http.StatusNotModified {
  8953. if res.Body != nil {
  8954. res.Body.Close()
  8955. }
  8956. return nil, &googleapi.Error{
  8957. Code: res.StatusCode,
  8958. Header: res.Header,
  8959. }
  8960. }
  8961. if err != nil {
  8962. return nil, err
  8963. }
  8964. defer googleapi.CloseBody(res)
  8965. if err := googleapi.CheckResponse(res); err != nil {
  8966. return nil, err
  8967. }
  8968. ret := &ListFoldersResponse{
  8969. ServerResponse: googleapi.ServerResponse{
  8970. Header: res.Header,
  8971. HTTPStatusCode: res.StatusCode,
  8972. },
  8973. }
  8974. target := &ret
  8975. if err := gensupport.DecodeResponse(target, res); err != nil {
  8976. return nil, err
  8977. }
  8978. return ret, nil
  8979. // {
  8980. // "description": "Lists all GTM Folders of a Container.",
  8981. // "httpMethod": "GET",
  8982. // "id": "tagmanager.accounts.containers.workspaces.folders.list",
  8983. // "parameterOrder": [
  8984. // "parent"
  8985. // ],
  8986. // "parameters": {
  8987. // "pageToken": {
  8988. // "description": "Continuation token for fetching the next page of results.",
  8989. // "location": "query",
  8990. // "type": "string"
  8991. // },
  8992. // "parent": {
  8993. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  8994. // "location": "path",
  8995. // "required": true,
  8996. // "type": "string"
  8997. // }
  8998. // },
  8999. // "path": "{+parent}/folders",
  9000. // "response": {
  9001. // "$ref": "ListFoldersResponse"
  9002. // },
  9003. // "scopes": [
  9004. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  9005. // "https://www.googleapis.com/auth/tagmanager.readonly"
  9006. // ]
  9007. // }
  9008. }
  9009. // Pages invokes f for each page of results.
  9010. // A non-nil error returned from f will halt the iteration.
  9011. // The provided context supersedes any context provided to the Context method.
  9012. func (c *AccountsContainersWorkspacesFoldersListCall) Pages(ctx context.Context, f func(*ListFoldersResponse) error) error {
  9013. c.ctx_ = ctx
  9014. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9015. for {
  9016. x, err := c.Do()
  9017. if err != nil {
  9018. return err
  9019. }
  9020. if err := f(x); err != nil {
  9021. return err
  9022. }
  9023. if x.NextPageToken == "" {
  9024. return nil
  9025. }
  9026. c.PageToken(x.NextPageToken)
  9027. }
  9028. }
  9029. // method id "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder":
  9030. type AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall struct {
  9031. s *Service
  9032. path string
  9033. folder *Folder
  9034. urlParams_ gensupport.URLParams
  9035. ctx_ context.Context
  9036. header_ http.Header
  9037. }
  9038. // MoveEntitiesToFolder: Moves entities to a GTM Folder.
  9039. func (r *AccountsContainersWorkspacesFoldersService) MoveEntitiesToFolder(path string, folder *Folder) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9040. c := &AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9041. c.path = path
  9042. c.folder = folder
  9043. return c
  9044. }
  9045. // TagId sets the optional parameter "tagId": The tags to be moved to
  9046. // the folder.
  9047. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) TagId(tagId ...string) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9048. c.urlParams_.SetMulti("tagId", append([]string{}, tagId...))
  9049. return c
  9050. }
  9051. // TriggerId sets the optional parameter "triggerId": The triggers to be
  9052. // moved to the folder.
  9053. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) TriggerId(triggerId ...string) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9054. c.urlParams_.SetMulti("triggerId", append([]string{}, triggerId...))
  9055. return c
  9056. }
  9057. // VariableId sets the optional parameter "variableId": The variables to
  9058. // be moved to the folder.
  9059. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) VariableId(variableId ...string) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9060. c.urlParams_.SetMulti("variableId", append([]string{}, variableId...))
  9061. return c
  9062. }
  9063. // Fields allows partial responses to be retrieved. See
  9064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9065. // for more information.
  9066. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9068. return c
  9069. }
  9070. // Context sets the context to be used in this call's Do method. Any
  9071. // pending HTTP request will be aborted if the provided context is
  9072. // canceled.
  9073. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9074. c.ctx_ = ctx
  9075. return c
  9076. }
  9077. // Header returns an http.Header that can be modified by the caller to
  9078. // add HTTP headers to the request.
  9079. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Header() http.Header {
  9080. if c.header_ == nil {
  9081. c.header_ = make(http.Header)
  9082. }
  9083. return c.header_
  9084. }
  9085. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) doRequest(alt string) (*http.Response, error) {
  9086. reqHeaders := make(http.Header)
  9087. for k, v := range c.header_ {
  9088. reqHeaders[k] = v
  9089. }
  9090. reqHeaders.Set("User-Agent", c.s.userAgent())
  9091. var body io.Reader = nil
  9092. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  9093. if err != nil {
  9094. return nil, err
  9095. }
  9096. reqHeaders.Set("Content-Type", "application/json")
  9097. c.urlParams_.Set("alt", alt)
  9098. c.urlParams_.Set("prettyPrint", "false")
  9099. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:move_entities_to_folder")
  9100. urls += "?" + c.urlParams_.Encode()
  9101. req, err := http.NewRequest("POST", urls, body)
  9102. if err != nil {
  9103. return nil, err
  9104. }
  9105. req.Header = reqHeaders
  9106. googleapi.Expand(req.URL, map[string]string{
  9107. "path": c.path,
  9108. })
  9109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9110. }
  9111. // Do executes the "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder" call.
  9112. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Do(opts ...googleapi.CallOption) error {
  9113. gensupport.SetOptions(c.urlParams_, opts...)
  9114. res, err := c.doRequest("json")
  9115. if err != nil {
  9116. return err
  9117. }
  9118. defer googleapi.CloseBody(res)
  9119. if err := googleapi.CheckResponse(res); err != nil {
  9120. return err
  9121. }
  9122. return nil
  9123. // {
  9124. // "description": "Moves entities to a GTM Folder.",
  9125. // "httpMethod": "POST",
  9126. // "id": "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder",
  9127. // "parameterOrder": [
  9128. // "path"
  9129. // ],
  9130. // "parameters": {
  9131. // "path": {
  9132. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9133. // "location": "path",
  9134. // "required": true,
  9135. // "type": "string"
  9136. // },
  9137. // "tagId": {
  9138. // "description": "The tags to be moved to the folder.",
  9139. // "location": "query",
  9140. // "repeated": true,
  9141. // "type": "string"
  9142. // },
  9143. // "triggerId": {
  9144. // "description": "The triggers to be moved to the folder.",
  9145. // "location": "query",
  9146. // "repeated": true,
  9147. // "type": "string"
  9148. // },
  9149. // "variableId": {
  9150. // "description": "The variables to be moved to the folder.",
  9151. // "location": "query",
  9152. // "repeated": true,
  9153. // "type": "string"
  9154. // }
  9155. // },
  9156. // "path": "{+path}:move_entities_to_folder",
  9157. // "request": {
  9158. // "$ref": "Folder"
  9159. // },
  9160. // "scopes": [
  9161. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9162. // ]
  9163. // }
  9164. }
  9165. // method id "tagmanager.accounts.containers.workspaces.folders.revert":
  9166. type AccountsContainersWorkspacesFoldersRevertCall struct {
  9167. s *Service
  9168. path string
  9169. urlParams_ gensupport.URLParams
  9170. ctx_ context.Context
  9171. header_ http.Header
  9172. }
  9173. // Revert: Reverts changes to a GTM Folder in a GTM Workspace.
  9174. func (r *AccountsContainersWorkspacesFoldersService) Revert(path string) *AccountsContainersWorkspacesFoldersRevertCall {
  9175. c := &AccountsContainersWorkspacesFoldersRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9176. c.path = path
  9177. return c
  9178. }
  9179. // Fingerprint sets the optional parameter "fingerprint": When provided,
  9180. // this fingerprint must match the fingerprint of the tag in storage.
  9181. func (c *AccountsContainersWorkspacesFoldersRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesFoldersRevertCall {
  9182. c.urlParams_.Set("fingerprint", fingerprint)
  9183. return c
  9184. }
  9185. // Fields allows partial responses to be retrieved. See
  9186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9187. // for more information.
  9188. func (c *AccountsContainersWorkspacesFoldersRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersRevertCall {
  9189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9190. return c
  9191. }
  9192. // Context sets the context to be used in this call's Do method. Any
  9193. // pending HTTP request will be aborted if the provided context is
  9194. // canceled.
  9195. func (c *AccountsContainersWorkspacesFoldersRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersRevertCall {
  9196. c.ctx_ = ctx
  9197. return c
  9198. }
  9199. // Header returns an http.Header that can be modified by the caller to
  9200. // add HTTP headers to the request.
  9201. func (c *AccountsContainersWorkspacesFoldersRevertCall) Header() http.Header {
  9202. if c.header_ == nil {
  9203. c.header_ = make(http.Header)
  9204. }
  9205. return c.header_
  9206. }
  9207. func (c *AccountsContainersWorkspacesFoldersRevertCall) doRequest(alt string) (*http.Response, error) {
  9208. reqHeaders := make(http.Header)
  9209. for k, v := range c.header_ {
  9210. reqHeaders[k] = v
  9211. }
  9212. reqHeaders.Set("User-Agent", c.s.userAgent())
  9213. var body io.Reader = nil
  9214. c.urlParams_.Set("alt", alt)
  9215. c.urlParams_.Set("prettyPrint", "false")
  9216. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  9217. urls += "?" + c.urlParams_.Encode()
  9218. req, err := http.NewRequest("POST", urls, body)
  9219. if err != nil {
  9220. return nil, err
  9221. }
  9222. req.Header = reqHeaders
  9223. googleapi.Expand(req.URL, map[string]string{
  9224. "path": c.path,
  9225. })
  9226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9227. }
  9228. // Do executes the "tagmanager.accounts.containers.workspaces.folders.revert" call.
  9229. // Exactly one of *RevertFolderResponse or error will be non-nil. Any
  9230. // non-2xx status code is an error. Response headers are in either
  9231. // *RevertFolderResponse.ServerResponse.Header or (if a response was
  9232. // returned at all) in error.(*googleapi.Error).Header. Use
  9233. // googleapi.IsNotModified to check whether the returned error was
  9234. // because http.StatusNotModified was returned.
  9235. func (c *AccountsContainersWorkspacesFoldersRevertCall) Do(opts ...googleapi.CallOption) (*RevertFolderResponse, error) {
  9236. gensupport.SetOptions(c.urlParams_, opts...)
  9237. res, err := c.doRequest("json")
  9238. if res != nil && res.StatusCode == http.StatusNotModified {
  9239. if res.Body != nil {
  9240. res.Body.Close()
  9241. }
  9242. return nil, &googleapi.Error{
  9243. Code: res.StatusCode,
  9244. Header: res.Header,
  9245. }
  9246. }
  9247. if err != nil {
  9248. return nil, err
  9249. }
  9250. defer googleapi.CloseBody(res)
  9251. if err := googleapi.CheckResponse(res); err != nil {
  9252. return nil, err
  9253. }
  9254. ret := &RevertFolderResponse{
  9255. ServerResponse: googleapi.ServerResponse{
  9256. Header: res.Header,
  9257. HTTPStatusCode: res.StatusCode,
  9258. },
  9259. }
  9260. target := &ret
  9261. if err := gensupport.DecodeResponse(target, res); err != nil {
  9262. return nil, err
  9263. }
  9264. return ret, nil
  9265. // {
  9266. // "description": "Reverts changes to a GTM Folder in a GTM Workspace.",
  9267. // "httpMethod": "POST",
  9268. // "id": "tagmanager.accounts.containers.workspaces.folders.revert",
  9269. // "parameterOrder": [
  9270. // "path"
  9271. // ],
  9272. // "parameters": {
  9273. // "fingerprint": {
  9274. // "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.",
  9275. // "location": "query",
  9276. // "type": "string"
  9277. // },
  9278. // "path": {
  9279. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9280. // "location": "path",
  9281. // "required": true,
  9282. // "type": "string"
  9283. // }
  9284. // },
  9285. // "path": "{+path}:revert",
  9286. // "response": {
  9287. // "$ref": "RevertFolderResponse"
  9288. // },
  9289. // "scopes": [
  9290. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9291. // ]
  9292. // }
  9293. }
  9294. // method id "tagmanager.accounts.containers.workspaces.folders.update":
  9295. type AccountsContainersWorkspacesFoldersUpdateCall struct {
  9296. s *Service
  9297. path string
  9298. folder *Folder
  9299. urlParams_ gensupport.URLParams
  9300. ctx_ context.Context
  9301. header_ http.Header
  9302. }
  9303. // Update: Updates a GTM Folder.
  9304. func (r *AccountsContainersWorkspacesFoldersService) Update(path string, folder *Folder) *AccountsContainersWorkspacesFoldersUpdateCall {
  9305. c := &AccountsContainersWorkspacesFoldersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9306. c.path = path
  9307. c.folder = folder
  9308. return c
  9309. }
  9310. // Fingerprint sets the optional parameter "fingerprint": When provided,
  9311. // this fingerprint must match the fingerprint of the folder in storage.
  9312. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesFoldersUpdateCall {
  9313. c.urlParams_.Set("fingerprint", fingerprint)
  9314. return c
  9315. }
  9316. // Fields allows partial responses to be retrieved. See
  9317. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9318. // for more information.
  9319. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersUpdateCall {
  9320. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9321. return c
  9322. }
  9323. // Context sets the context to be used in this call's Do method. Any
  9324. // pending HTTP request will be aborted if the provided context is
  9325. // canceled.
  9326. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersUpdateCall {
  9327. c.ctx_ = ctx
  9328. return c
  9329. }
  9330. // Header returns an http.Header that can be modified by the caller to
  9331. // add HTTP headers to the request.
  9332. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Header() http.Header {
  9333. if c.header_ == nil {
  9334. c.header_ = make(http.Header)
  9335. }
  9336. return c.header_
  9337. }
  9338. func (c *AccountsContainersWorkspacesFoldersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9339. reqHeaders := make(http.Header)
  9340. for k, v := range c.header_ {
  9341. reqHeaders[k] = v
  9342. }
  9343. reqHeaders.Set("User-Agent", c.s.userAgent())
  9344. var body io.Reader = nil
  9345. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  9346. if err != nil {
  9347. return nil, err
  9348. }
  9349. reqHeaders.Set("Content-Type", "application/json")
  9350. c.urlParams_.Set("alt", alt)
  9351. c.urlParams_.Set("prettyPrint", "false")
  9352. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  9353. urls += "?" + c.urlParams_.Encode()
  9354. req, err := http.NewRequest("PUT", urls, body)
  9355. if err != nil {
  9356. return nil, err
  9357. }
  9358. req.Header = reqHeaders
  9359. googleapi.Expand(req.URL, map[string]string{
  9360. "path": c.path,
  9361. })
  9362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9363. }
  9364. // Do executes the "tagmanager.accounts.containers.workspaces.folders.update" call.
  9365. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  9366. // code is an error. Response headers are in either
  9367. // *Folder.ServerResponse.Header or (if a response was returned at all)
  9368. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9369. // check whether the returned error was because http.StatusNotModified
  9370. // was returned.
  9371. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  9372. gensupport.SetOptions(c.urlParams_, opts...)
  9373. res, err := c.doRequest("json")
  9374. if res != nil && res.StatusCode == http.StatusNotModified {
  9375. if res.Body != nil {
  9376. res.Body.Close()
  9377. }
  9378. return nil, &googleapi.Error{
  9379. Code: res.StatusCode,
  9380. Header: res.Header,
  9381. }
  9382. }
  9383. if err != nil {
  9384. return nil, err
  9385. }
  9386. defer googleapi.CloseBody(res)
  9387. if err := googleapi.CheckResponse(res); err != nil {
  9388. return nil, err
  9389. }
  9390. ret := &Folder{
  9391. ServerResponse: googleapi.ServerResponse{
  9392. Header: res.Header,
  9393. HTTPStatusCode: res.StatusCode,
  9394. },
  9395. }
  9396. target := &ret
  9397. if err := gensupport.DecodeResponse(target, res); err != nil {
  9398. return nil, err
  9399. }
  9400. return ret, nil
  9401. // {
  9402. // "description": "Updates a GTM Folder.",
  9403. // "httpMethod": "PUT",
  9404. // "id": "tagmanager.accounts.containers.workspaces.folders.update",
  9405. // "parameterOrder": [
  9406. // "path"
  9407. // ],
  9408. // "parameters": {
  9409. // "fingerprint": {
  9410. // "description": "When provided, this fingerprint must match the fingerprint of the folder in storage.",
  9411. // "location": "query",
  9412. // "type": "string"
  9413. // },
  9414. // "path": {
  9415. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9416. // "location": "path",
  9417. // "required": true,
  9418. // "type": "string"
  9419. // }
  9420. // },
  9421. // "path": "{+path}",
  9422. // "request": {
  9423. // "$ref": "Folder"
  9424. // },
  9425. // "response": {
  9426. // "$ref": "Folder"
  9427. // },
  9428. // "scopes": [
  9429. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9430. // ]
  9431. // }
  9432. }
  9433. // method id "tagmanager.accounts.containers.workspaces.tags.create":
  9434. type AccountsContainersWorkspacesTagsCreateCall struct {
  9435. s *Service
  9436. parent string
  9437. tag *Tag
  9438. urlParams_ gensupport.URLParams
  9439. ctx_ context.Context
  9440. header_ http.Header
  9441. }
  9442. // Create: Creates a GTM Tag.
  9443. func (r *AccountsContainersWorkspacesTagsService) Create(parent string, tag *Tag) *AccountsContainersWorkspacesTagsCreateCall {
  9444. c := &AccountsContainersWorkspacesTagsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9445. c.parent = parent
  9446. c.tag = tag
  9447. return c
  9448. }
  9449. // Fields allows partial responses to be retrieved. See
  9450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9451. // for more information.
  9452. func (c *AccountsContainersWorkspacesTagsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsCreateCall {
  9453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9454. return c
  9455. }
  9456. // Context sets the context to be used in this call's Do method. Any
  9457. // pending HTTP request will be aborted if the provided context is
  9458. // canceled.
  9459. func (c *AccountsContainersWorkspacesTagsCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsCreateCall {
  9460. c.ctx_ = ctx
  9461. return c
  9462. }
  9463. // Header returns an http.Header that can be modified by the caller to
  9464. // add HTTP headers to the request.
  9465. func (c *AccountsContainersWorkspacesTagsCreateCall) Header() http.Header {
  9466. if c.header_ == nil {
  9467. c.header_ = make(http.Header)
  9468. }
  9469. return c.header_
  9470. }
  9471. func (c *AccountsContainersWorkspacesTagsCreateCall) doRequest(alt string) (*http.Response, error) {
  9472. reqHeaders := make(http.Header)
  9473. for k, v := range c.header_ {
  9474. reqHeaders[k] = v
  9475. }
  9476. reqHeaders.Set("User-Agent", c.s.userAgent())
  9477. var body io.Reader = nil
  9478. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag)
  9479. if err != nil {
  9480. return nil, err
  9481. }
  9482. reqHeaders.Set("Content-Type", "application/json")
  9483. c.urlParams_.Set("alt", alt)
  9484. c.urlParams_.Set("prettyPrint", "false")
  9485. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/tags")
  9486. urls += "?" + c.urlParams_.Encode()
  9487. req, err := http.NewRequest("POST", urls, body)
  9488. if err != nil {
  9489. return nil, err
  9490. }
  9491. req.Header = reqHeaders
  9492. googleapi.Expand(req.URL, map[string]string{
  9493. "parent": c.parent,
  9494. })
  9495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9496. }
  9497. // Do executes the "tagmanager.accounts.containers.workspaces.tags.create" call.
  9498. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  9499. // is an error. Response headers are in either
  9500. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  9501. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9502. // whether the returned error was because http.StatusNotModified was
  9503. // returned.
  9504. func (c *AccountsContainersWorkspacesTagsCreateCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  9505. gensupport.SetOptions(c.urlParams_, opts...)
  9506. res, err := c.doRequest("json")
  9507. if res != nil && res.StatusCode == http.StatusNotModified {
  9508. if res.Body != nil {
  9509. res.Body.Close()
  9510. }
  9511. return nil, &googleapi.Error{
  9512. Code: res.StatusCode,
  9513. Header: res.Header,
  9514. }
  9515. }
  9516. if err != nil {
  9517. return nil, err
  9518. }
  9519. defer googleapi.CloseBody(res)
  9520. if err := googleapi.CheckResponse(res); err != nil {
  9521. return nil, err
  9522. }
  9523. ret := &Tag{
  9524. ServerResponse: googleapi.ServerResponse{
  9525. Header: res.Header,
  9526. HTTPStatusCode: res.StatusCode,
  9527. },
  9528. }
  9529. target := &ret
  9530. if err := gensupport.DecodeResponse(target, res); err != nil {
  9531. return nil, err
  9532. }
  9533. return ret, nil
  9534. // {
  9535. // "description": "Creates a GTM Tag.",
  9536. // "httpMethod": "POST",
  9537. // "id": "tagmanager.accounts.containers.workspaces.tags.create",
  9538. // "parameterOrder": [
  9539. // "parent"
  9540. // ],
  9541. // "parameters": {
  9542. // "parent": {
  9543. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  9544. // "location": "path",
  9545. // "required": true,
  9546. // "type": "string"
  9547. // }
  9548. // },
  9549. // "path": "{+parent}/tags",
  9550. // "request": {
  9551. // "$ref": "Tag"
  9552. // },
  9553. // "response": {
  9554. // "$ref": "Tag"
  9555. // },
  9556. // "scopes": [
  9557. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9558. // ]
  9559. // }
  9560. }
  9561. // method id "tagmanager.accounts.containers.workspaces.tags.delete":
  9562. type AccountsContainersWorkspacesTagsDeleteCall struct {
  9563. s *Service
  9564. path string
  9565. urlParams_ gensupport.URLParams
  9566. ctx_ context.Context
  9567. header_ http.Header
  9568. }
  9569. // Delete: Deletes a GTM Tag.
  9570. func (r *AccountsContainersWorkspacesTagsService) Delete(path string) *AccountsContainersWorkspacesTagsDeleteCall {
  9571. c := &AccountsContainersWorkspacesTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9572. c.path = path
  9573. return c
  9574. }
  9575. // Fields allows partial responses to be retrieved. See
  9576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9577. // for more information.
  9578. func (c *AccountsContainersWorkspacesTagsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsDeleteCall {
  9579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9580. return c
  9581. }
  9582. // Context sets the context to be used in this call's Do method. Any
  9583. // pending HTTP request will be aborted if the provided context is
  9584. // canceled.
  9585. func (c *AccountsContainersWorkspacesTagsDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsDeleteCall {
  9586. c.ctx_ = ctx
  9587. return c
  9588. }
  9589. // Header returns an http.Header that can be modified by the caller to
  9590. // add HTTP headers to the request.
  9591. func (c *AccountsContainersWorkspacesTagsDeleteCall) Header() http.Header {
  9592. if c.header_ == nil {
  9593. c.header_ = make(http.Header)
  9594. }
  9595. return c.header_
  9596. }
  9597. func (c *AccountsContainersWorkspacesTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9598. reqHeaders := make(http.Header)
  9599. for k, v := range c.header_ {
  9600. reqHeaders[k] = v
  9601. }
  9602. reqHeaders.Set("User-Agent", c.s.userAgent())
  9603. var body io.Reader = nil
  9604. c.urlParams_.Set("alt", alt)
  9605. c.urlParams_.Set("prettyPrint", "false")
  9606. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  9607. urls += "?" + c.urlParams_.Encode()
  9608. req, err := http.NewRequest("DELETE", urls, body)
  9609. if err != nil {
  9610. return nil, err
  9611. }
  9612. req.Header = reqHeaders
  9613. googleapi.Expand(req.URL, map[string]string{
  9614. "path": c.path,
  9615. })
  9616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9617. }
  9618. // Do executes the "tagmanager.accounts.containers.workspaces.tags.delete" call.
  9619. func (c *AccountsContainersWorkspacesTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  9620. gensupport.SetOptions(c.urlParams_, opts...)
  9621. res, err := c.doRequest("json")
  9622. if err != nil {
  9623. return err
  9624. }
  9625. defer googleapi.CloseBody(res)
  9626. if err := googleapi.CheckResponse(res); err != nil {
  9627. return err
  9628. }
  9629. return nil
  9630. // {
  9631. // "description": "Deletes a GTM Tag.",
  9632. // "httpMethod": "DELETE",
  9633. // "id": "tagmanager.accounts.containers.workspaces.tags.delete",
  9634. // "parameterOrder": [
  9635. // "path"
  9636. // ],
  9637. // "parameters": {
  9638. // "path": {
  9639. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  9640. // "location": "path",
  9641. // "required": true,
  9642. // "type": "string"
  9643. // }
  9644. // },
  9645. // "path": "{+path}",
  9646. // "scopes": [
  9647. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9648. // ]
  9649. // }
  9650. }
  9651. // method id "tagmanager.accounts.containers.workspaces.tags.get":
  9652. type AccountsContainersWorkspacesTagsGetCall struct {
  9653. s *Service
  9654. path string
  9655. urlParams_ gensupport.URLParams
  9656. ifNoneMatch_ string
  9657. ctx_ context.Context
  9658. header_ http.Header
  9659. }
  9660. // Get: Gets a GTM Tag.
  9661. func (r *AccountsContainersWorkspacesTagsService) Get(path string) *AccountsContainersWorkspacesTagsGetCall {
  9662. c := &AccountsContainersWorkspacesTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9663. c.path = path
  9664. return c
  9665. }
  9666. // Fields allows partial responses to be retrieved. See
  9667. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9668. // for more information.
  9669. func (c *AccountsContainersWorkspacesTagsGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsGetCall {
  9670. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9671. return c
  9672. }
  9673. // IfNoneMatch sets the optional parameter which makes the operation
  9674. // fail if the object's ETag matches the given value. This is useful for
  9675. // getting updates only after the object has changed since the last
  9676. // request. Use googleapi.IsNotModified to check whether the response
  9677. // error from Do is the result of In-None-Match.
  9678. func (c *AccountsContainersWorkspacesTagsGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTagsGetCall {
  9679. c.ifNoneMatch_ = entityTag
  9680. return c
  9681. }
  9682. // Context sets the context to be used in this call's Do method. Any
  9683. // pending HTTP request will be aborted if the provided context is
  9684. // canceled.
  9685. func (c *AccountsContainersWorkspacesTagsGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsGetCall {
  9686. c.ctx_ = ctx
  9687. return c
  9688. }
  9689. // Header returns an http.Header that can be modified by the caller to
  9690. // add HTTP headers to the request.
  9691. func (c *AccountsContainersWorkspacesTagsGetCall) Header() http.Header {
  9692. if c.header_ == nil {
  9693. c.header_ = make(http.Header)
  9694. }
  9695. return c.header_
  9696. }
  9697. func (c *AccountsContainersWorkspacesTagsGetCall) doRequest(alt string) (*http.Response, error) {
  9698. reqHeaders := make(http.Header)
  9699. for k, v := range c.header_ {
  9700. reqHeaders[k] = v
  9701. }
  9702. reqHeaders.Set("User-Agent", c.s.userAgent())
  9703. if c.ifNoneMatch_ != "" {
  9704. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9705. }
  9706. var body io.Reader = nil
  9707. c.urlParams_.Set("alt", alt)
  9708. c.urlParams_.Set("prettyPrint", "false")
  9709. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  9710. urls += "?" + c.urlParams_.Encode()
  9711. req, err := http.NewRequest("GET", urls, body)
  9712. if err != nil {
  9713. return nil, err
  9714. }
  9715. req.Header = reqHeaders
  9716. googleapi.Expand(req.URL, map[string]string{
  9717. "path": c.path,
  9718. })
  9719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9720. }
  9721. // Do executes the "tagmanager.accounts.containers.workspaces.tags.get" call.
  9722. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  9723. // is an error. Response headers are in either
  9724. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  9725. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9726. // whether the returned error was because http.StatusNotModified was
  9727. // returned.
  9728. func (c *AccountsContainersWorkspacesTagsGetCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  9729. gensupport.SetOptions(c.urlParams_, opts...)
  9730. res, err := c.doRequest("json")
  9731. if res != nil && res.StatusCode == http.StatusNotModified {
  9732. if res.Body != nil {
  9733. res.Body.Close()
  9734. }
  9735. return nil, &googleapi.Error{
  9736. Code: res.StatusCode,
  9737. Header: res.Header,
  9738. }
  9739. }
  9740. if err != nil {
  9741. return nil, err
  9742. }
  9743. defer googleapi.CloseBody(res)
  9744. if err := googleapi.CheckResponse(res); err != nil {
  9745. return nil, err
  9746. }
  9747. ret := &Tag{
  9748. ServerResponse: googleapi.ServerResponse{
  9749. Header: res.Header,
  9750. HTTPStatusCode: res.StatusCode,
  9751. },
  9752. }
  9753. target := &ret
  9754. if err := gensupport.DecodeResponse(target, res); err != nil {
  9755. return nil, err
  9756. }
  9757. return ret, nil
  9758. // {
  9759. // "description": "Gets a GTM Tag.",
  9760. // "httpMethod": "GET",
  9761. // "id": "tagmanager.accounts.containers.workspaces.tags.get",
  9762. // "parameterOrder": [
  9763. // "path"
  9764. // ],
  9765. // "parameters": {
  9766. // "path": {
  9767. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  9768. // "location": "path",
  9769. // "required": true,
  9770. // "type": "string"
  9771. // }
  9772. // },
  9773. // "path": "{+path}",
  9774. // "response": {
  9775. // "$ref": "Tag"
  9776. // },
  9777. // "scopes": [
  9778. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  9779. // "https://www.googleapis.com/auth/tagmanager.readonly"
  9780. // ]
  9781. // }
  9782. }
  9783. // method id "tagmanager.accounts.containers.workspaces.tags.list":
  9784. type AccountsContainersWorkspacesTagsListCall struct {
  9785. s *Service
  9786. parent string
  9787. urlParams_ gensupport.URLParams
  9788. ifNoneMatch_ string
  9789. ctx_ context.Context
  9790. header_ http.Header
  9791. }
  9792. // List: Lists all GTM Tags of a Container.
  9793. func (r *AccountsContainersWorkspacesTagsService) List(parent string) *AccountsContainersWorkspacesTagsListCall {
  9794. c := &AccountsContainersWorkspacesTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9795. c.parent = parent
  9796. return c
  9797. }
  9798. // PageToken sets the optional parameter "pageToken": Continuation token
  9799. // for fetching the next page of results.
  9800. func (c *AccountsContainersWorkspacesTagsListCall) PageToken(pageToken string) *AccountsContainersWorkspacesTagsListCall {
  9801. c.urlParams_.Set("pageToken", pageToken)
  9802. return c
  9803. }
  9804. // Fields allows partial responses to be retrieved. See
  9805. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9806. // for more information.
  9807. func (c *AccountsContainersWorkspacesTagsListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsListCall {
  9808. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9809. return c
  9810. }
  9811. // IfNoneMatch sets the optional parameter which makes the operation
  9812. // fail if the object's ETag matches the given value. This is useful for
  9813. // getting updates only after the object has changed since the last
  9814. // request. Use googleapi.IsNotModified to check whether the response
  9815. // error from Do is the result of In-None-Match.
  9816. func (c *AccountsContainersWorkspacesTagsListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTagsListCall {
  9817. c.ifNoneMatch_ = entityTag
  9818. return c
  9819. }
  9820. // Context sets the context to be used in this call's Do method. Any
  9821. // pending HTTP request will be aborted if the provided context is
  9822. // canceled.
  9823. func (c *AccountsContainersWorkspacesTagsListCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsListCall {
  9824. c.ctx_ = ctx
  9825. return c
  9826. }
  9827. // Header returns an http.Header that can be modified by the caller to
  9828. // add HTTP headers to the request.
  9829. func (c *AccountsContainersWorkspacesTagsListCall) Header() http.Header {
  9830. if c.header_ == nil {
  9831. c.header_ = make(http.Header)
  9832. }
  9833. return c.header_
  9834. }
  9835. func (c *AccountsContainersWorkspacesTagsListCall) doRequest(alt string) (*http.Response, error) {
  9836. reqHeaders := make(http.Header)
  9837. for k, v := range c.header_ {
  9838. reqHeaders[k] = v
  9839. }
  9840. reqHeaders.Set("User-Agent", c.s.userAgent())
  9841. if c.ifNoneMatch_ != "" {
  9842. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9843. }
  9844. var body io.Reader = nil
  9845. c.urlParams_.Set("alt", alt)
  9846. c.urlParams_.Set("prettyPrint", "false")
  9847. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/tags")
  9848. urls += "?" + c.urlParams_.Encode()
  9849. req, err := http.NewRequest("GET", urls, body)
  9850. if err != nil {
  9851. return nil, err
  9852. }
  9853. req.Header = reqHeaders
  9854. googleapi.Expand(req.URL, map[string]string{
  9855. "parent": c.parent,
  9856. })
  9857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9858. }
  9859. // Do executes the "tagmanager.accounts.containers.workspaces.tags.list" call.
  9860. // Exactly one of *ListTagsResponse or error will be non-nil. Any
  9861. // non-2xx status code is an error. Response headers are in either
  9862. // *ListTagsResponse.ServerResponse.Header or (if a response was
  9863. // returned at all) in error.(*googleapi.Error).Header. Use
  9864. // googleapi.IsNotModified to check whether the returned error was
  9865. // because http.StatusNotModified was returned.
  9866. func (c *AccountsContainersWorkspacesTagsListCall) Do(opts ...googleapi.CallOption) (*ListTagsResponse, error) {
  9867. gensupport.SetOptions(c.urlParams_, opts...)
  9868. res, err := c.doRequest("json")
  9869. if res != nil && res.StatusCode == http.StatusNotModified {
  9870. if res.Body != nil {
  9871. res.Body.Close()
  9872. }
  9873. return nil, &googleapi.Error{
  9874. Code: res.StatusCode,
  9875. Header: res.Header,
  9876. }
  9877. }
  9878. if err != nil {
  9879. return nil, err
  9880. }
  9881. defer googleapi.CloseBody(res)
  9882. if err := googleapi.CheckResponse(res); err != nil {
  9883. return nil, err
  9884. }
  9885. ret := &ListTagsResponse{
  9886. ServerResponse: googleapi.ServerResponse{
  9887. Header: res.Header,
  9888. HTTPStatusCode: res.StatusCode,
  9889. },
  9890. }
  9891. target := &ret
  9892. if err := gensupport.DecodeResponse(target, res); err != nil {
  9893. return nil, err
  9894. }
  9895. return ret, nil
  9896. // {
  9897. // "description": "Lists all GTM Tags of a Container.",
  9898. // "httpMethod": "GET",
  9899. // "id": "tagmanager.accounts.containers.workspaces.tags.list",
  9900. // "parameterOrder": [
  9901. // "parent"
  9902. // ],
  9903. // "parameters": {
  9904. // "pageToken": {
  9905. // "description": "Continuation token for fetching the next page of results.",
  9906. // "location": "query",
  9907. // "type": "string"
  9908. // },
  9909. // "parent": {
  9910. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  9911. // "location": "path",
  9912. // "required": true,
  9913. // "type": "string"
  9914. // }
  9915. // },
  9916. // "path": "{+parent}/tags",
  9917. // "response": {
  9918. // "$ref": "ListTagsResponse"
  9919. // },
  9920. // "scopes": [
  9921. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  9922. // "https://www.googleapis.com/auth/tagmanager.readonly"
  9923. // ]
  9924. // }
  9925. }
  9926. // Pages invokes f for each page of results.
  9927. // A non-nil error returned from f will halt the iteration.
  9928. // The provided context supersedes any context provided to the Context method.
  9929. func (c *AccountsContainersWorkspacesTagsListCall) Pages(ctx context.Context, f func(*ListTagsResponse) error) error {
  9930. c.ctx_ = ctx
  9931. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9932. for {
  9933. x, err := c.Do()
  9934. if err != nil {
  9935. return err
  9936. }
  9937. if err := f(x); err != nil {
  9938. return err
  9939. }
  9940. if x.NextPageToken == "" {
  9941. return nil
  9942. }
  9943. c.PageToken(x.NextPageToken)
  9944. }
  9945. }
  9946. // method id "tagmanager.accounts.containers.workspaces.tags.revert":
  9947. type AccountsContainersWorkspacesTagsRevertCall struct {
  9948. s *Service
  9949. path string
  9950. urlParams_ gensupport.URLParams
  9951. ctx_ context.Context
  9952. header_ http.Header
  9953. }
  9954. // Revert: Reverts changes to a GTM Tag in a GTM Workspace.
  9955. func (r *AccountsContainersWorkspacesTagsService) Revert(path string) *AccountsContainersWorkspacesTagsRevertCall {
  9956. c := &AccountsContainersWorkspacesTagsRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9957. c.path = path
  9958. return c
  9959. }
  9960. // Fingerprint sets the optional parameter "fingerprint": When provided,
  9961. // this fingerprint must match the fingerprint of thetag in storage.
  9962. func (c *AccountsContainersWorkspacesTagsRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTagsRevertCall {
  9963. c.urlParams_.Set("fingerprint", fingerprint)
  9964. return c
  9965. }
  9966. // Fields allows partial responses to be retrieved. See
  9967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9968. // for more information.
  9969. func (c *AccountsContainersWorkspacesTagsRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsRevertCall {
  9970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9971. return c
  9972. }
  9973. // Context sets the context to be used in this call's Do method. Any
  9974. // pending HTTP request will be aborted if the provided context is
  9975. // canceled.
  9976. func (c *AccountsContainersWorkspacesTagsRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsRevertCall {
  9977. c.ctx_ = ctx
  9978. return c
  9979. }
  9980. // Header returns an http.Header that can be modified by the caller to
  9981. // add HTTP headers to the request.
  9982. func (c *AccountsContainersWorkspacesTagsRevertCall) Header() http.Header {
  9983. if c.header_ == nil {
  9984. c.header_ = make(http.Header)
  9985. }
  9986. return c.header_
  9987. }
  9988. func (c *AccountsContainersWorkspacesTagsRevertCall) doRequest(alt string) (*http.Response, error) {
  9989. reqHeaders := make(http.Header)
  9990. for k, v := range c.header_ {
  9991. reqHeaders[k] = v
  9992. }
  9993. reqHeaders.Set("User-Agent", c.s.userAgent())
  9994. var body io.Reader = nil
  9995. c.urlParams_.Set("alt", alt)
  9996. c.urlParams_.Set("prettyPrint", "false")
  9997. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  9998. urls += "?" + c.urlParams_.Encode()
  9999. req, err := http.NewRequest("POST", urls, body)
  10000. if err != nil {
  10001. return nil, err
  10002. }
  10003. req.Header = reqHeaders
  10004. googleapi.Expand(req.URL, map[string]string{
  10005. "path": c.path,
  10006. })
  10007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10008. }
  10009. // Do executes the "tagmanager.accounts.containers.workspaces.tags.revert" call.
  10010. // Exactly one of *RevertTagResponse or error will be non-nil. Any
  10011. // non-2xx status code is an error. Response headers are in either
  10012. // *RevertTagResponse.ServerResponse.Header or (if a response was
  10013. // returned at all) in error.(*googleapi.Error).Header. Use
  10014. // googleapi.IsNotModified to check whether the returned error was
  10015. // because http.StatusNotModified was returned.
  10016. func (c *AccountsContainersWorkspacesTagsRevertCall) Do(opts ...googleapi.CallOption) (*RevertTagResponse, error) {
  10017. gensupport.SetOptions(c.urlParams_, opts...)
  10018. res, err := c.doRequest("json")
  10019. if res != nil && res.StatusCode == http.StatusNotModified {
  10020. if res.Body != nil {
  10021. res.Body.Close()
  10022. }
  10023. return nil, &googleapi.Error{
  10024. Code: res.StatusCode,
  10025. Header: res.Header,
  10026. }
  10027. }
  10028. if err != nil {
  10029. return nil, err
  10030. }
  10031. defer googleapi.CloseBody(res)
  10032. if err := googleapi.CheckResponse(res); err != nil {
  10033. return nil, err
  10034. }
  10035. ret := &RevertTagResponse{
  10036. ServerResponse: googleapi.ServerResponse{
  10037. Header: res.Header,
  10038. HTTPStatusCode: res.StatusCode,
  10039. },
  10040. }
  10041. target := &ret
  10042. if err := gensupport.DecodeResponse(target, res); err != nil {
  10043. return nil, err
  10044. }
  10045. return ret, nil
  10046. // {
  10047. // "description": "Reverts changes to a GTM Tag in a GTM Workspace.",
  10048. // "httpMethod": "POST",
  10049. // "id": "tagmanager.accounts.containers.workspaces.tags.revert",
  10050. // "parameterOrder": [
  10051. // "path"
  10052. // ],
  10053. // "parameters": {
  10054. // "fingerprint": {
  10055. // "description": "When provided, this fingerprint must match the fingerprint of thetag in storage.",
  10056. // "location": "query",
  10057. // "type": "string"
  10058. // },
  10059. // "path": {
  10060. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  10061. // "location": "path",
  10062. // "required": true,
  10063. // "type": "string"
  10064. // }
  10065. // },
  10066. // "path": "{+path}:revert",
  10067. // "response": {
  10068. // "$ref": "RevertTagResponse"
  10069. // },
  10070. // "scopes": [
  10071. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10072. // ]
  10073. // }
  10074. }
  10075. // method id "tagmanager.accounts.containers.workspaces.tags.update":
  10076. type AccountsContainersWorkspacesTagsUpdateCall struct {
  10077. s *Service
  10078. path string
  10079. tag *Tag
  10080. urlParams_ gensupport.URLParams
  10081. ctx_ context.Context
  10082. header_ http.Header
  10083. }
  10084. // Update: Updates a GTM Tag.
  10085. func (r *AccountsContainersWorkspacesTagsService) Update(path string, tag *Tag) *AccountsContainersWorkspacesTagsUpdateCall {
  10086. c := &AccountsContainersWorkspacesTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10087. c.path = path
  10088. c.tag = tag
  10089. return c
  10090. }
  10091. // Fingerprint sets the optional parameter "fingerprint": When provided,
  10092. // this fingerprint must match the fingerprint of the tag in storage.
  10093. func (c *AccountsContainersWorkspacesTagsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTagsUpdateCall {
  10094. c.urlParams_.Set("fingerprint", fingerprint)
  10095. return c
  10096. }
  10097. // Fields allows partial responses to be retrieved. See
  10098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10099. // for more information.
  10100. func (c *AccountsContainersWorkspacesTagsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsUpdateCall {
  10101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10102. return c
  10103. }
  10104. // Context sets the context to be used in this call's Do method. Any
  10105. // pending HTTP request will be aborted if the provided context is
  10106. // canceled.
  10107. func (c *AccountsContainersWorkspacesTagsUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsUpdateCall {
  10108. c.ctx_ = ctx
  10109. return c
  10110. }
  10111. // Header returns an http.Header that can be modified by the caller to
  10112. // add HTTP headers to the request.
  10113. func (c *AccountsContainersWorkspacesTagsUpdateCall) Header() http.Header {
  10114. if c.header_ == nil {
  10115. c.header_ = make(http.Header)
  10116. }
  10117. return c.header_
  10118. }
  10119. func (c *AccountsContainersWorkspacesTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10120. reqHeaders := make(http.Header)
  10121. for k, v := range c.header_ {
  10122. reqHeaders[k] = v
  10123. }
  10124. reqHeaders.Set("User-Agent", c.s.userAgent())
  10125. var body io.Reader = nil
  10126. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag)
  10127. if err != nil {
  10128. return nil, err
  10129. }
  10130. reqHeaders.Set("Content-Type", "application/json")
  10131. c.urlParams_.Set("alt", alt)
  10132. c.urlParams_.Set("prettyPrint", "false")
  10133. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10134. urls += "?" + c.urlParams_.Encode()
  10135. req, err := http.NewRequest("PUT", urls, body)
  10136. if err != nil {
  10137. return nil, err
  10138. }
  10139. req.Header = reqHeaders
  10140. googleapi.Expand(req.URL, map[string]string{
  10141. "path": c.path,
  10142. })
  10143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10144. }
  10145. // Do executes the "tagmanager.accounts.containers.workspaces.tags.update" call.
  10146. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  10147. // is an error. Response headers are in either
  10148. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  10149. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10150. // whether the returned error was because http.StatusNotModified was
  10151. // returned.
  10152. func (c *AccountsContainersWorkspacesTagsUpdateCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  10153. gensupport.SetOptions(c.urlParams_, opts...)
  10154. res, err := c.doRequest("json")
  10155. if res != nil && res.StatusCode == http.StatusNotModified {
  10156. if res.Body != nil {
  10157. res.Body.Close()
  10158. }
  10159. return nil, &googleapi.Error{
  10160. Code: res.StatusCode,
  10161. Header: res.Header,
  10162. }
  10163. }
  10164. if err != nil {
  10165. return nil, err
  10166. }
  10167. defer googleapi.CloseBody(res)
  10168. if err := googleapi.CheckResponse(res); err != nil {
  10169. return nil, err
  10170. }
  10171. ret := &Tag{
  10172. ServerResponse: googleapi.ServerResponse{
  10173. Header: res.Header,
  10174. HTTPStatusCode: res.StatusCode,
  10175. },
  10176. }
  10177. target := &ret
  10178. if err := gensupport.DecodeResponse(target, res); err != nil {
  10179. return nil, err
  10180. }
  10181. return ret, nil
  10182. // {
  10183. // "description": "Updates a GTM Tag.",
  10184. // "httpMethod": "PUT",
  10185. // "id": "tagmanager.accounts.containers.workspaces.tags.update",
  10186. // "parameterOrder": [
  10187. // "path"
  10188. // ],
  10189. // "parameters": {
  10190. // "fingerprint": {
  10191. // "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.",
  10192. // "location": "query",
  10193. // "type": "string"
  10194. // },
  10195. // "path": {
  10196. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  10197. // "location": "path",
  10198. // "required": true,
  10199. // "type": "string"
  10200. // }
  10201. // },
  10202. // "path": "{+path}",
  10203. // "request": {
  10204. // "$ref": "Tag"
  10205. // },
  10206. // "response": {
  10207. // "$ref": "Tag"
  10208. // },
  10209. // "scopes": [
  10210. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10211. // ]
  10212. // }
  10213. }
  10214. // method id "tagmanager.accounts.containers.workspaces.triggers.create":
  10215. type AccountsContainersWorkspacesTriggersCreateCall struct {
  10216. s *Service
  10217. parent string
  10218. trigger *Trigger
  10219. urlParams_ gensupport.URLParams
  10220. ctx_ context.Context
  10221. header_ http.Header
  10222. }
  10223. // Create: Creates a GTM Trigger.
  10224. func (r *AccountsContainersWorkspacesTriggersService) Create(parent string, trigger *Trigger) *AccountsContainersWorkspacesTriggersCreateCall {
  10225. c := &AccountsContainersWorkspacesTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10226. c.parent = parent
  10227. c.trigger = trigger
  10228. return c
  10229. }
  10230. // Fields allows partial responses to be retrieved. See
  10231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10232. // for more information.
  10233. func (c *AccountsContainersWorkspacesTriggersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersCreateCall {
  10234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10235. return c
  10236. }
  10237. // Context sets the context to be used in this call's Do method. Any
  10238. // pending HTTP request will be aborted if the provided context is
  10239. // canceled.
  10240. func (c *AccountsContainersWorkspacesTriggersCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersCreateCall {
  10241. c.ctx_ = ctx
  10242. return c
  10243. }
  10244. // Header returns an http.Header that can be modified by the caller to
  10245. // add HTTP headers to the request.
  10246. func (c *AccountsContainersWorkspacesTriggersCreateCall) Header() http.Header {
  10247. if c.header_ == nil {
  10248. c.header_ = make(http.Header)
  10249. }
  10250. return c.header_
  10251. }
  10252. func (c *AccountsContainersWorkspacesTriggersCreateCall) doRequest(alt string) (*http.Response, error) {
  10253. reqHeaders := make(http.Header)
  10254. for k, v := range c.header_ {
  10255. reqHeaders[k] = v
  10256. }
  10257. reqHeaders.Set("User-Agent", c.s.userAgent())
  10258. var body io.Reader = nil
  10259. body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  10260. if err != nil {
  10261. return nil, err
  10262. }
  10263. reqHeaders.Set("Content-Type", "application/json")
  10264. c.urlParams_.Set("alt", alt)
  10265. c.urlParams_.Set("prettyPrint", "false")
  10266. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/triggers")
  10267. urls += "?" + c.urlParams_.Encode()
  10268. req, err := http.NewRequest("POST", urls, body)
  10269. if err != nil {
  10270. return nil, err
  10271. }
  10272. req.Header = reqHeaders
  10273. googleapi.Expand(req.URL, map[string]string{
  10274. "parent": c.parent,
  10275. })
  10276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10277. }
  10278. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.create" call.
  10279. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  10280. // code is an error. Response headers are in either
  10281. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  10282. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10283. // check whether the returned error was because http.StatusNotModified
  10284. // was returned.
  10285. func (c *AccountsContainersWorkspacesTriggersCreateCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  10286. gensupport.SetOptions(c.urlParams_, opts...)
  10287. res, err := c.doRequest("json")
  10288. if res != nil && res.StatusCode == http.StatusNotModified {
  10289. if res.Body != nil {
  10290. res.Body.Close()
  10291. }
  10292. return nil, &googleapi.Error{
  10293. Code: res.StatusCode,
  10294. Header: res.Header,
  10295. }
  10296. }
  10297. if err != nil {
  10298. return nil, err
  10299. }
  10300. defer googleapi.CloseBody(res)
  10301. if err := googleapi.CheckResponse(res); err != nil {
  10302. return nil, err
  10303. }
  10304. ret := &Trigger{
  10305. ServerResponse: googleapi.ServerResponse{
  10306. Header: res.Header,
  10307. HTTPStatusCode: res.StatusCode,
  10308. },
  10309. }
  10310. target := &ret
  10311. if err := gensupport.DecodeResponse(target, res); err != nil {
  10312. return nil, err
  10313. }
  10314. return ret, nil
  10315. // {
  10316. // "description": "Creates a GTM Trigger.",
  10317. // "httpMethod": "POST",
  10318. // "id": "tagmanager.accounts.containers.workspaces.triggers.create",
  10319. // "parameterOrder": [
  10320. // "parent"
  10321. // ],
  10322. // "parameters": {
  10323. // "parent": {
  10324. // "description": "GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  10325. // "location": "path",
  10326. // "required": true,
  10327. // "type": "string"
  10328. // }
  10329. // },
  10330. // "path": "{+parent}/triggers",
  10331. // "request": {
  10332. // "$ref": "Trigger"
  10333. // },
  10334. // "response": {
  10335. // "$ref": "Trigger"
  10336. // },
  10337. // "scopes": [
  10338. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10339. // ]
  10340. // }
  10341. }
  10342. // method id "tagmanager.accounts.containers.workspaces.triggers.delete":
  10343. type AccountsContainersWorkspacesTriggersDeleteCall struct {
  10344. s *Service
  10345. path string
  10346. urlParams_ gensupport.URLParams
  10347. ctx_ context.Context
  10348. header_ http.Header
  10349. }
  10350. // Delete: Deletes a GTM Trigger.
  10351. func (r *AccountsContainersWorkspacesTriggersService) Delete(path string) *AccountsContainersWorkspacesTriggersDeleteCall {
  10352. c := &AccountsContainersWorkspacesTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10353. c.path = path
  10354. return c
  10355. }
  10356. // Fields allows partial responses to be retrieved. See
  10357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10358. // for more information.
  10359. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersDeleteCall {
  10360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10361. return c
  10362. }
  10363. // Context sets the context to be used in this call's Do method. Any
  10364. // pending HTTP request will be aborted if the provided context is
  10365. // canceled.
  10366. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersDeleteCall {
  10367. c.ctx_ = ctx
  10368. return c
  10369. }
  10370. // Header returns an http.Header that can be modified by the caller to
  10371. // add HTTP headers to the request.
  10372. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Header() http.Header {
  10373. if c.header_ == nil {
  10374. c.header_ = make(http.Header)
  10375. }
  10376. return c.header_
  10377. }
  10378. func (c *AccountsContainersWorkspacesTriggersDeleteCall) doRequest(alt string) (*http.Response, error) {
  10379. reqHeaders := make(http.Header)
  10380. for k, v := range c.header_ {
  10381. reqHeaders[k] = v
  10382. }
  10383. reqHeaders.Set("User-Agent", c.s.userAgent())
  10384. var body io.Reader = nil
  10385. c.urlParams_.Set("alt", alt)
  10386. c.urlParams_.Set("prettyPrint", "false")
  10387. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10388. urls += "?" + c.urlParams_.Encode()
  10389. req, err := http.NewRequest("DELETE", urls, body)
  10390. if err != nil {
  10391. return nil, err
  10392. }
  10393. req.Header = reqHeaders
  10394. googleapi.Expand(req.URL, map[string]string{
  10395. "path": c.path,
  10396. })
  10397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10398. }
  10399. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.delete" call.
  10400. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Do(opts ...googleapi.CallOption) error {
  10401. gensupport.SetOptions(c.urlParams_, opts...)
  10402. res, err := c.doRequest("json")
  10403. if err != nil {
  10404. return err
  10405. }
  10406. defer googleapi.CloseBody(res)
  10407. if err := googleapi.CheckResponse(res); err != nil {
  10408. return err
  10409. }
  10410. return nil
  10411. // {
  10412. // "description": "Deletes a GTM Trigger.",
  10413. // "httpMethod": "DELETE",
  10414. // "id": "tagmanager.accounts.containers.workspaces.triggers.delete",
  10415. // "parameterOrder": [
  10416. // "path"
  10417. // ],
  10418. // "parameters": {
  10419. // "path": {
  10420. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  10421. // "location": "path",
  10422. // "required": true,
  10423. // "type": "string"
  10424. // }
  10425. // },
  10426. // "path": "{+path}",
  10427. // "scopes": [
  10428. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10429. // ]
  10430. // }
  10431. }
  10432. // method id "tagmanager.accounts.containers.workspaces.triggers.get":
  10433. type AccountsContainersWorkspacesTriggersGetCall struct {
  10434. s *Service
  10435. path string
  10436. urlParams_ gensupport.URLParams
  10437. ifNoneMatch_ string
  10438. ctx_ context.Context
  10439. header_ http.Header
  10440. }
  10441. // Get: Gets a GTM Trigger.
  10442. func (r *AccountsContainersWorkspacesTriggersService) Get(path string) *AccountsContainersWorkspacesTriggersGetCall {
  10443. c := &AccountsContainersWorkspacesTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10444. c.path = path
  10445. return c
  10446. }
  10447. // Fields allows partial responses to be retrieved. See
  10448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10449. // for more information.
  10450. func (c *AccountsContainersWorkspacesTriggersGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersGetCall {
  10451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10452. return c
  10453. }
  10454. // IfNoneMatch sets the optional parameter which makes the operation
  10455. // fail if the object's ETag matches the given value. This is useful for
  10456. // getting updates only after the object has changed since the last
  10457. // request. Use googleapi.IsNotModified to check whether the response
  10458. // error from Do is the result of In-None-Match.
  10459. func (c *AccountsContainersWorkspacesTriggersGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTriggersGetCall {
  10460. c.ifNoneMatch_ = entityTag
  10461. return c
  10462. }
  10463. // Context sets the context to be used in this call's Do method. Any
  10464. // pending HTTP request will be aborted if the provided context is
  10465. // canceled.
  10466. func (c *AccountsContainersWorkspacesTriggersGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersGetCall {
  10467. c.ctx_ = ctx
  10468. return c
  10469. }
  10470. // Header returns an http.Header that can be modified by the caller to
  10471. // add HTTP headers to the request.
  10472. func (c *AccountsContainersWorkspacesTriggersGetCall) Header() http.Header {
  10473. if c.header_ == nil {
  10474. c.header_ = make(http.Header)
  10475. }
  10476. return c.header_
  10477. }
  10478. func (c *AccountsContainersWorkspacesTriggersGetCall) doRequest(alt string) (*http.Response, error) {
  10479. reqHeaders := make(http.Header)
  10480. for k, v := range c.header_ {
  10481. reqHeaders[k] = v
  10482. }
  10483. reqHeaders.Set("User-Agent", c.s.userAgent())
  10484. if c.ifNoneMatch_ != "" {
  10485. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10486. }
  10487. var body io.Reader = nil
  10488. c.urlParams_.Set("alt", alt)
  10489. c.urlParams_.Set("prettyPrint", "false")
  10490. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10491. urls += "?" + c.urlParams_.Encode()
  10492. req, err := http.NewRequest("GET", urls, body)
  10493. if err != nil {
  10494. return nil, err
  10495. }
  10496. req.Header = reqHeaders
  10497. googleapi.Expand(req.URL, map[string]string{
  10498. "path": c.path,
  10499. })
  10500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10501. }
  10502. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.get" call.
  10503. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  10504. // code is an error. Response headers are in either
  10505. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  10506. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10507. // check whether the returned error was because http.StatusNotModified
  10508. // was returned.
  10509. func (c *AccountsContainersWorkspacesTriggersGetCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  10510. gensupport.SetOptions(c.urlParams_, opts...)
  10511. res, err := c.doRequest("json")
  10512. if res != nil && res.StatusCode == http.StatusNotModified {
  10513. if res.Body != nil {
  10514. res.Body.Close()
  10515. }
  10516. return nil, &googleapi.Error{
  10517. Code: res.StatusCode,
  10518. Header: res.Header,
  10519. }
  10520. }
  10521. if err != nil {
  10522. return nil, err
  10523. }
  10524. defer googleapi.CloseBody(res)
  10525. if err := googleapi.CheckResponse(res); err != nil {
  10526. return nil, err
  10527. }
  10528. ret := &Trigger{
  10529. ServerResponse: googleapi.ServerResponse{
  10530. Header: res.Header,
  10531. HTTPStatusCode: res.StatusCode,
  10532. },
  10533. }
  10534. target := &ret
  10535. if err := gensupport.DecodeResponse(target, res); err != nil {
  10536. return nil, err
  10537. }
  10538. return ret, nil
  10539. // {
  10540. // "description": "Gets a GTM Trigger.",
  10541. // "httpMethod": "GET",
  10542. // "id": "tagmanager.accounts.containers.workspaces.triggers.get",
  10543. // "parameterOrder": [
  10544. // "path"
  10545. // ],
  10546. // "parameters": {
  10547. // "path": {
  10548. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  10549. // "location": "path",
  10550. // "required": true,
  10551. // "type": "string"
  10552. // }
  10553. // },
  10554. // "path": "{+path}",
  10555. // "response": {
  10556. // "$ref": "Trigger"
  10557. // },
  10558. // "scopes": [
  10559. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  10560. // "https://www.googleapis.com/auth/tagmanager.readonly"
  10561. // ]
  10562. // }
  10563. }
  10564. // method id "tagmanager.accounts.containers.workspaces.triggers.list":
  10565. type AccountsContainersWorkspacesTriggersListCall struct {
  10566. s *Service
  10567. parent string
  10568. urlParams_ gensupport.URLParams
  10569. ifNoneMatch_ string
  10570. ctx_ context.Context
  10571. header_ http.Header
  10572. }
  10573. // List: Lists all GTM Triggers of a Container.
  10574. func (r *AccountsContainersWorkspacesTriggersService) List(parent string) *AccountsContainersWorkspacesTriggersListCall {
  10575. c := &AccountsContainersWorkspacesTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10576. c.parent = parent
  10577. return c
  10578. }
  10579. // PageToken sets the optional parameter "pageToken": Continuation token
  10580. // for fetching the next page of results.
  10581. func (c *AccountsContainersWorkspacesTriggersListCall) PageToken(pageToken string) *AccountsContainersWorkspacesTriggersListCall {
  10582. c.urlParams_.Set("pageToken", pageToken)
  10583. return c
  10584. }
  10585. // Fields allows partial responses to be retrieved. See
  10586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10587. // for more information.
  10588. func (c *AccountsContainersWorkspacesTriggersListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersListCall {
  10589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10590. return c
  10591. }
  10592. // IfNoneMatch sets the optional parameter which makes the operation
  10593. // fail if the object's ETag matches the given value. This is useful for
  10594. // getting updates only after the object has changed since the last
  10595. // request. Use googleapi.IsNotModified to check whether the response
  10596. // error from Do is the result of In-None-Match.
  10597. func (c *AccountsContainersWorkspacesTriggersListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTriggersListCall {
  10598. c.ifNoneMatch_ = entityTag
  10599. return c
  10600. }
  10601. // Context sets the context to be used in this call's Do method. Any
  10602. // pending HTTP request will be aborted if the provided context is
  10603. // canceled.
  10604. func (c *AccountsContainersWorkspacesTriggersListCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersListCall {
  10605. c.ctx_ = ctx
  10606. return c
  10607. }
  10608. // Header returns an http.Header that can be modified by the caller to
  10609. // add HTTP headers to the request.
  10610. func (c *AccountsContainersWorkspacesTriggersListCall) Header() http.Header {
  10611. if c.header_ == nil {
  10612. c.header_ = make(http.Header)
  10613. }
  10614. return c.header_
  10615. }
  10616. func (c *AccountsContainersWorkspacesTriggersListCall) doRequest(alt string) (*http.Response, error) {
  10617. reqHeaders := make(http.Header)
  10618. for k, v := range c.header_ {
  10619. reqHeaders[k] = v
  10620. }
  10621. reqHeaders.Set("User-Agent", c.s.userAgent())
  10622. if c.ifNoneMatch_ != "" {
  10623. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10624. }
  10625. var body io.Reader = nil
  10626. c.urlParams_.Set("alt", alt)
  10627. c.urlParams_.Set("prettyPrint", "false")
  10628. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/triggers")
  10629. urls += "?" + c.urlParams_.Encode()
  10630. req, err := http.NewRequest("GET", urls, body)
  10631. if err != nil {
  10632. return nil, err
  10633. }
  10634. req.Header = reqHeaders
  10635. googleapi.Expand(req.URL, map[string]string{
  10636. "parent": c.parent,
  10637. })
  10638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10639. }
  10640. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.list" call.
  10641. // Exactly one of *ListTriggersResponse or error will be non-nil. Any
  10642. // non-2xx status code is an error. Response headers are in either
  10643. // *ListTriggersResponse.ServerResponse.Header or (if a response was
  10644. // returned at all) in error.(*googleapi.Error).Header. Use
  10645. // googleapi.IsNotModified to check whether the returned error was
  10646. // because http.StatusNotModified was returned.
  10647. func (c *AccountsContainersWorkspacesTriggersListCall) Do(opts ...googleapi.CallOption) (*ListTriggersResponse, error) {
  10648. gensupport.SetOptions(c.urlParams_, opts...)
  10649. res, err := c.doRequest("json")
  10650. if res != nil && res.StatusCode == http.StatusNotModified {
  10651. if res.Body != nil {
  10652. res.Body.Close()
  10653. }
  10654. return nil, &googleapi.Error{
  10655. Code: res.StatusCode,
  10656. Header: res.Header,
  10657. }
  10658. }
  10659. if err != nil {
  10660. return nil, err
  10661. }
  10662. defer googleapi.CloseBody(res)
  10663. if err := googleapi.CheckResponse(res); err != nil {
  10664. return nil, err
  10665. }
  10666. ret := &ListTriggersResponse{
  10667. ServerResponse: googleapi.ServerResponse{
  10668. Header: res.Header,
  10669. HTTPStatusCode: res.StatusCode,
  10670. },
  10671. }
  10672. target := &ret
  10673. if err := gensupport.DecodeResponse(target, res); err != nil {
  10674. return nil, err
  10675. }
  10676. return ret, nil
  10677. // {
  10678. // "description": "Lists all GTM Triggers of a Container.",
  10679. // "httpMethod": "GET",
  10680. // "id": "tagmanager.accounts.containers.workspaces.triggers.list",
  10681. // "parameterOrder": [
  10682. // "parent"
  10683. // ],
  10684. // "parameters": {
  10685. // "pageToken": {
  10686. // "description": "Continuation token for fetching the next page of results.",
  10687. // "location": "query",
  10688. // "type": "string"
  10689. // },
  10690. // "parent": {
  10691. // "description": "GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  10692. // "location": "path",
  10693. // "required": true,
  10694. // "type": "string"
  10695. // }
  10696. // },
  10697. // "path": "{+parent}/triggers",
  10698. // "response": {
  10699. // "$ref": "ListTriggersResponse"
  10700. // },
  10701. // "scopes": [
  10702. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  10703. // "https://www.googleapis.com/auth/tagmanager.readonly"
  10704. // ]
  10705. // }
  10706. }
  10707. // Pages invokes f for each page of results.
  10708. // A non-nil error returned from f will halt the iteration.
  10709. // The provided context supersedes any context provided to the Context method.
  10710. func (c *AccountsContainersWorkspacesTriggersListCall) Pages(ctx context.Context, f func(*ListTriggersResponse) error) error {
  10711. c.ctx_ = ctx
  10712. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10713. for {
  10714. x, err := c.Do()
  10715. if err != nil {
  10716. return err
  10717. }
  10718. if err := f(x); err != nil {
  10719. return err
  10720. }
  10721. if x.NextPageToken == "" {
  10722. return nil
  10723. }
  10724. c.PageToken(x.NextPageToken)
  10725. }
  10726. }
  10727. // method id "tagmanager.accounts.containers.workspaces.triggers.revert":
  10728. type AccountsContainersWorkspacesTriggersRevertCall struct {
  10729. s *Service
  10730. path string
  10731. urlParams_ gensupport.URLParams
  10732. ctx_ context.Context
  10733. header_ http.Header
  10734. }
  10735. // Revert: Reverts changes to a GTM Trigger in a GTM Workspace.
  10736. func (r *AccountsContainersWorkspacesTriggersService) Revert(path string) *AccountsContainersWorkspacesTriggersRevertCall {
  10737. c := &AccountsContainersWorkspacesTriggersRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10738. c.path = path
  10739. return c
  10740. }
  10741. // Fingerprint sets the optional parameter "fingerprint": When provided,
  10742. // this fingerprint must match the fingerprint of the trigger in
  10743. // storage.
  10744. func (c *AccountsContainersWorkspacesTriggersRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTriggersRevertCall {
  10745. c.urlParams_.Set("fingerprint", fingerprint)
  10746. return c
  10747. }
  10748. // Fields allows partial responses to be retrieved. See
  10749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10750. // for more information.
  10751. func (c *AccountsContainersWorkspacesTriggersRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersRevertCall {
  10752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10753. return c
  10754. }
  10755. // Context sets the context to be used in this call's Do method. Any
  10756. // pending HTTP request will be aborted if the provided context is
  10757. // canceled.
  10758. func (c *AccountsContainersWorkspacesTriggersRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersRevertCall {
  10759. c.ctx_ = ctx
  10760. return c
  10761. }
  10762. // Header returns an http.Header that can be modified by the caller to
  10763. // add HTTP headers to the request.
  10764. func (c *AccountsContainersWorkspacesTriggersRevertCall) Header() http.Header {
  10765. if c.header_ == nil {
  10766. c.header_ = make(http.Header)
  10767. }
  10768. return c.header_
  10769. }
  10770. func (c *AccountsContainersWorkspacesTriggersRevertCall) doRequest(alt string) (*http.Response, error) {
  10771. reqHeaders := make(http.Header)
  10772. for k, v := range c.header_ {
  10773. reqHeaders[k] = v
  10774. }
  10775. reqHeaders.Set("User-Agent", c.s.userAgent())
  10776. var body io.Reader = nil
  10777. c.urlParams_.Set("alt", alt)
  10778. c.urlParams_.Set("prettyPrint", "false")
  10779. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  10780. urls += "?" + c.urlParams_.Encode()
  10781. req, err := http.NewRequest("POST", urls, body)
  10782. if err != nil {
  10783. return nil, err
  10784. }
  10785. req.Header = reqHeaders
  10786. googleapi.Expand(req.URL, map[string]string{
  10787. "path": c.path,
  10788. })
  10789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10790. }
  10791. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.revert" call.
  10792. // Exactly one of *RevertTriggerResponse or error will be non-nil. Any
  10793. // non-2xx status code is an error. Response headers are in either
  10794. // *RevertTriggerResponse.ServerResponse.Header or (if a response was
  10795. // returned at all) in error.(*googleapi.Error).Header. Use
  10796. // googleapi.IsNotModified to check whether the returned error was
  10797. // because http.StatusNotModified was returned.
  10798. func (c *AccountsContainersWorkspacesTriggersRevertCall) Do(opts ...googleapi.CallOption) (*RevertTriggerResponse, error) {
  10799. gensupport.SetOptions(c.urlParams_, opts...)
  10800. res, err := c.doRequest("json")
  10801. if res != nil && res.StatusCode == http.StatusNotModified {
  10802. if res.Body != nil {
  10803. res.Body.Close()
  10804. }
  10805. return nil, &googleapi.Error{
  10806. Code: res.StatusCode,
  10807. Header: res.Header,
  10808. }
  10809. }
  10810. if err != nil {
  10811. return nil, err
  10812. }
  10813. defer googleapi.CloseBody(res)
  10814. if err := googleapi.CheckResponse(res); err != nil {
  10815. return nil, err
  10816. }
  10817. ret := &RevertTriggerResponse{
  10818. ServerResponse: googleapi.ServerResponse{
  10819. Header: res.Header,
  10820. HTTPStatusCode: res.StatusCode,
  10821. },
  10822. }
  10823. target := &ret
  10824. if err := gensupport.DecodeResponse(target, res); err != nil {
  10825. return nil, err
  10826. }
  10827. return ret, nil
  10828. // {
  10829. // "description": "Reverts changes to a GTM Trigger in a GTM Workspace.",
  10830. // "httpMethod": "POST",
  10831. // "id": "tagmanager.accounts.containers.workspaces.triggers.revert",
  10832. // "parameterOrder": [
  10833. // "path"
  10834. // ],
  10835. // "parameters": {
  10836. // "fingerprint": {
  10837. // "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.",
  10838. // "location": "query",
  10839. // "type": "string"
  10840. // },
  10841. // "path": {
  10842. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  10843. // "location": "path",
  10844. // "required": true,
  10845. // "type": "string"
  10846. // }
  10847. // },
  10848. // "path": "{+path}:revert",
  10849. // "response": {
  10850. // "$ref": "RevertTriggerResponse"
  10851. // },
  10852. // "scopes": [
  10853. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10854. // ]
  10855. // }
  10856. }
  10857. // method id "tagmanager.accounts.containers.workspaces.triggers.update":
  10858. type AccountsContainersWorkspacesTriggersUpdateCall struct {
  10859. s *Service
  10860. path string
  10861. trigger *Trigger
  10862. urlParams_ gensupport.URLParams
  10863. ctx_ context.Context
  10864. header_ http.Header
  10865. }
  10866. // Update: Updates a GTM Trigger.
  10867. func (r *AccountsContainersWorkspacesTriggersService) Update(path string, trigger *Trigger) *AccountsContainersWorkspacesTriggersUpdateCall {
  10868. c := &AccountsContainersWorkspacesTriggersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10869. c.path = path
  10870. c.trigger = trigger
  10871. return c
  10872. }
  10873. // Fingerprint sets the optional parameter "fingerprint": When provided,
  10874. // this fingerprint must match the fingerprint of the trigger in
  10875. // storage.
  10876. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTriggersUpdateCall {
  10877. c.urlParams_.Set("fingerprint", fingerprint)
  10878. return c
  10879. }
  10880. // Fields allows partial responses to be retrieved. See
  10881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10882. // for more information.
  10883. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersUpdateCall {
  10884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10885. return c
  10886. }
  10887. // Context sets the context to be used in this call's Do method. Any
  10888. // pending HTTP request will be aborted if the provided context is
  10889. // canceled.
  10890. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersUpdateCall {
  10891. c.ctx_ = ctx
  10892. return c
  10893. }
  10894. // Header returns an http.Header that can be modified by the caller to
  10895. // add HTTP headers to the request.
  10896. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Header() http.Header {
  10897. if c.header_ == nil {
  10898. c.header_ = make(http.Header)
  10899. }
  10900. return c.header_
  10901. }
  10902. func (c *AccountsContainersWorkspacesTriggersUpdateCall) doRequest(alt string) (*http.Response, error) {
  10903. reqHeaders := make(http.Header)
  10904. for k, v := range c.header_ {
  10905. reqHeaders[k] = v
  10906. }
  10907. reqHeaders.Set("User-Agent", c.s.userAgent())
  10908. var body io.Reader = nil
  10909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  10910. if err != nil {
  10911. return nil, err
  10912. }
  10913. reqHeaders.Set("Content-Type", "application/json")
  10914. c.urlParams_.Set("alt", alt)
  10915. c.urlParams_.Set("prettyPrint", "false")
  10916. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10917. urls += "?" + c.urlParams_.Encode()
  10918. req, err := http.NewRequest("PUT", urls, body)
  10919. if err != nil {
  10920. return nil, err
  10921. }
  10922. req.Header = reqHeaders
  10923. googleapi.Expand(req.URL, map[string]string{
  10924. "path": c.path,
  10925. })
  10926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10927. }
  10928. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.update" call.
  10929. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  10930. // code is an error. Response headers are in either
  10931. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  10932. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10933. // check whether the returned error was because http.StatusNotModified
  10934. // was returned.
  10935. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  10936. gensupport.SetOptions(c.urlParams_, opts...)
  10937. res, err := c.doRequest("json")
  10938. if res != nil && res.StatusCode == http.StatusNotModified {
  10939. if res.Body != nil {
  10940. res.Body.Close()
  10941. }
  10942. return nil, &googleapi.Error{
  10943. Code: res.StatusCode,
  10944. Header: res.Header,
  10945. }
  10946. }
  10947. if err != nil {
  10948. return nil, err
  10949. }
  10950. defer googleapi.CloseBody(res)
  10951. if err := googleapi.CheckResponse(res); err != nil {
  10952. return nil, err
  10953. }
  10954. ret := &Trigger{
  10955. ServerResponse: googleapi.ServerResponse{
  10956. Header: res.Header,
  10957. HTTPStatusCode: res.StatusCode,
  10958. },
  10959. }
  10960. target := &ret
  10961. if err := gensupport.DecodeResponse(target, res); err != nil {
  10962. return nil, err
  10963. }
  10964. return ret, nil
  10965. // {
  10966. // "description": "Updates a GTM Trigger.",
  10967. // "httpMethod": "PUT",
  10968. // "id": "tagmanager.accounts.containers.workspaces.triggers.update",
  10969. // "parameterOrder": [
  10970. // "path"
  10971. // ],
  10972. // "parameters": {
  10973. // "fingerprint": {
  10974. // "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.",
  10975. // "location": "query",
  10976. // "type": "string"
  10977. // },
  10978. // "path": {
  10979. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  10980. // "location": "path",
  10981. // "required": true,
  10982. // "type": "string"
  10983. // }
  10984. // },
  10985. // "path": "{+path}",
  10986. // "request": {
  10987. // "$ref": "Trigger"
  10988. // },
  10989. // "response": {
  10990. // "$ref": "Trigger"
  10991. // },
  10992. // "scopes": [
  10993. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10994. // ]
  10995. // }
  10996. }
  10997. // method id "tagmanager.accounts.containers.workspaces.variables.create":
  10998. type AccountsContainersWorkspacesVariablesCreateCall struct {
  10999. s *Service
  11000. parent string
  11001. variable *Variable
  11002. urlParams_ gensupport.URLParams
  11003. ctx_ context.Context
  11004. header_ http.Header
  11005. }
  11006. // Create: Creates a GTM Variable.
  11007. func (r *AccountsContainersWorkspacesVariablesService) Create(parent string, variable *Variable) *AccountsContainersWorkspacesVariablesCreateCall {
  11008. c := &AccountsContainersWorkspacesVariablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11009. c.parent = parent
  11010. c.variable = variable
  11011. return c
  11012. }
  11013. // Fields allows partial responses to be retrieved. See
  11014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11015. // for more information.
  11016. func (c *AccountsContainersWorkspacesVariablesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesCreateCall {
  11017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11018. return c
  11019. }
  11020. // Context sets the context to be used in this call's Do method. Any
  11021. // pending HTTP request will be aborted if the provided context is
  11022. // canceled.
  11023. func (c *AccountsContainersWorkspacesVariablesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesCreateCall {
  11024. c.ctx_ = ctx
  11025. return c
  11026. }
  11027. // Header returns an http.Header that can be modified by the caller to
  11028. // add HTTP headers to the request.
  11029. func (c *AccountsContainersWorkspacesVariablesCreateCall) Header() http.Header {
  11030. if c.header_ == nil {
  11031. c.header_ = make(http.Header)
  11032. }
  11033. return c.header_
  11034. }
  11035. func (c *AccountsContainersWorkspacesVariablesCreateCall) doRequest(alt string) (*http.Response, error) {
  11036. reqHeaders := make(http.Header)
  11037. for k, v := range c.header_ {
  11038. reqHeaders[k] = v
  11039. }
  11040. reqHeaders.Set("User-Agent", c.s.userAgent())
  11041. var body io.Reader = nil
  11042. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  11043. if err != nil {
  11044. return nil, err
  11045. }
  11046. reqHeaders.Set("Content-Type", "application/json")
  11047. c.urlParams_.Set("alt", alt)
  11048. c.urlParams_.Set("prettyPrint", "false")
  11049. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/variables")
  11050. urls += "?" + c.urlParams_.Encode()
  11051. req, err := http.NewRequest("POST", urls, body)
  11052. if err != nil {
  11053. return nil, err
  11054. }
  11055. req.Header = reqHeaders
  11056. googleapi.Expand(req.URL, map[string]string{
  11057. "parent": c.parent,
  11058. })
  11059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11060. }
  11061. // Do executes the "tagmanager.accounts.containers.workspaces.variables.create" call.
  11062. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  11063. // code is an error. Response headers are in either
  11064. // *Variable.ServerResponse.Header or (if a response was returned at
  11065. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11066. // to check whether the returned error was because
  11067. // http.StatusNotModified was returned.
  11068. func (c *AccountsContainersWorkspacesVariablesCreateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  11069. gensupport.SetOptions(c.urlParams_, opts...)
  11070. res, err := c.doRequest("json")
  11071. if res != nil && res.StatusCode == http.StatusNotModified {
  11072. if res.Body != nil {
  11073. res.Body.Close()
  11074. }
  11075. return nil, &googleapi.Error{
  11076. Code: res.StatusCode,
  11077. Header: res.Header,
  11078. }
  11079. }
  11080. if err != nil {
  11081. return nil, err
  11082. }
  11083. defer googleapi.CloseBody(res)
  11084. if err := googleapi.CheckResponse(res); err != nil {
  11085. return nil, err
  11086. }
  11087. ret := &Variable{
  11088. ServerResponse: googleapi.ServerResponse{
  11089. Header: res.Header,
  11090. HTTPStatusCode: res.StatusCode,
  11091. },
  11092. }
  11093. target := &ret
  11094. if err := gensupport.DecodeResponse(target, res); err != nil {
  11095. return nil, err
  11096. }
  11097. return ret, nil
  11098. // {
  11099. // "description": "Creates a GTM Variable.",
  11100. // "httpMethod": "POST",
  11101. // "id": "tagmanager.accounts.containers.workspaces.variables.create",
  11102. // "parameterOrder": [
  11103. // "parent"
  11104. // ],
  11105. // "parameters": {
  11106. // "parent": {
  11107. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  11108. // "location": "path",
  11109. // "required": true,
  11110. // "type": "string"
  11111. // }
  11112. // },
  11113. // "path": "{+parent}/variables",
  11114. // "request": {
  11115. // "$ref": "Variable"
  11116. // },
  11117. // "response": {
  11118. // "$ref": "Variable"
  11119. // },
  11120. // "scopes": [
  11121. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11122. // ]
  11123. // }
  11124. }
  11125. // method id "tagmanager.accounts.containers.workspaces.variables.delete":
  11126. type AccountsContainersWorkspacesVariablesDeleteCall struct {
  11127. s *Service
  11128. path string
  11129. urlParams_ gensupport.URLParams
  11130. ctx_ context.Context
  11131. header_ http.Header
  11132. }
  11133. // Delete: Deletes a GTM Variable.
  11134. func (r *AccountsContainersWorkspacesVariablesService) Delete(path string) *AccountsContainersWorkspacesVariablesDeleteCall {
  11135. c := &AccountsContainersWorkspacesVariablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11136. c.path = path
  11137. return c
  11138. }
  11139. // Fields allows partial responses to be retrieved. See
  11140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11141. // for more information.
  11142. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesDeleteCall {
  11143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11144. return c
  11145. }
  11146. // Context sets the context to be used in this call's Do method. Any
  11147. // pending HTTP request will be aborted if the provided context is
  11148. // canceled.
  11149. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesDeleteCall {
  11150. c.ctx_ = ctx
  11151. return c
  11152. }
  11153. // Header returns an http.Header that can be modified by the caller to
  11154. // add HTTP headers to the request.
  11155. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Header() http.Header {
  11156. if c.header_ == nil {
  11157. c.header_ = make(http.Header)
  11158. }
  11159. return c.header_
  11160. }
  11161. func (c *AccountsContainersWorkspacesVariablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  11162. reqHeaders := make(http.Header)
  11163. for k, v := range c.header_ {
  11164. reqHeaders[k] = v
  11165. }
  11166. reqHeaders.Set("User-Agent", c.s.userAgent())
  11167. var body io.Reader = nil
  11168. c.urlParams_.Set("alt", alt)
  11169. c.urlParams_.Set("prettyPrint", "false")
  11170. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11171. urls += "?" + c.urlParams_.Encode()
  11172. req, err := http.NewRequest("DELETE", urls, body)
  11173. if err != nil {
  11174. return nil, err
  11175. }
  11176. req.Header = reqHeaders
  11177. googleapi.Expand(req.URL, map[string]string{
  11178. "path": c.path,
  11179. })
  11180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11181. }
  11182. // Do executes the "tagmanager.accounts.containers.workspaces.variables.delete" call.
  11183. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  11184. gensupport.SetOptions(c.urlParams_, opts...)
  11185. res, err := c.doRequest("json")
  11186. if err != nil {
  11187. return err
  11188. }
  11189. defer googleapi.CloseBody(res)
  11190. if err := googleapi.CheckResponse(res); err != nil {
  11191. return err
  11192. }
  11193. return nil
  11194. // {
  11195. // "description": "Deletes a GTM Variable.",
  11196. // "httpMethod": "DELETE",
  11197. // "id": "tagmanager.accounts.containers.workspaces.variables.delete",
  11198. // "parameterOrder": [
  11199. // "path"
  11200. // ],
  11201. // "parameters": {
  11202. // "path": {
  11203. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  11204. // "location": "path",
  11205. // "required": true,
  11206. // "type": "string"
  11207. // }
  11208. // },
  11209. // "path": "{+path}",
  11210. // "scopes": [
  11211. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11212. // ]
  11213. // }
  11214. }
  11215. // method id "tagmanager.accounts.containers.workspaces.variables.get":
  11216. type AccountsContainersWorkspacesVariablesGetCall struct {
  11217. s *Service
  11218. path string
  11219. urlParams_ gensupport.URLParams
  11220. ifNoneMatch_ string
  11221. ctx_ context.Context
  11222. header_ http.Header
  11223. }
  11224. // Get: Gets a GTM Variable.
  11225. func (r *AccountsContainersWorkspacesVariablesService) Get(path string) *AccountsContainersWorkspacesVariablesGetCall {
  11226. c := &AccountsContainersWorkspacesVariablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11227. c.path = path
  11228. return c
  11229. }
  11230. // Fields allows partial responses to be retrieved. See
  11231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11232. // for more information.
  11233. func (c *AccountsContainersWorkspacesVariablesGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesGetCall {
  11234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11235. return c
  11236. }
  11237. // IfNoneMatch sets the optional parameter which makes the operation
  11238. // fail if the object's ETag matches the given value. This is useful for
  11239. // getting updates only after the object has changed since the last
  11240. // request. Use googleapi.IsNotModified to check whether the response
  11241. // error from Do is the result of In-None-Match.
  11242. func (c *AccountsContainersWorkspacesVariablesGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesVariablesGetCall {
  11243. c.ifNoneMatch_ = entityTag
  11244. return c
  11245. }
  11246. // Context sets the context to be used in this call's Do method. Any
  11247. // pending HTTP request will be aborted if the provided context is
  11248. // canceled.
  11249. func (c *AccountsContainersWorkspacesVariablesGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesGetCall {
  11250. c.ctx_ = ctx
  11251. return c
  11252. }
  11253. // Header returns an http.Header that can be modified by the caller to
  11254. // add HTTP headers to the request.
  11255. func (c *AccountsContainersWorkspacesVariablesGetCall) Header() http.Header {
  11256. if c.header_ == nil {
  11257. c.header_ = make(http.Header)
  11258. }
  11259. return c.header_
  11260. }
  11261. func (c *AccountsContainersWorkspacesVariablesGetCall) doRequest(alt string) (*http.Response, error) {
  11262. reqHeaders := make(http.Header)
  11263. for k, v := range c.header_ {
  11264. reqHeaders[k] = v
  11265. }
  11266. reqHeaders.Set("User-Agent", c.s.userAgent())
  11267. if c.ifNoneMatch_ != "" {
  11268. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11269. }
  11270. var body io.Reader = nil
  11271. c.urlParams_.Set("alt", alt)
  11272. c.urlParams_.Set("prettyPrint", "false")
  11273. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11274. urls += "?" + c.urlParams_.Encode()
  11275. req, err := http.NewRequest("GET", urls, body)
  11276. if err != nil {
  11277. return nil, err
  11278. }
  11279. req.Header = reqHeaders
  11280. googleapi.Expand(req.URL, map[string]string{
  11281. "path": c.path,
  11282. })
  11283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11284. }
  11285. // Do executes the "tagmanager.accounts.containers.workspaces.variables.get" call.
  11286. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  11287. // code is an error. Response headers are in either
  11288. // *Variable.ServerResponse.Header or (if a response was returned at
  11289. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11290. // to check whether the returned error was because
  11291. // http.StatusNotModified was returned.
  11292. func (c *AccountsContainersWorkspacesVariablesGetCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  11293. gensupport.SetOptions(c.urlParams_, opts...)
  11294. res, err := c.doRequest("json")
  11295. if res != nil && res.StatusCode == http.StatusNotModified {
  11296. if res.Body != nil {
  11297. res.Body.Close()
  11298. }
  11299. return nil, &googleapi.Error{
  11300. Code: res.StatusCode,
  11301. Header: res.Header,
  11302. }
  11303. }
  11304. if err != nil {
  11305. return nil, err
  11306. }
  11307. defer googleapi.CloseBody(res)
  11308. if err := googleapi.CheckResponse(res); err != nil {
  11309. return nil, err
  11310. }
  11311. ret := &Variable{
  11312. ServerResponse: googleapi.ServerResponse{
  11313. Header: res.Header,
  11314. HTTPStatusCode: res.StatusCode,
  11315. },
  11316. }
  11317. target := &ret
  11318. if err := gensupport.DecodeResponse(target, res); err != nil {
  11319. return nil, err
  11320. }
  11321. return ret, nil
  11322. // {
  11323. // "description": "Gets a GTM Variable.",
  11324. // "httpMethod": "GET",
  11325. // "id": "tagmanager.accounts.containers.workspaces.variables.get",
  11326. // "parameterOrder": [
  11327. // "path"
  11328. // ],
  11329. // "parameters": {
  11330. // "path": {
  11331. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  11332. // "location": "path",
  11333. // "required": true,
  11334. // "type": "string"
  11335. // }
  11336. // },
  11337. // "path": "{+path}",
  11338. // "response": {
  11339. // "$ref": "Variable"
  11340. // },
  11341. // "scopes": [
  11342. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  11343. // "https://www.googleapis.com/auth/tagmanager.readonly"
  11344. // ]
  11345. // }
  11346. }
  11347. // method id "tagmanager.accounts.containers.workspaces.variables.list":
  11348. type AccountsContainersWorkspacesVariablesListCall struct {
  11349. s *Service
  11350. parent string
  11351. urlParams_ gensupport.URLParams
  11352. ifNoneMatch_ string
  11353. ctx_ context.Context
  11354. header_ http.Header
  11355. }
  11356. // List: Lists all GTM Variables of a Container.
  11357. func (r *AccountsContainersWorkspacesVariablesService) List(parent string) *AccountsContainersWorkspacesVariablesListCall {
  11358. c := &AccountsContainersWorkspacesVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11359. c.parent = parent
  11360. return c
  11361. }
  11362. // PageToken sets the optional parameter "pageToken": Continuation token
  11363. // for fetching the next page of results.
  11364. func (c *AccountsContainersWorkspacesVariablesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesVariablesListCall {
  11365. c.urlParams_.Set("pageToken", pageToken)
  11366. return c
  11367. }
  11368. // Fields allows partial responses to be retrieved. See
  11369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11370. // for more information.
  11371. func (c *AccountsContainersWorkspacesVariablesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesListCall {
  11372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11373. return c
  11374. }
  11375. // IfNoneMatch sets the optional parameter which makes the operation
  11376. // fail if the object's ETag matches the given value. This is useful for
  11377. // getting updates only after the object has changed since the last
  11378. // request. Use googleapi.IsNotModified to check whether the response
  11379. // error from Do is the result of In-None-Match.
  11380. func (c *AccountsContainersWorkspacesVariablesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesVariablesListCall {
  11381. c.ifNoneMatch_ = entityTag
  11382. return c
  11383. }
  11384. // Context sets the context to be used in this call's Do method. Any
  11385. // pending HTTP request will be aborted if the provided context is
  11386. // canceled.
  11387. func (c *AccountsContainersWorkspacesVariablesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesListCall {
  11388. c.ctx_ = ctx
  11389. return c
  11390. }
  11391. // Header returns an http.Header that can be modified by the caller to
  11392. // add HTTP headers to the request.
  11393. func (c *AccountsContainersWorkspacesVariablesListCall) Header() http.Header {
  11394. if c.header_ == nil {
  11395. c.header_ = make(http.Header)
  11396. }
  11397. return c.header_
  11398. }
  11399. func (c *AccountsContainersWorkspacesVariablesListCall) doRequest(alt string) (*http.Response, error) {
  11400. reqHeaders := make(http.Header)
  11401. for k, v := range c.header_ {
  11402. reqHeaders[k] = v
  11403. }
  11404. reqHeaders.Set("User-Agent", c.s.userAgent())
  11405. if c.ifNoneMatch_ != "" {
  11406. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11407. }
  11408. var body io.Reader = nil
  11409. c.urlParams_.Set("alt", alt)
  11410. c.urlParams_.Set("prettyPrint", "false")
  11411. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/variables")
  11412. urls += "?" + c.urlParams_.Encode()
  11413. req, err := http.NewRequest("GET", urls, body)
  11414. if err != nil {
  11415. return nil, err
  11416. }
  11417. req.Header = reqHeaders
  11418. googleapi.Expand(req.URL, map[string]string{
  11419. "parent": c.parent,
  11420. })
  11421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11422. }
  11423. // Do executes the "tagmanager.accounts.containers.workspaces.variables.list" call.
  11424. // Exactly one of *ListVariablesResponse or error will be non-nil. Any
  11425. // non-2xx status code is an error. Response headers are in either
  11426. // *ListVariablesResponse.ServerResponse.Header or (if a response was
  11427. // returned at all) in error.(*googleapi.Error).Header. Use
  11428. // googleapi.IsNotModified to check whether the returned error was
  11429. // because http.StatusNotModified was returned.
  11430. func (c *AccountsContainersWorkspacesVariablesListCall) Do(opts ...googleapi.CallOption) (*ListVariablesResponse, error) {
  11431. gensupport.SetOptions(c.urlParams_, opts...)
  11432. res, err := c.doRequest("json")
  11433. if res != nil && res.StatusCode == http.StatusNotModified {
  11434. if res.Body != nil {
  11435. res.Body.Close()
  11436. }
  11437. return nil, &googleapi.Error{
  11438. Code: res.StatusCode,
  11439. Header: res.Header,
  11440. }
  11441. }
  11442. if err != nil {
  11443. return nil, err
  11444. }
  11445. defer googleapi.CloseBody(res)
  11446. if err := googleapi.CheckResponse(res); err != nil {
  11447. return nil, err
  11448. }
  11449. ret := &ListVariablesResponse{
  11450. ServerResponse: googleapi.ServerResponse{
  11451. Header: res.Header,
  11452. HTTPStatusCode: res.StatusCode,
  11453. },
  11454. }
  11455. target := &ret
  11456. if err := gensupport.DecodeResponse(target, res); err != nil {
  11457. return nil, err
  11458. }
  11459. return ret, nil
  11460. // {
  11461. // "description": "Lists all GTM Variables of a Container.",
  11462. // "httpMethod": "GET",
  11463. // "id": "tagmanager.accounts.containers.workspaces.variables.list",
  11464. // "parameterOrder": [
  11465. // "parent"
  11466. // ],
  11467. // "parameters": {
  11468. // "pageToken": {
  11469. // "description": "Continuation token for fetching the next page of results.",
  11470. // "location": "query",
  11471. // "type": "string"
  11472. // },
  11473. // "parent": {
  11474. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  11475. // "location": "path",
  11476. // "required": true,
  11477. // "type": "string"
  11478. // }
  11479. // },
  11480. // "path": "{+parent}/variables",
  11481. // "response": {
  11482. // "$ref": "ListVariablesResponse"
  11483. // },
  11484. // "scopes": [
  11485. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  11486. // "https://www.googleapis.com/auth/tagmanager.readonly"
  11487. // ]
  11488. // }
  11489. }
  11490. // Pages invokes f for each page of results.
  11491. // A non-nil error returned from f will halt the iteration.
  11492. // The provided context supersedes any context provided to the Context method.
  11493. func (c *AccountsContainersWorkspacesVariablesListCall) Pages(ctx context.Context, f func(*ListVariablesResponse) error) error {
  11494. c.ctx_ = ctx
  11495. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11496. for {
  11497. x, err := c.Do()
  11498. if err != nil {
  11499. return err
  11500. }
  11501. if err := f(x); err != nil {
  11502. return err
  11503. }
  11504. if x.NextPageToken == "" {
  11505. return nil
  11506. }
  11507. c.PageToken(x.NextPageToken)
  11508. }
  11509. }
  11510. // method id "tagmanager.accounts.containers.workspaces.variables.revert":
  11511. type AccountsContainersWorkspacesVariablesRevertCall struct {
  11512. s *Service
  11513. path string
  11514. urlParams_ gensupport.URLParams
  11515. ctx_ context.Context
  11516. header_ http.Header
  11517. }
  11518. // Revert: Reverts changes to a GTM Variable in a GTM Workspace.
  11519. func (r *AccountsContainersWorkspacesVariablesService) Revert(path string) *AccountsContainersWorkspacesVariablesRevertCall {
  11520. c := &AccountsContainersWorkspacesVariablesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11521. c.path = path
  11522. return c
  11523. }
  11524. // Fingerprint sets the optional parameter "fingerprint": When provided,
  11525. // this fingerprint must match the fingerprint of the variable in
  11526. // storage.
  11527. func (c *AccountsContainersWorkspacesVariablesRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesVariablesRevertCall {
  11528. c.urlParams_.Set("fingerprint", fingerprint)
  11529. return c
  11530. }
  11531. // Fields allows partial responses to be retrieved. See
  11532. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11533. // for more information.
  11534. func (c *AccountsContainersWorkspacesVariablesRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesRevertCall {
  11535. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11536. return c
  11537. }
  11538. // Context sets the context to be used in this call's Do method. Any
  11539. // pending HTTP request will be aborted if the provided context is
  11540. // canceled.
  11541. func (c *AccountsContainersWorkspacesVariablesRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesRevertCall {
  11542. c.ctx_ = ctx
  11543. return c
  11544. }
  11545. // Header returns an http.Header that can be modified by the caller to
  11546. // add HTTP headers to the request.
  11547. func (c *AccountsContainersWorkspacesVariablesRevertCall) Header() http.Header {
  11548. if c.header_ == nil {
  11549. c.header_ = make(http.Header)
  11550. }
  11551. return c.header_
  11552. }
  11553. func (c *AccountsContainersWorkspacesVariablesRevertCall) doRequest(alt string) (*http.Response, error) {
  11554. reqHeaders := make(http.Header)
  11555. for k, v := range c.header_ {
  11556. reqHeaders[k] = v
  11557. }
  11558. reqHeaders.Set("User-Agent", c.s.userAgent())
  11559. var body io.Reader = nil
  11560. c.urlParams_.Set("alt", alt)
  11561. c.urlParams_.Set("prettyPrint", "false")
  11562. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  11563. urls += "?" + c.urlParams_.Encode()
  11564. req, err := http.NewRequest("POST", urls, body)
  11565. if err != nil {
  11566. return nil, err
  11567. }
  11568. req.Header = reqHeaders
  11569. googleapi.Expand(req.URL, map[string]string{
  11570. "path": c.path,
  11571. })
  11572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11573. }
  11574. // Do executes the "tagmanager.accounts.containers.workspaces.variables.revert" call.
  11575. // Exactly one of *RevertVariableResponse or error will be non-nil. Any
  11576. // non-2xx status code is an error. Response headers are in either
  11577. // *RevertVariableResponse.ServerResponse.Header or (if a response was
  11578. // returned at all) in error.(*googleapi.Error).Header. Use
  11579. // googleapi.IsNotModified to check whether the returned error was
  11580. // because http.StatusNotModified was returned.
  11581. func (c *AccountsContainersWorkspacesVariablesRevertCall) Do(opts ...googleapi.CallOption) (*RevertVariableResponse, error) {
  11582. gensupport.SetOptions(c.urlParams_, opts...)
  11583. res, err := c.doRequest("json")
  11584. if res != nil && res.StatusCode == http.StatusNotModified {
  11585. if res.Body != nil {
  11586. res.Body.Close()
  11587. }
  11588. return nil, &googleapi.Error{
  11589. Code: res.StatusCode,
  11590. Header: res.Header,
  11591. }
  11592. }
  11593. if err != nil {
  11594. return nil, err
  11595. }
  11596. defer googleapi.CloseBody(res)
  11597. if err := googleapi.CheckResponse(res); err != nil {
  11598. return nil, err
  11599. }
  11600. ret := &RevertVariableResponse{
  11601. ServerResponse: googleapi.ServerResponse{
  11602. Header: res.Header,
  11603. HTTPStatusCode: res.StatusCode,
  11604. },
  11605. }
  11606. target := &ret
  11607. if err := gensupport.DecodeResponse(target, res); err != nil {
  11608. return nil, err
  11609. }
  11610. return ret, nil
  11611. // {
  11612. // "description": "Reverts changes to a GTM Variable in a GTM Workspace.",
  11613. // "httpMethod": "POST",
  11614. // "id": "tagmanager.accounts.containers.workspaces.variables.revert",
  11615. // "parameterOrder": [
  11616. // "path"
  11617. // ],
  11618. // "parameters": {
  11619. // "fingerprint": {
  11620. // "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.",
  11621. // "location": "query",
  11622. // "type": "string"
  11623. // },
  11624. // "path": {
  11625. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  11626. // "location": "path",
  11627. // "required": true,
  11628. // "type": "string"
  11629. // }
  11630. // },
  11631. // "path": "{+path}:revert",
  11632. // "response": {
  11633. // "$ref": "RevertVariableResponse"
  11634. // },
  11635. // "scopes": [
  11636. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11637. // ]
  11638. // }
  11639. }
  11640. // method id "tagmanager.accounts.containers.workspaces.variables.update":
  11641. type AccountsContainersWorkspacesVariablesUpdateCall struct {
  11642. s *Service
  11643. path string
  11644. variable *Variable
  11645. urlParams_ gensupport.URLParams
  11646. ctx_ context.Context
  11647. header_ http.Header
  11648. }
  11649. // Update: Updates a GTM Variable.
  11650. func (r *AccountsContainersWorkspacesVariablesService) Update(path string, variable *Variable) *AccountsContainersWorkspacesVariablesUpdateCall {
  11651. c := &AccountsContainersWorkspacesVariablesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11652. c.path = path
  11653. c.variable = variable
  11654. return c
  11655. }
  11656. // Fingerprint sets the optional parameter "fingerprint": When provided,
  11657. // this fingerprint must match the fingerprint of the variable in
  11658. // storage.
  11659. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesVariablesUpdateCall {
  11660. c.urlParams_.Set("fingerprint", fingerprint)
  11661. return c
  11662. }
  11663. // Fields allows partial responses to be retrieved. See
  11664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11665. // for more information.
  11666. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesUpdateCall {
  11667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11668. return c
  11669. }
  11670. // Context sets the context to be used in this call's Do method. Any
  11671. // pending HTTP request will be aborted if the provided context is
  11672. // canceled.
  11673. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesUpdateCall {
  11674. c.ctx_ = ctx
  11675. return c
  11676. }
  11677. // Header returns an http.Header that can be modified by the caller to
  11678. // add HTTP headers to the request.
  11679. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Header() http.Header {
  11680. if c.header_ == nil {
  11681. c.header_ = make(http.Header)
  11682. }
  11683. return c.header_
  11684. }
  11685. func (c *AccountsContainersWorkspacesVariablesUpdateCall) doRequest(alt string) (*http.Response, error) {
  11686. reqHeaders := make(http.Header)
  11687. for k, v := range c.header_ {
  11688. reqHeaders[k] = v
  11689. }
  11690. reqHeaders.Set("User-Agent", c.s.userAgent())
  11691. var body io.Reader = nil
  11692. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  11693. if err != nil {
  11694. return nil, err
  11695. }
  11696. reqHeaders.Set("Content-Type", "application/json")
  11697. c.urlParams_.Set("alt", alt)
  11698. c.urlParams_.Set("prettyPrint", "false")
  11699. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11700. urls += "?" + c.urlParams_.Encode()
  11701. req, err := http.NewRequest("PUT", urls, body)
  11702. if err != nil {
  11703. return nil, err
  11704. }
  11705. req.Header = reqHeaders
  11706. googleapi.Expand(req.URL, map[string]string{
  11707. "path": c.path,
  11708. })
  11709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11710. }
  11711. // Do executes the "tagmanager.accounts.containers.workspaces.variables.update" call.
  11712. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  11713. // code is an error. Response headers are in either
  11714. // *Variable.ServerResponse.Header or (if a response was returned at
  11715. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11716. // to check whether the returned error was because
  11717. // http.StatusNotModified was returned.
  11718. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  11719. gensupport.SetOptions(c.urlParams_, opts...)
  11720. res, err := c.doRequest("json")
  11721. if res != nil && res.StatusCode == http.StatusNotModified {
  11722. if res.Body != nil {
  11723. res.Body.Close()
  11724. }
  11725. return nil, &googleapi.Error{
  11726. Code: res.StatusCode,
  11727. Header: res.Header,
  11728. }
  11729. }
  11730. if err != nil {
  11731. return nil, err
  11732. }
  11733. defer googleapi.CloseBody(res)
  11734. if err := googleapi.CheckResponse(res); err != nil {
  11735. return nil, err
  11736. }
  11737. ret := &Variable{
  11738. ServerResponse: googleapi.ServerResponse{
  11739. Header: res.Header,
  11740. HTTPStatusCode: res.StatusCode,
  11741. },
  11742. }
  11743. target := &ret
  11744. if err := gensupport.DecodeResponse(target, res); err != nil {
  11745. return nil, err
  11746. }
  11747. return ret, nil
  11748. // {
  11749. // "description": "Updates a GTM Variable.",
  11750. // "httpMethod": "PUT",
  11751. // "id": "tagmanager.accounts.containers.workspaces.variables.update",
  11752. // "parameterOrder": [
  11753. // "path"
  11754. // ],
  11755. // "parameters": {
  11756. // "fingerprint": {
  11757. // "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.",
  11758. // "location": "query",
  11759. // "type": "string"
  11760. // },
  11761. // "path": {
  11762. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  11763. // "location": "path",
  11764. // "required": true,
  11765. // "type": "string"
  11766. // }
  11767. // },
  11768. // "path": "{+path}",
  11769. // "request": {
  11770. // "$ref": "Variable"
  11771. // },
  11772. // "response": {
  11773. // "$ref": "Variable"
  11774. // },
  11775. // "scopes": [
  11776. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11777. // ]
  11778. // }
  11779. }
  11780. // method id "tagmanager.accounts.containers.workspaces.zones.create":
  11781. type AccountsContainersWorkspacesZonesCreateCall struct {
  11782. s *Service
  11783. parent string
  11784. zone *Zone
  11785. urlParams_ gensupport.URLParams
  11786. ctx_ context.Context
  11787. header_ http.Header
  11788. }
  11789. // Create: Creates a GTM Zone.
  11790. func (r *AccountsContainersWorkspacesZonesService) Create(parent string, zone *Zone) *AccountsContainersWorkspacesZonesCreateCall {
  11791. c := &AccountsContainersWorkspacesZonesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11792. c.parent = parent
  11793. c.zone = zone
  11794. return c
  11795. }
  11796. // Fields allows partial responses to be retrieved. See
  11797. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11798. // for more information.
  11799. func (c *AccountsContainersWorkspacesZonesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesZonesCreateCall {
  11800. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11801. return c
  11802. }
  11803. // Context sets the context to be used in this call's Do method. Any
  11804. // pending HTTP request will be aborted if the provided context is
  11805. // canceled.
  11806. func (c *AccountsContainersWorkspacesZonesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesZonesCreateCall {
  11807. c.ctx_ = ctx
  11808. return c
  11809. }
  11810. // Header returns an http.Header that can be modified by the caller to
  11811. // add HTTP headers to the request.
  11812. func (c *AccountsContainersWorkspacesZonesCreateCall) Header() http.Header {
  11813. if c.header_ == nil {
  11814. c.header_ = make(http.Header)
  11815. }
  11816. return c.header_
  11817. }
  11818. func (c *AccountsContainersWorkspacesZonesCreateCall) doRequest(alt string) (*http.Response, error) {
  11819. reqHeaders := make(http.Header)
  11820. for k, v := range c.header_ {
  11821. reqHeaders[k] = v
  11822. }
  11823. reqHeaders.Set("User-Agent", c.s.userAgent())
  11824. var body io.Reader = nil
  11825. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zone)
  11826. if err != nil {
  11827. return nil, err
  11828. }
  11829. reqHeaders.Set("Content-Type", "application/json")
  11830. c.urlParams_.Set("alt", alt)
  11831. c.urlParams_.Set("prettyPrint", "false")
  11832. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/zones")
  11833. urls += "?" + c.urlParams_.Encode()
  11834. req, err := http.NewRequest("POST", urls, body)
  11835. if err != nil {
  11836. return nil, err
  11837. }
  11838. req.Header = reqHeaders
  11839. googleapi.Expand(req.URL, map[string]string{
  11840. "parent": c.parent,
  11841. })
  11842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11843. }
  11844. // Do executes the "tagmanager.accounts.containers.workspaces.zones.create" call.
  11845. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  11846. // code is an error. Response headers are in either
  11847. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  11848. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11849. // whether the returned error was because http.StatusNotModified was
  11850. // returned.
  11851. func (c *AccountsContainersWorkspacesZonesCreateCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  11852. gensupport.SetOptions(c.urlParams_, opts...)
  11853. res, err := c.doRequest("json")
  11854. if res != nil && res.StatusCode == http.StatusNotModified {
  11855. if res.Body != nil {
  11856. res.Body.Close()
  11857. }
  11858. return nil, &googleapi.Error{
  11859. Code: res.StatusCode,
  11860. Header: res.Header,
  11861. }
  11862. }
  11863. if err != nil {
  11864. return nil, err
  11865. }
  11866. defer googleapi.CloseBody(res)
  11867. if err := googleapi.CheckResponse(res); err != nil {
  11868. return nil, err
  11869. }
  11870. ret := &Zone{
  11871. ServerResponse: googleapi.ServerResponse{
  11872. Header: res.Header,
  11873. HTTPStatusCode: res.StatusCode,
  11874. },
  11875. }
  11876. target := &ret
  11877. if err := gensupport.DecodeResponse(target, res); err != nil {
  11878. return nil, err
  11879. }
  11880. return ret, nil
  11881. // {
  11882. // "description": "Creates a GTM Zone.",
  11883. // "httpMethod": "POST",
  11884. // "id": "tagmanager.accounts.containers.workspaces.zones.create",
  11885. // "parameterOrder": [
  11886. // "parent"
  11887. // ],
  11888. // "parameters": {
  11889. // "parent": {
  11890. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  11891. // "location": "path",
  11892. // "required": true,
  11893. // "type": "string"
  11894. // }
  11895. // },
  11896. // "path": "{+parent}/zones",
  11897. // "request": {
  11898. // "$ref": "Zone"
  11899. // },
  11900. // "response": {
  11901. // "$ref": "Zone"
  11902. // },
  11903. // "scopes": [
  11904. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11905. // ]
  11906. // }
  11907. }
  11908. // method id "tagmanager.accounts.containers.workspaces.zones.delete":
  11909. type AccountsContainersWorkspacesZonesDeleteCall struct {
  11910. s *Service
  11911. path string
  11912. urlParams_ gensupport.URLParams
  11913. ctx_ context.Context
  11914. header_ http.Header
  11915. }
  11916. // Delete: Deletes a GTM Zone.
  11917. func (r *AccountsContainersWorkspacesZonesService) Delete(path string) *AccountsContainersWorkspacesZonesDeleteCall {
  11918. c := &AccountsContainersWorkspacesZonesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11919. c.path = path
  11920. return c
  11921. }
  11922. // Fields allows partial responses to be retrieved. See
  11923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11924. // for more information.
  11925. func (c *AccountsContainersWorkspacesZonesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesZonesDeleteCall {
  11926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11927. return c
  11928. }
  11929. // Context sets the context to be used in this call's Do method. Any
  11930. // pending HTTP request will be aborted if the provided context is
  11931. // canceled.
  11932. func (c *AccountsContainersWorkspacesZonesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesZonesDeleteCall {
  11933. c.ctx_ = ctx
  11934. return c
  11935. }
  11936. // Header returns an http.Header that can be modified by the caller to
  11937. // add HTTP headers to the request.
  11938. func (c *AccountsContainersWorkspacesZonesDeleteCall) Header() http.Header {
  11939. if c.header_ == nil {
  11940. c.header_ = make(http.Header)
  11941. }
  11942. return c.header_
  11943. }
  11944. func (c *AccountsContainersWorkspacesZonesDeleteCall) doRequest(alt string) (*http.Response, error) {
  11945. reqHeaders := make(http.Header)
  11946. for k, v := range c.header_ {
  11947. reqHeaders[k] = v
  11948. }
  11949. reqHeaders.Set("User-Agent", c.s.userAgent())
  11950. var body io.Reader = nil
  11951. c.urlParams_.Set("alt", alt)
  11952. c.urlParams_.Set("prettyPrint", "false")
  11953. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11954. urls += "?" + c.urlParams_.Encode()
  11955. req, err := http.NewRequest("DELETE", urls, body)
  11956. if err != nil {
  11957. return nil, err
  11958. }
  11959. req.Header = reqHeaders
  11960. googleapi.Expand(req.URL, map[string]string{
  11961. "path": c.path,
  11962. })
  11963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11964. }
  11965. // Do executes the "tagmanager.accounts.containers.workspaces.zones.delete" call.
  11966. func (c *AccountsContainersWorkspacesZonesDeleteCall) Do(opts ...googleapi.CallOption) error {
  11967. gensupport.SetOptions(c.urlParams_, opts...)
  11968. res, err := c.doRequest("json")
  11969. if err != nil {
  11970. return err
  11971. }
  11972. defer googleapi.CloseBody(res)
  11973. if err := googleapi.CheckResponse(res); err != nil {
  11974. return err
  11975. }
  11976. return nil
  11977. // {
  11978. // "description": "Deletes a GTM Zone.",
  11979. // "httpMethod": "DELETE",
  11980. // "id": "tagmanager.accounts.containers.workspaces.zones.delete",
  11981. // "parameterOrder": [
  11982. // "path"
  11983. // ],
  11984. // "parameters": {
  11985. // "path": {
  11986. // "description": "GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}",
  11987. // "location": "path",
  11988. // "required": true,
  11989. // "type": "string"
  11990. // }
  11991. // },
  11992. // "path": "{+path}",
  11993. // "scopes": [
  11994. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11995. // ]
  11996. // }
  11997. }
  11998. // method id "tagmanager.accounts.containers.workspaces.zones.get":
  11999. type AccountsContainersWorkspacesZonesGetCall struct {
  12000. s *Service
  12001. path string
  12002. urlParams_ gensupport.URLParams
  12003. ifNoneMatch_ string
  12004. ctx_ context.Context
  12005. header_ http.Header
  12006. }
  12007. // Get: Gets a GTM Zone.
  12008. func (r *AccountsContainersWorkspacesZonesService) Get(path string) *AccountsContainersWorkspacesZonesGetCall {
  12009. c := &AccountsContainersWorkspacesZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12010. c.path = path
  12011. return c
  12012. }
  12013. // Fields allows partial responses to be retrieved. See
  12014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12015. // for more information.
  12016. func (c *AccountsContainersWorkspacesZonesGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesZonesGetCall {
  12017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12018. return c
  12019. }
  12020. // IfNoneMatch sets the optional parameter which makes the operation
  12021. // fail if the object's ETag matches the given value. This is useful for
  12022. // getting updates only after the object has changed since the last
  12023. // request. Use googleapi.IsNotModified to check whether the response
  12024. // error from Do is the result of In-None-Match.
  12025. func (c *AccountsContainersWorkspacesZonesGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesZonesGetCall {
  12026. c.ifNoneMatch_ = entityTag
  12027. return c
  12028. }
  12029. // Context sets the context to be used in this call's Do method. Any
  12030. // pending HTTP request will be aborted if the provided context is
  12031. // canceled.
  12032. func (c *AccountsContainersWorkspacesZonesGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesZonesGetCall {
  12033. c.ctx_ = ctx
  12034. return c
  12035. }
  12036. // Header returns an http.Header that can be modified by the caller to
  12037. // add HTTP headers to the request.
  12038. func (c *AccountsContainersWorkspacesZonesGetCall) Header() http.Header {
  12039. if c.header_ == nil {
  12040. c.header_ = make(http.Header)
  12041. }
  12042. return c.header_
  12043. }
  12044. func (c *AccountsContainersWorkspacesZonesGetCall) doRequest(alt string) (*http.Response, error) {
  12045. reqHeaders := make(http.Header)
  12046. for k, v := range c.header_ {
  12047. reqHeaders[k] = v
  12048. }
  12049. reqHeaders.Set("User-Agent", c.s.userAgent())
  12050. if c.ifNoneMatch_ != "" {
  12051. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12052. }
  12053. var body io.Reader = nil
  12054. c.urlParams_.Set("alt", alt)
  12055. c.urlParams_.Set("prettyPrint", "false")
  12056. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12057. urls += "?" + c.urlParams_.Encode()
  12058. req, err := http.NewRequest("GET", urls, body)
  12059. if err != nil {
  12060. return nil, err
  12061. }
  12062. req.Header = reqHeaders
  12063. googleapi.Expand(req.URL, map[string]string{
  12064. "path": c.path,
  12065. })
  12066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12067. }
  12068. // Do executes the "tagmanager.accounts.containers.workspaces.zones.get" call.
  12069. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  12070. // code is an error. Response headers are in either
  12071. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  12072. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12073. // whether the returned error was because http.StatusNotModified was
  12074. // returned.
  12075. func (c *AccountsContainersWorkspacesZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  12076. gensupport.SetOptions(c.urlParams_, opts...)
  12077. res, err := c.doRequest("json")
  12078. if res != nil && res.StatusCode == http.StatusNotModified {
  12079. if res.Body != nil {
  12080. res.Body.Close()
  12081. }
  12082. return nil, &googleapi.Error{
  12083. Code: res.StatusCode,
  12084. Header: res.Header,
  12085. }
  12086. }
  12087. if err != nil {
  12088. return nil, err
  12089. }
  12090. defer googleapi.CloseBody(res)
  12091. if err := googleapi.CheckResponse(res); err != nil {
  12092. return nil, err
  12093. }
  12094. ret := &Zone{
  12095. ServerResponse: googleapi.ServerResponse{
  12096. Header: res.Header,
  12097. HTTPStatusCode: res.StatusCode,
  12098. },
  12099. }
  12100. target := &ret
  12101. if err := gensupport.DecodeResponse(target, res); err != nil {
  12102. return nil, err
  12103. }
  12104. return ret, nil
  12105. // {
  12106. // "description": "Gets a GTM Zone.",
  12107. // "httpMethod": "GET",
  12108. // "id": "tagmanager.accounts.containers.workspaces.zones.get",
  12109. // "parameterOrder": [
  12110. // "path"
  12111. // ],
  12112. // "parameters": {
  12113. // "path": {
  12114. // "description": "GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}",
  12115. // "location": "path",
  12116. // "required": true,
  12117. // "type": "string"
  12118. // }
  12119. // },
  12120. // "path": "{+path}",
  12121. // "response": {
  12122. // "$ref": "Zone"
  12123. // },
  12124. // "scopes": [
  12125. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  12126. // "https://www.googleapis.com/auth/tagmanager.readonly"
  12127. // ]
  12128. // }
  12129. }
  12130. // method id "tagmanager.accounts.containers.workspaces.zones.list":
  12131. type AccountsContainersWorkspacesZonesListCall struct {
  12132. s *Service
  12133. parent string
  12134. urlParams_ gensupport.URLParams
  12135. ifNoneMatch_ string
  12136. ctx_ context.Context
  12137. header_ http.Header
  12138. }
  12139. // List: Lists all GTM Zones of a GTM container workspace.
  12140. func (r *AccountsContainersWorkspacesZonesService) List(parent string) *AccountsContainersWorkspacesZonesListCall {
  12141. c := &AccountsContainersWorkspacesZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12142. c.parent = parent
  12143. return c
  12144. }
  12145. // PageToken sets the optional parameter "pageToken": Continuation token
  12146. // for fetching the next page of results.
  12147. func (c *AccountsContainersWorkspacesZonesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesZonesListCall {
  12148. c.urlParams_.Set("pageToken", pageToken)
  12149. return c
  12150. }
  12151. // Fields allows partial responses to be retrieved. See
  12152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12153. // for more information.
  12154. func (c *AccountsContainersWorkspacesZonesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesZonesListCall {
  12155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12156. return c
  12157. }
  12158. // IfNoneMatch sets the optional parameter which makes the operation
  12159. // fail if the object's ETag matches the given value. This is useful for
  12160. // getting updates only after the object has changed since the last
  12161. // request. Use googleapi.IsNotModified to check whether the response
  12162. // error from Do is the result of In-None-Match.
  12163. func (c *AccountsContainersWorkspacesZonesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesZonesListCall {
  12164. c.ifNoneMatch_ = entityTag
  12165. return c
  12166. }
  12167. // Context sets the context to be used in this call's Do method. Any
  12168. // pending HTTP request will be aborted if the provided context is
  12169. // canceled.
  12170. func (c *AccountsContainersWorkspacesZonesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesZonesListCall {
  12171. c.ctx_ = ctx
  12172. return c
  12173. }
  12174. // Header returns an http.Header that can be modified by the caller to
  12175. // add HTTP headers to the request.
  12176. func (c *AccountsContainersWorkspacesZonesListCall) Header() http.Header {
  12177. if c.header_ == nil {
  12178. c.header_ = make(http.Header)
  12179. }
  12180. return c.header_
  12181. }
  12182. func (c *AccountsContainersWorkspacesZonesListCall) doRequest(alt string) (*http.Response, error) {
  12183. reqHeaders := make(http.Header)
  12184. for k, v := range c.header_ {
  12185. reqHeaders[k] = v
  12186. }
  12187. reqHeaders.Set("User-Agent", c.s.userAgent())
  12188. if c.ifNoneMatch_ != "" {
  12189. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12190. }
  12191. var body io.Reader = nil
  12192. c.urlParams_.Set("alt", alt)
  12193. c.urlParams_.Set("prettyPrint", "false")
  12194. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/zones")
  12195. urls += "?" + c.urlParams_.Encode()
  12196. req, err := http.NewRequest("GET", urls, body)
  12197. if err != nil {
  12198. return nil, err
  12199. }
  12200. req.Header = reqHeaders
  12201. googleapi.Expand(req.URL, map[string]string{
  12202. "parent": c.parent,
  12203. })
  12204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12205. }
  12206. // Do executes the "tagmanager.accounts.containers.workspaces.zones.list" call.
  12207. // Exactly one of *ListZonesResponse or error will be non-nil. Any
  12208. // non-2xx status code is an error. Response headers are in either
  12209. // *ListZonesResponse.ServerResponse.Header or (if a response was
  12210. // returned at all) in error.(*googleapi.Error).Header. Use
  12211. // googleapi.IsNotModified to check whether the returned error was
  12212. // because http.StatusNotModified was returned.
  12213. func (c *AccountsContainersWorkspacesZonesListCall) Do(opts ...googleapi.CallOption) (*ListZonesResponse, error) {
  12214. gensupport.SetOptions(c.urlParams_, opts...)
  12215. res, err := c.doRequest("json")
  12216. if res != nil && res.StatusCode == http.StatusNotModified {
  12217. if res.Body != nil {
  12218. res.Body.Close()
  12219. }
  12220. return nil, &googleapi.Error{
  12221. Code: res.StatusCode,
  12222. Header: res.Header,
  12223. }
  12224. }
  12225. if err != nil {
  12226. return nil, err
  12227. }
  12228. defer googleapi.CloseBody(res)
  12229. if err := googleapi.CheckResponse(res); err != nil {
  12230. return nil, err
  12231. }
  12232. ret := &ListZonesResponse{
  12233. ServerResponse: googleapi.ServerResponse{
  12234. Header: res.Header,
  12235. HTTPStatusCode: res.StatusCode,
  12236. },
  12237. }
  12238. target := &ret
  12239. if err := gensupport.DecodeResponse(target, res); err != nil {
  12240. return nil, err
  12241. }
  12242. return ret, nil
  12243. // {
  12244. // "description": "Lists all GTM Zones of a GTM container workspace.",
  12245. // "httpMethod": "GET",
  12246. // "id": "tagmanager.accounts.containers.workspaces.zones.list",
  12247. // "parameterOrder": [
  12248. // "parent"
  12249. // ],
  12250. // "parameters": {
  12251. // "pageToken": {
  12252. // "description": "Continuation token for fetching the next page of results.",
  12253. // "location": "query",
  12254. // "type": "string"
  12255. // },
  12256. // "parent": {
  12257. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  12258. // "location": "path",
  12259. // "required": true,
  12260. // "type": "string"
  12261. // }
  12262. // },
  12263. // "path": "{+parent}/zones",
  12264. // "response": {
  12265. // "$ref": "ListZonesResponse"
  12266. // },
  12267. // "scopes": [
  12268. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  12269. // "https://www.googleapis.com/auth/tagmanager.readonly"
  12270. // ]
  12271. // }
  12272. }
  12273. // Pages invokes f for each page of results.
  12274. // A non-nil error returned from f will halt the iteration.
  12275. // The provided context supersedes any context provided to the Context method.
  12276. func (c *AccountsContainersWorkspacesZonesListCall) Pages(ctx context.Context, f func(*ListZonesResponse) error) error {
  12277. c.ctx_ = ctx
  12278. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12279. for {
  12280. x, err := c.Do()
  12281. if err != nil {
  12282. return err
  12283. }
  12284. if err := f(x); err != nil {
  12285. return err
  12286. }
  12287. if x.NextPageToken == "" {
  12288. return nil
  12289. }
  12290. c.PageToken(x.NextPageToken)
  12291. }
  12292. }
  12293. // method id "tagmanager.accounts.containers.workspaces.zones.revert":
  12294. type AccountsContainersWorkspacesZonesRevertCall struct {
  12295. s *Service
  12296. path string
  12297. urlParams_ gensupport.URLParams
  12298. ctx_ context.Context
  12299. header_ http.Header
  12300. }
  12301. // Revert: Reverts changes to a GTM Zone in a GTM Workspace.
  12302. func (r *AccountsContainersWorkspacesZonesService) Revert(path string) *AccountsContainersWorkspacesZonesRevertCall {
  12303. c := &AccountsContainersWorkspacesZonesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12304. c.path = path
  12305. return c
  12306. }
  12307. // Fingerprint sets the optional parameter "fingerprint": When provided,
  12308. // this fingerprint must match the fingerprint of the zone in storage.
  12309. func (c *AccountsContainersWorkspacesZonesRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesZonesRevertCall {
  12310. c.urlParams_.Set("fingerprint", fingerprint)
  12311. return c
  12312. }
  12313. // Fields allows partial responses to be retrieved. See
  12314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12315. // for more information.
  12316. func (c *AccountsContainersWorkspacesZonesRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesZonesRevertCall {
  12317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12318. return c
  12319. }
  12320. // Context sets the context to be used in this call's Do method. Any
  12321. // pending HTTP request will be aborted if the provided context is
  12322. // canceled.
  12323. func (c *AccountsContainersWorkspacesZonesRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesZonesRevertCall {
  12324. c.ctx_ = ctx
  12325. return c
  12326. }
  12327. // Header returns an http.Header that can be modified by the caller to
  12328. // add HTTP headers to the request.
  12329. func (c *AccountsContainersWorkspacesZonesRevertCall) Header() http.Header {
  12330. if c.header_ == nil {
  12331. c.header_ = make(http.Header)
  12332. }
  12333. return c.header_
  12334. }
  12335. func (c *AccountsContainersWorkspacesZonesRevertCall) doRequest(alt string) (*http.Response, error) {
  12336. reqHeaders := make(http.Header)
  12337. for k, v := range c.header_ {
  12338. reqHeaders[k] = v
  12339. }
  12340. reqHeaders.Set("User-Agent", c.s.userAgent())
  12341. var body io.Reader = nil
  12342. c.urlParams_.Set("alt", alt)
  12343. c.urlParams_.Set("prettyPrint", "false")
  12344. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  12345. urls += "?" + c.urlParams_.Encode()
  12346. req, err := http.NewRequest("POST", urls, body)
  12347. if err != nil {
  12348. return nil, err
  12349. }
  12350. req.Header = reqHeaders
  12351. googleapi.Expand(req.URL, map[string]string{
  12352. "path": c.path,
  12353. })
  12354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12355. }
  12356. // Do executes the "tagmanager.accounts.containers.workspaces.zones.revert" call.
  12357. // Exactly one of *RevertZoneResponse or error will be non-nil. Any
  12358. // non-2xx status code is an error. Response headers are in either
  12359. // *RevertZoneResponse.ServerResponse.Header or (if a response was
  12360. // returned at all) in error.(*googleapi.Error).Header. Use
  12361. // googleapi.IsNotModified to check whether the returned error was
  12362. // because http.StatusNotModified was returned.
  12363. func (c *AccountsContainersWorkspacesZonesRevertCall) Do(opts ...googleapi.CallOption) (*RevertZoneResponse, error) {
  12364. gensupport.SetOptions(c.urlParams_, opts...)
  12365. res, err := c.doRequest("json")
  12366. if res != nil && res.StatusCode == http.StatusNotModified {
  12367. if res.Body != nil {
  12368. res.Body.Close()
  12369. }
  12370. return nil, &googleapi.Error{
  12371. Code: res.StatusCode,
  12372. Header: res.Header,
  12373. }
  12374. }
  12375. if err != nil {
  12376. return nil, err
  12377. }
  12378. defer googleapi.CloseBody(res)
  12379. if err := googleapi.CheckResponse(res); err != nil {
  12380. return nil, err
  12381. }
  12382. ret := &RevertZoneResponse{
  12383. ServerResponse: googleapi.ServerResponse{
  12384. Header: res.Header,
  12385. HTTPStatusCode: res.StatusCode,
  12386. },
  12387. }
  12388. target := &ret
  12389. if err := gensupport.DecodeResponse(target, res); err != nil {
  12390. return nil, err
  12391. }
  12392. return ret, nil
  12393. // {
  12394. // "description": "Reverts changes to a GTM Zone in a GTM Workspace.",
  12395. // "httpMethod": "POST",
  12396. // "id": "tagmanager.accounts.containers.workspaces.zones.revert",
  12397. // "parameterOrder": [
  12398. // "path"
  12399. // ],
  12400. // "parameters": {
  12401. // "fingerprint": {
  12402. // "description": "When provided, this fingerprint must match the fingerprint of the zone in storage.",
  12403. // "location": "query",
  12404. // "type": "string"
  12405. // },
  12406. // "path": {
  12407. // "description": "GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}",
  12408. // "location": "path",
  12409. // "required": true,
  12410. // "type": "string"
  12411. // }
  12412. // },
  12413. // "path": "{+path}:revert",
  12414. // "response": {
  12415. // "$ref": "RevertZoneResponse"
  12416. // },
  12417. // "scopes": [
  12418. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  12419. // ]
  12420. // }
  12421. }
  12422. // method id "tagmanager.accounts.containers.workspaces.zones.update":
  12423. type AccountsContainersWorkspacesZonesUpdateCall struct {
  12424. s *Service
  12425. path string
  12426. zone *Zone
  12427. urlParams_ gensupport.URLParams
  12428. ctx_ context.Context
  12429. header_ http.Header
  12430. }
  12431. // Update: Updates a GTM Zone.
  12432. func (r *AccountsContainersWorkspacesZonesService) Update(path string, zone *Zone) *AccountsContainersWorkspacesZonesUpdateCall {
  12433. c := &AccountsContainersWorkspacesZonesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12434. c.path = path
  12435. c.zone = zone
  12436. return c
  12437. }
  12438. // Fingerprint sets the optional parameter "fingerprint": When provided,
  12439. // this fingerprint must match the fingerprint of the zone in storage.
  12440. func (c *AccountsContainersWorkspacesZonesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesZonesUpdateCall {
  12441. c.urlParams_.Set("fingerprint", fingerprint)
  12442. return c
  12443. }
  12444. // Fields allows partial responses to be retrieved. See
  12445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12446. // for more information.
  12447. func (c *AccountsContainersWorkspacesZonesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesZonesUpdateCall {
  12448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12449. return c
  12450. }
  12451. // Context sets the context to be used in this call's Do method. Any
  12452. // pending HTTP request will be aborted if the provided context is
  12453. // canceled.
  12454. func (c *AccountsContainersWorkspacesZonesUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesZonesUpdateCall {
  12455. c.ctx_ = ctx
  12456. return c
  12457. }
  12458. // Header returns an http.Header that can be modified by the caller to
  12459. // add HTTP headers to the request.
  12460. func (c *AccountsContainersWorkspacesZonesUpdateCall) Header() http.Header {
  12461. if c.header_ == nil {
  12462. c.header_ = make(http.Header)
  12463. }
  12464. return c.header_
  12465. }
  12466. func (c *AccountsContainersWorkspacesZonesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12467. reqHeaders := make(http.Header)
  12468. for k, v := range c.header_ {
  12469. reqHeaders[k] = v
  12470. }
  12471. reqHeaders.Set("User-Agent", c.s.userAgent())
  12472. var body io.Reader = nil
  12473. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zone)
  12474. if err != nil {
  12475. return nil, err
  12476. }
  12477. reqHeaders.Set("Content-Type", "application/json")
  12478. c.urlParams_.Set("alt", alt)
  12479. c.urlParams_.Set("prettyPrint", "false")
  12480. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12481. urls += "?" + c.urlParams_.Encode()
  12482. req, err := http.NewRequest("PUT", urls, body)
  12483. if err != nil {
  12484. return nil, err
  12485. }
  12486. req.Header = reqHeaders
  12487. googleapi.Expand(req.URL, map[string]string{
  12488. "path": c.path,
  12489. })
  12490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12491. }
  12492. // Do executes the "tagmanager.accounts.containers.workspaces.zones.update" call.
  12493. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  12494. // code is an error. Response headers are in either
  12495. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  12496. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12497. // whether the returned error was because http.StatusNotModified was
  12498. // returned.
  12499. func (c *AccountsContainersWorkspacesZonesUpdateCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  12500. gensupport.SetOptions(c.urlParams_, opts...)
  12501. res, err := c.doRequest("json")
  12502. if res != nil && res.StatusCode == http.StatusNotModified {
  12503. if res.Body != nil {
  12504. res.Body.Close()
  12505. }
  12506. return nil, &googleapi.Error{
  12507. Code: res.StatusCode,
  12508. Header: res.Header,
  12509. }
  12510. }
  12511. if err != nil {
  12512. return nil, err
  12513. }
  12514. defer googleapi.CloseBody(res)
  12515. if err := googleapi.CheckResponse(res); err != nil {
  12516. return nil, err
  12517. }
  12518. ret := &Zone{
  12519. ServerResponse: googleapi.ServerResponse{
  12520. Header: res.Header,
  12521. HTTPStatusCode: res.StatusCode,
  12522. },
  12523. }
  12524. target := &ret
  12525. if err := gensupport.DecodeResponse(target, res); err != nil {
  12526. return nil, err
  12527. }
  12528. return ret, nil
  12529. // {
  12530. // "description": "Updates a GTM Zone.",
  12531. // "httpMethod": "PUT",
  12532. // "id": "tagmanager.accounts.containers.workspaces.zones.update",
  12533. // "parameterOrder": [
  12534. // "path"
  12535. // ],
  12536. // "parameters": {
  12537. // "fingerprint": {
  12538. // "description": "When provided, this fingerprint must match the fingerprint of the zone in storage.",
  12539. // "location": "query",
  12540. // "type": "string"
  12541. // },
  12542. // "path": {
  12543. // "description": "GTM Zone's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/zones/{zone_id}",
  12544. // "location": "path",
  12545. // "required": true,
  12546. // "type": "string"
  12547. // }
  12548. // },
  12549. // "path": "{+path}",
  12550. // "request": {
  12551. // "$ref": "Zone"
  12552. // },
  12553. // "response": {
  12554. // "$ref": "Zone"
  12555. // },
  12556. // "scopes": [
  12557. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  12558. // ]
  12559. // }
  12560. }
  12561. // method id "tagmanager.accounts.user_permissions.create":
  12562. type AccountsUserPermissionsCreateCall struct {
  12563. s *Service
  12564. parent string
  12565. userpermission *UserPermission
  12566. urlParams_ gensupport.URLParams
  12567. ctx_ context.Context
  12568. header_ http.Header
  12569. }
  12570. // Create: Creates a user's Account & Container access.
  12571. func (r *AccountsUserPermissionsService) Create(parent string, userpermission *UserPermission) *AccountsUserPermissionsCreateCall {
  12572. c := &AccountsUserPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12573. c.parent = parent
  12574. c.userpermission = userpermission
  12575. return c
  12576. }
  12577. // Fields allows partial responses to be retrieved. See
  12578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12579. // for more information.
  12580. func (c *AccountsUserPermissionsCreateCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsCreateCall {
  12581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12582. return c
  12583. }
  12584. // Context sets the context to be used in this call's Do method. Any
  12585. // pending HTTP request will be aborted if the provided context is
  12586. // canceled.
  12587. func (c *AccountsUserPermissionsCreateCall) Context(ctx context.Context) *AccountsUserPermissionsCreateCall {
  12588. c.ctx_ = ctx
  12589. return c
  12590. }
  12591. // Header returns an http.Header that can be modified by the caller to
  12592. // add HTTP headers to the request.
  12593. func (c *AccountsUserPermissionsCreateCall) Header() http.Header {
  12594. if c.header_ == nil {
  12595. c.header_ = make(http.Header)
  12596. }
  12597. return c.header_
  12598. }
  12599. func (c *AccountsUserPermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
  12600. reqHeaders := make(http.Header)
  12601. for k, v := range c.header_ {
  12602. reqHeaders[k] = v
  12603. }
  12604. reqHeaders.Set("User-Agent", c.s.userAgent())
  12605. var body io.Reader = nil
  12606. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userpermission)
  12607. if err != nil {
  12608. return nil, err
  12609. }
  12610. reqHeaders.Set("Content-Type", "application/json")
  12611. c.urlParams_.Set("alt", alt)
  12612. c.urlParams_.Set("prettyPrint", "false")
  12613. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/user_permissions")
  12614. urls += "?" + c.urlParams_.Encode()
  12615. req, err := http.NewRequest("POST", urls, body)
  12616. if err != nil {
  12617. return nil, err
  12618. }
  12619. req.Header = reqHeaders
  12620. googleapi.Expand(req.URL, map[string]string{
  12621. "parent": c.parent,
  12622. })
  12623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12624. }
  12625. // Do executes the "tagmanager.accounts.user_permissions.create" call.
  12626. // Exactly one of *UserPermission or error will be non-nil. Any non-2xx
  12627. // status code is an error. Response headers are in either
  12628. // *UserPermission.ServerResponse.Header or (if a response was returned
  12629. // at all) in error.(*googleapi.Error).Header. Use
  12630. // googleapi.IsNotModified to check whether the returned error was
  12631. // because http.StatusNotModified was returned.
  12632. func (c *AccountsUserPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*UserPermission, error) {
  12633. gensupport.SetOptions(c.urlParams_, opts...)
  12634. res, err := c.doRequest("json")
  12635. if res != nil && res.StatusCode == http.StatusNotModified {
  12636. if res.Body != nil {
  12637. res.Body.Close()
  12638. }
  12639. return nil, &googleapi.Error{
  12640. Code: res.StatusCode,
  12641. Header: res.Header,
  12642. }
  12643. }
  12644. if err != nil {
  12645. return nil, err
  12646. }
  12647. defer googleapi.CloseBody(res)
  12648. if err := googleapi.CheckResponse(res); err != nil {
  12649. return nil, err
  12650. }
  12651. ret := &UserPermission{
  12652. ServerResponse: googleapi.ServerResponse{
  12653. Header: res.Header,
  12654. HTTPStatusCode: res.StatusCode,
  12655. },
  12656. }
  12657. target := &ret
  12658. if err := gensupport.DecodeResponse(target, res); err != nil {
  12659. return nil, err
  12660. }
  12661. return ret, nil
  12662. // {
  12663. // "description": "Creates a user's Account \u0026 Container access.",
  12664. // "httpMethod": "POST",
  12665. // "id": "tagmanager.accounts.user_permissions.create",
  12666. // "parameterOrder": [
  12667. // "parent"
  12668. // ],
  12669. // "parameters": {
  12670. // "parent": {
  12671. // "description": "GTM Account's API relative path. Example: accounts/{account_id}",
  12672. // "location": "path",
  12673. // "required": true,
  12674. // "type": "string"
  12675. // }
  12676. // },
  12677. // "path": "{+parent}/user_permissions",
  12678. // "request": {
  12679. // "$ref": "UserPermission"
  12680. // },
  12681. // "response": {
  12682. // "$ref": "UserPermission"
  12683. // },
  12684. // "scopes": [
  12685. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12686. // ]
  12687. // }
  12688. }
  12689. // method id "tagmanager.accounts.user_permissions.delete":
  12690. type AccountsUserPermissionsDeleteCall struct {
  12691. s *Service
  12692. path string
  12693. urlParams_ gensupport.URLParams
  12694. ctx_ context.Context
  12695. header_ http.Header
  12696. }
  12697. // Delete: Removes a user from the account, revoking access to it and
  12698. // all of its containers.
  12699. func (r *AccountsUserPermissionsService) Delete(path string) *AccountsUserPermissionsDeleteCall {
  12700. c := &AccountsUserPermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12701. c.path = path
  12702. return c
  12703. }
  12704. // Fields allows partial responses to be retrieved. See
  12705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12706. // for more information.
  12707. func (c *AccountsUserPermissionsDeleteCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsDeleteCall {
  12708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12709. return c
  12710. }
  12711. // Context sets the context to be used in this call's Do method. Any
  12712. // pending HTTP request will be aborted if the provided context is
  12713. // canceled.
  12714. func (c *AccountsUserPermissionsDeleteCall) Context(ctx context.Context) *AccountsUserPermissionsDeleteCall {
  12715. c.ctx_ = ctx
  12716. return c
  12717. }
  12718. // Header returns an http.Header that can be modified by the caller to
  12719. // add HTTP headers to the request.
  12720. func (c *AccountsUserPermissionsDeleteCall) Header() http.Header {
  12721. if c.header_ == nil {
  12722. c.header_ = make(http.Header)
  12723. }
  12724. return c.header_
  12725. }
  12726. func (c *AccountsUserPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  12727. reqHeaders := make(http.Header)
  12728. for k, v := range c.header_ {
  12729. reqHeaders[k] = v
  12730. }
  12731. reqHeaders.Set("User-Agent", c.s.userAgent())
  12732. var body io.Reader = nil
  12733. c.urlParams_.Set("alt", alt)
  12734. c.urlParams_.Set("prettyPrint", "false")
  12735. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12736. urls += "?" + c.urlParams_.Encode()
  12737. req, err := http.NewRequest("DELETE", urls, body)
  12738. if err != nil {
  12739. return nil, err
  12740. }
  12741. req.Header = reqHeaders
  12742. googleapi.Expand(req.URL, map[string]string{
  12743. "path": c.path,
  12744. })
  12745. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12746. }
  12747. // Do executes the "tagmanager.accounts.user_permissions.delete" call.
  12748. func (c *AccountsUserPermissionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  12749. gensupport.SetOptions(c.urlParams_, opts...)
  12750. res, err := c.doRequest("json")
  12751. if err != nil {
  12752. return err
  12753. }
  12754. defer googleapi.CloseBody(res)
  12755. if err := googleapi.CheckResponse(res); err != nil {
  12756. return err
  12757. }
  12758. return nil
  12759. // {
  12760. // "description": "Removes a user from the account, revoking access to it and all of its containers.",
  12761. // "httpMethod": "DELETE",
  12762. // "id": "tagmanager.accounts.user_permissions.delete",
  12763. // "parameterOrder": [
  12764. // "path"
  12765. // ],
  12766. // "parameters": {
  12767. // "path": {
  12768. // "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}",
  12769. // "location": "path",
  12770. // "required": true,
  12771. // "type": "string"
  12772. // }
  12773. // },
  12774. // "path": "{+path}",
  12775. // "scopes": [
  12776. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12777. // ]
  12778. // }
  12779. }
  12780. // method id "tagmanager.accounts.user_permissions.get":
  12781. type AccountsUserPermissionsGetCall struct {
  12782. s *Service
  12783. path string
  12784. urlParams_ gensupport.URLParams
  12785. ifNoneMatch_ string
  12786. ctx_ context.Context
  12787. header_ http.Header
  12788. }
  12789. // Get: Gets a user's Account & Container access.
  12790. func (r *AccountsUserPermissionsService) Get(path string) *AccountsUserPermissionsGetCall {
  12791. c := &AccountsUserPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12792. c.path = path
  12793. return c
  12794. }
  12795. // Fields allows partial responses to be retrieved. See
  12796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12797. // for more information.
  12798. func (c *AccountsUserPermissionsGetCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsGetCall {
  12799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12800. return c
  12801. }
  12802. // IfNoneMatch sets the optional parameter which makes the operation
  12803. // fail if the object's ETag matches the given value. This is useful for
  12804. // getting updates only after the object has changed since the last
  12805. // request. Use googleapi.IsNotModified to check whether the response
  12806. // error from Do is the result of In-None-Match.
  12807. func (c *AccountsUserPermissionsGetCall) IfNoneMatch(entityTag string) *AccountsUserPermissionsGetCall {
  12808. c.ifNoneMatch_ = entityTag
  12809. return c
  12810. }
  12811. // Context sets the context to be used in this call's Do method. Any
  12812. // pending HTTP request will be aborted if the provided context is
  12813. // canceled.
  12814. func (c *AccountsUserPermissionsGetCall) Context(ctx context.Context) *AccountsUserPermissionsGetCall {
  12815. c.ctx_ = ctx
  12816. return c
  12817. }
  12818. // Header returns an http.Header that can be modified by the caller to
  12819. // add HTTP headers to the request.
  12820. func (c *AccountsUserPermissionsGetCall) Header() http.Header {
  12821. if c.header_ == nil {
  12822. c.header_ = make(http.Header)
  12823. }
  12824. return c.header_
  12825. }
  12826. func (c *AccountsUserPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12827. reqHeaders := make(http.Header)
  12828. for k, v := range c.header_ {
  12829. reqHeaders[k] = v
  12830. }
  12831. reqHeaders.Set("User-Agent", c.s.userAgent())
  12832. if c.ifNoneMatch_ != "" {
  12833. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12834. }
  12835. var body io.Reader = nil
  12836. c.urlParams_.Set("alt", alt)
  12837. c.urlParams_.Set("prettyPrint", "false")
  12838. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12839. urls += "?" + c.urlParams_.Encode()
  12840. req, err := http.NewRequest("GET", urls, body)
  12841. if err != nil {
  12842. return nil, err
  12843. }
  12844. req.Header = reqHeaders
  12845. googleapi.Expand(req.URL, map[string]string{
  12846. "path": c.path,
  12847. })
  12848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12849. }
  12850. // Do executes the "tagmanager.accounts.user_permissions.get" call.
  12851. // Exactly one of *UserPermission or error will be non-nil. Any non-2xx
  12852. // status code is an error. Response headers are in either
  12853. // *UserPermission.ServerResponse.Header or (if a response was returned
  12854. // at all) in error.(*googleapi.Error).Header. Use
  12855. // googleapi.IsNotModified to check whether the returned error was
  12856. // because http.StatusNotModified was returned.
  12857. func (c *AccountsUserPermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserPermission, error) {
  12858. gensupport.SetOptions(c.urlParams_, opts...)
  12859. res, err := c.doRequest("json")
  12860. if res != nil && res.StatusCode == http.StatusNotModified {
  12861. if res.Body != nil {
  12862. res.Body.Close()
  12863. }
  12864. return nil, &googleapi.Error{
  12865. Code: res.StatusCode,
  12866. Header: res.Header,
  12867. }
  12868. }
  12869. if err != nil {
  12870. return nil, err
  12871. }
  12872. defer googleapi.CloseBody(res)
  12873. if err := googleapi.CheckResponse(res); err != nil {
  12874. return nil, err
  12875. }
  12876. ret := &UserPermission{
  12877. ServerResponse: googleapi.ServerResponse{
  12878. Header: res.Header,
  12879. HTTPStatusCode: res.StatusCode,
  12880. },
  12881. }
  12882. target := &ret
  12883. if err := gensupport.DecodeResponse(target, res); err != nil {
  12884. return nil, err
  12885. }
  12886. return ret, nil
  12887. // {
  12888. // "description": "Gets a user's Account \u0026 Container access.",
  12889. // "httpMethod": "GET",
  12890. // "id": "tagmanager.accounts.user_permissions.get",
  12891. // "parameterOrder": [
  12892. // "path"
  12893. // ],
  12894. // "parameters": {
  12895. // "path": {
  12896. // "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}",
  12897. // "location": "path",
  12898. // "required": true,
  12899. // "type": "string"
  12900. // }
  12901. // },
  12902. // "path": "{+path}",
  12903. // "response": {
  12904. // "$ref": "UserPermission"
  12905. // },
  12906. // "scopes": [
  12907. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12908. // ]
  12909. // }
  12910. }
  12911. // method id "tagmanager.accounts.user_permissions.list":
  12912. type AccountsUserPermissionsListCall struct {
  12913. s *Service
  12914. parent string
  12915. urlParams_ gensupport.URLParams
  12916. ifNoneMatch_ string
  12917. ctx_ context.Context
  12918. header_ http.Header
  12919. }
  12920. // List: List all users that have access to the account along with
  12921. // Account and Container user access granted to each of them.
  12922. func (r *AccountsUserPermissionsService) List(parent string) *AccountsUserPermissionsListCall {
  12923. c := &AccountsUserPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12924. c.parent = parent
  12925. return c
  12926. }
  12927. // PageToken sets the optional parameter "pageToken": Continuation token
  12928. // for fetching the next page of results.
  12929. func (c *AccountsUserPermissionsListCall) PageToken(pageToken string) *AccountsUserPermissionsListCall {
  12930. c.urlParams_.Set("pageToken", pageToken)
  12931. return c
  12932. }
  12933. // Fields allows partial responses to be retrieved. See
  12934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12935. // for more information.
  12936. func (c *AccountsUserPermissionsListCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsListCall {
  12937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12938. return c
  12939. }
  12940. // IfNoneMatch sets the optional parameter which makes the operation
  12941. // fail if the object's ETag matches the given value. This is useful for
  12942. // getting updates only after the object has changed since the last
  12943. // request. Use googleapi.IsNotModified to check whether the response
  12944. // error from Do is the result of In-None-Match.
  12945. func (c *AccountsUserPermissionsListCall) IfNoneMatch(entityTag string) *AccountsUserPermissionsListCall {
  12946. c.ifNoneMatch_ = entityTag
  12947. return c
  12948. }
  12949. // Context sets the context to be used in this call's Do method. Any
  12950. // pending HTTP request will be aborted if the provided context is
  12951. // canceled.
  12952. func (c *AccountsUserPermissionsListCall) Context(ctx context.Context) *AccountsUserPermissionsListCall {
  12953. c.ctx_ = ctx
  12954. return c
  12955. }
  12956. // Header returns an http.Header that can be modified by the caller to
  12957. // add HTTP headers to the request.
  12958. func (c *AccountsUserPermissionsListCall) Header() http.Header {
  12959. if c.header_ == nil {
  12960. c.header_ = make(http.Header)
  12961. }
  12962. return c.header_
  12963. }
  12964. func (c *AccountsUserPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12965. reqHeaders := make(http.Header)
  12966. for k, v := range c.header_ {
  12967. reqHeaders[k] = v
  12968. }
  12969. reqHeaders.Set("User-Agent", c.s.userAgent())
  12970. if c.ifNoneMatch_ != "" {
  12971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12972. }
  12973. var body io.Reader = nil
  12974. c.urlParams_.Set("alt", alt)
  12975. c.urlParams_.Set("prettyPrint", "false")
  12976. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/user_permissions")
  12977. urls += "?" + c.urlParams_.Encode()
  12978. req, err := http.NewRequest("GET", urls, body)
  12979. if err != nil {
  12980. return nil, err
  12981. }
  12982. req.Header = reqHeaders
  12983. googleapi.Expand(req.URL, map[string]string{
  12984. "parent": c.parent,
  12985. })
  12986. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12987. }
  12988. // Do executes the "tagmanager.accounts.user_permissions.list" call.
  12989. // Exactly one of *ListUserPermissionsResponse or error will be non-nil.
  12990. // Any non-2xx status code is an error. Response headers are in either
  12991. // *ListUserPermissionsResponse.ServerResponse.Header or (if a response
  12992. // was returned at all) in error.(*googleapi.Error).Header. Use
  12993. // googleapi.IsNotModified to check whether the returned error was
  12994. // because http.StatusNotModified was returned.
  12995. func (c *AccountsUserPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListUserPermissionsResponse, error) {
  12996. gensupport.SetOptions(c.urlParams_, opts...)
  12997. res, err := c.doRequest("json")
  12998. if res != nil && res.StatusCode == http.StatusNotModified {
  12999. if res.Body != nil {
  13000. res.Body.Close()
  13001. }
  13002. return nil, &googleapi.Error{
  13003. Code: res.StatusCode,
  13004. Header: res.Header,
  13005. }
  13006. }
  13007. if err != nil {
  13008. return nil, err
  13009. }
  13010. defer googleapi.CloseBody(res)
  13011. if err := googleapi.CheckResponse(res); err != nil {
  13012. return nil, err
  13013. }
  13014. ret := &ListUserPermissionsResponse{
  13015. ServerResponse: googleapi.ServerResponse{
  13016. Header: res.Header,
  13017. HTTPStatusCode: res.StatusCode,
  13018. },
  13019. }
  13020. target := &ret
  13021. if err := gensupport.DecodeResponse(target, res); err != nil {
  13022. return nil, err
  13023. }
  13024. return ret, nil
  13025. // {
  13026. // "description": "List all users that have access to the account along with Account and Container user access granted to each of them.",
  13027. // "httpMethod": "GET",
  13028. // "id": "tagmanager.accounts.user_permissions.list",
  13029. // "parameterOrder": [
  13030. // "parent"
  13031. // ],
  13032. // "parameters": {
  13033. // "pageToken": {
  13034. // "description": "Continuation token for fetching the next page of results.",
  13035. // "location": "query",
  13036. // "type": "string"
  13037. // },
  13038. // "parent": {
  13039. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}",
  13040. // "location": "path",
  13041. // "required": true,
  13042. // "type": "string"
  13043. // }
  13044. // },
  13045. // "path": "{+parent}/user_permissions",
  13046. // "response": {
  13047. // "$ref": "ListUserPermissionsResponse"
  13048. // },
  13049. // "scopes": [
  13050. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  13051. // ]
  13052. // }
  13053. }
  13054. // Pages invokes f for each page of results.
  13055. // A non-nil error returned from f will halt the iteration.
  13056. // The provided context supersedes any context provided to the Context method.
  13057. func (c *AccountsUserPermissionsListCall) Pages(ctx context.Context, f func(*ListUserPermissionsResponse) error) error {
  13058. c.ctx_ = ctx
  13059. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13060. for {
  13061. x, err := c.Do()
  13062. if err != nil {
  13063. return err
  13064. }
  13065. if err := f(x); err != nil {
  13066. return err
  13067. }
  13068. if x.NextPageToken == "" {
  13069. return nil
  13070. }
  13071. c.PageToken(x.NextPageToken)
  13072. }
  13073. }
  13074. // method id "tagmanager.accounts.user_permissions.update":
  13075. type AccountsUserPermissionsUpdateCall struct {
  13076. s *Service
  13077. path string
  13078. userpermission *UserPermission
  13079. urlParams_ gensupport.URLParams
  13080. ctx_ context.Context
  13081. header_ http.Header
  13082. }
  13083. // Update: Updates a user's Account & Container access.
  13084. func (r *AccountsUserPermissionsService) Update(path string, userpermission *UserPermission) *AccountsUserPermissionsUpdateCall {
  13085. c := &AccountsUserPermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13086. c.path = path
  13087. c.userpermission = userpermission
  13088. return c
  13089. }
  13090. // Fields allows partial responses to be retrieved. See
  13091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13092. // for more information.
  13093. func (c *AccountsUserPermissionsUpdateCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsUpdateCall {
  13094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13095. return c
  13096. }
  13097. // Context sets the context to be used in this call's Do method. Any
  13098. // pending HTTP request will be aborted if the provided context is
  13099. // canceled.
  13100. func (c *AccountsUserPermissionsUpdateCall) Context(ctx context.Context) *AccountsUserPermissionsUpdateCall {
  13101. c.ctx_ = ctx
  13102. return c
  13103. }
  13104. // Header returns an http.Header that can be modified by the caller to
  13105. // add HTTP headers to the request.
  13106. func (c *AccountsUserPermissionsUpdateCall) Header() http.Header {
  13107. if c.header_ == nil {
  13108. c.header_ = make(http.Header)
  13109. }
  13110. return c.header_
  13111. }
  13112. func (c *AccountsUserPermissionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13113. reqHeaders := make(http.Header)
  13114. for k, v := range c.header_ {
  13115. reqHeaders[k] = v
  13116. }
  13117. reqHeaders.Set("User-Agent", c.s.userAgent())
  13118. var body io.Reader = nil
  13119. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userpermission)
  13120. if err != nil {
  13121. return nil, err
  13122. }
  13123. reqHeaders.Set("Content-Type", "application/json")
  13124. c.urlParams_.Set("alt", alt)
  13125. c.urlParams_.Set("prettyPrint", "false")
  13126. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  13127. urls += "?" + c.urlParams_.Encode()
  13128. req, err := http.NewRequest("PUT", urls, body)
  13129. if err != nil {
  13130. return nil, err
  13131. }
  13132. req.Header = reqHeaders
  13133. googleapi.Expand(req.URL, map[string]string{
  13134. "path": c.path,
  13135. })
  13136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13137. }
  13138. // Do executes the "tagmanager.accounts.user_permissions.update" call.
  13139. // Exactly one of *UserPermission or error will be non-nil. Any non-2xx
  13140. // status code is an error. Response headers are in either
  13141. // *UserPermission.ServerResponse.Header or (if a response was returned
  13142. // at all) in error.(*googleapi.Error).Header. Use
  13143. // googleapi.IsNotModified to check whether the returned error was
  13144. // because http.StatusNotModified was returned.
  13145. func (c *AccountsUserPermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*UserPermission, error) {
  13146. gensupport.SetOptions(c.urlParams_, opts...)
  13147. res, err := c.doRequest("json")
  13148. if res != nil && res.StatusCode == http.StatusNotModified {
  13149. if res.Body != nil {
  13150. res.Body.Close()
  13151. }
  13152. return nil, &googleapi.Error{
  13153. Code: res.StatusCode,
  13154. Header: res.Header,
  13155. }
  13156. }
  13157. if err != nil {
  13158. return nil, err
  13159. }
  13160. defer googleapi.CloseBody(res)
  13161. if err := googleapi.CheckResponse(res); err != nil {
  13162. return nil, err
  13163. }
  13164. ret := &UserPermission{
  13165. ServerResponse: googleapi.ServerResponse{
  13166. Header: res.Header,
  13167. HTTPStatusCode: res.StatusCode,
  13168. },
  13169. }
  13170. target := &ret
  13171. if err := gensupport.DecodeResponse(target, res); err != nil {
  13172. return nil, err
  13173. }
  13174. return ret, nil
  13175. // {
  13176. // "description": "Updates a user's Account \u0026 Container access.",
  13177. // "httpMethod": "PUT",
  13178. // "id": "tagmanager.accounts.user_permissions.update",
  13179. // "parameterOrder": [
  13180. // "path"
  13181. // ],
  13182. // "parameters": {
  13183. // "path": {
  13184. // "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}",
  13185. // "location": "path",
  13186. // "required": true,
  13187. // "type": "string"
  13188. // }
  13189. // },
  13190. // "path": "{+path}",
  13191. // "request": {
  13192. // "$ref": "UserPermission"
  13193. // },
  13194. // "response": {
  13195. // "$ref": "UserPermission"
  13196. // },
  13197. // "scopes": [
  13198. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  13199. // ]
  13200. // }
  13201. }