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.
 
 
 

9286 lines
302 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/v1/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/tagmanager/v1"
  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/v1"
  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:v1"
  71. const apiName = "tagmanager"
  72. const apiVersion = "v1"
  73. const basePath = "https://www.googleapis.com/tagmanager/v1/"
  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.Permissions = NewAccountsPermissionsService(s)
  148. return rs
  149. }
  150. type AccountsService struct {
  151. s *Service
  152. Containers *AccountsContainersService
  153. Permissions *AccountsPermissionsService
  154. }
  155. func NewAccountsContainersService(s *Service) *AccountsContainersService {
  156. rs := &AccountsContainersService{s: s}
  157. rs.Environments = NewAccountsContainersEnvironmentsService(s)
  158. rs.Folders = NewAccountsContainersFoldersService(s)
  159. rs.MoveFolders = NewAccountsContainersMoveFoldersService(s)
  160. rs.ReauthorizeEnvironments = NewAccountsContainersReauthorizeEnvironmentsService(s)
  161. rs.Tags = NewAccountsContainersTagsService(s)
  162. rs.Triggers = NewAccountsContainersTriggersService(s)
  163. rs.Variables = NewAccountsContainersVariablesService(s)
  164. rs.Versions = NewAccountsContainersVersionsService(s)
  165. return rs
  166. }
  167. type AccountsContainersService struct {
  168. s *Service
  169. Environments *AccountsContainersEnvironmentsService
  170. Folders *AccountsContainersFoldersService
  171. MoveFolders *AccountsContainersMoveFoldersService
  172. ReauthorizeEnvironments *AccountsContainersReauthorizeEnvironmentsService
  173. Tags *AccountsContainersTagsService
  174. Triggers *AccountsContainersTriggersService
  175. Variables *AccountsContainersVariablesService
  176. Versions *AccountsContainersVersionsService
  177. }
  178. func NewAccountsContainersEnvironmentsService(s *Service) *AccountsContainersEnvironmentsService {
  179. rs := &AccountsContainersEnvironmentsService{s: s}
  180. return rs
  181. }
  182. type AccountsContainersEnvironmentsService struct {
  183. s *Service
  184. }
  185. func NewAccountsContainersFoldersService(s *Service) *AccountsContainersFoldersService {
  186. rs := &AccountsContainersFoldersService{s: s}
  187. rs.Entities = NewAccountsContainersFoldersEntitiesService(s)
  188. return rs
  189. }
  190. type AccountsContainersFoldersService struct {
  191. s *Service
  192. Entities *AccountsContainersFoldersEntitiesService
  193. }
  194. func NewAccountsContainersFoldersEntitiesService(s *Service) *AccountsContainersFoldersEntitiesService {
  195. rs := &AccountsContainersFoldersEntitiesService{s: s}
  196. return rs
  197. }
  198. type AccountsContainersFoldersEntitiesService struct {
  199. s *Service
  200. }
  201. func NewAccountsContainersMoveFoldersService(s *Service) *AccountsContainersMoveFoldersService {
  202. rs := &AccountsContainersMoveFoldersService{s: s}
  203. return rs
  204. }
  205. type AccountsContainersMoveFoldersService struct {
  206. s *Service
  207. }
  208. func NewAccountsContainersReauthorizeEnvironmentsService(s *Service) *AccountsContainersReauthorizeEnvironmentsService {
  209. rs := &AccountsContainersReauthorizeEnvironmentsService{s: s}
  210. return rs
  211. }
  212. type AccountsContainersReauthorizeEnvironmentsService struct {
  213. s *Service
  214. }
  215. func NewAccountsContainersTagsService(s *Service) *AccountsContainersTagsService {
  216. rs := &AccountsContainersTagsService{s: s}
  217. return rs
  218. }
  219. type AccountsContainersTagsService struct {
  220. s *Service
  221. }
  222. func NewAccountsContainersTriggersService(s *Service) *AccountsContainersTriggersService {
  223. rs := &AccountsContainersTriggersService{s: s}
  224. return rs
  225. }
  226. type AccountsContainersTriggersService struct {
  227. s *Service
  228. }
  229. func NewAccountsContainersVariablesService(s *Service) *AccountsContainersVariablesService {
  230. rs := &AccountsContainersVariablesService{s: s}
  231. return rs
  232. }
  233. type AccountsContainersVariablesService struct {
  234. s *Service
  235. }
  236. func NewAccountsContainersVersionsService(s *Service) *AccountsContainersVersionsService {
  237. rs := &AccountsContainersVersionsService{s: s}
  238. return rs
  239. }
  240. type AccountsContainersVersionsService struct {
  241. s *Service
  242. }
  243. func NewAccountsPermissionsService(s *Service) *AccountsPermissionsService {
  244. rs := &AccountsPermissionsService{s: s}
  245. return rs
  246. }
  247. type AccountsPermissionsService struct {
  248. s *Service
  249. }
  250. // Account: Represents a Google Tag Manager Account.
  251. type Account struct {
  252. // AccountId: The Account ID uniquely identifies the GTM Account.
  253. AccountId string `json:"accountId,omitempty"`
  254. // Fingerprint: The fingerprint of the GTM Account as computed at
  255. // storage time. This value is recomputed whenever the account is
  256. // modified.
  257. Fingerprint string `json:"fingerprint,omitempty"`
  258. // Name: Account display name.
  259. Name string `json:"name,omitempty"`
  260. // ShareData: Whether the account shares data anonymously with Google
  261. // and others.
  262. ShareData bool `json:"shareData,omitempty"`
  263. // ServerResponse contains the HTTP response code and headers from the
  264. // server.
  265. googleapi.ServerResponse `json:"-"`
  266. // ForceSendFields is a list of field names (e.g. "AccountId") to
  267. // unconditionally include in API requests. By default, fields with
  268. // empty values are omitted from API requests. However, any non-pointer,
  269. // non-interface field appearing in ForceSendFields will be sent to the
  270. // server regardless of whether the field is empty or not. This may be
  271. // used to include empty fields in Patch requests.
  272. ForceSendFields []string `json:"-"`
  273. // NullFields is a list of field names (e.g. "AccountId") to include in
  274. // API requests with the JSON null value. By default, fields with empty
  275. // values are omitted from API requests. However, any field with an
  276. // empty value appearing in NullFields will be sent to the server as
  277. // null. It is an error if a field in this list has a non-empty value.
  278. // This may be used to include null fields in Patch requests.
  279. NullFields []string `json:"-"`
  280. }
  281. func (s *Account) MarshalJSON() ([]byte, error) {
  282. type NoMethod Account
  283. raw := NoMethod(*s)
  284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  285. }
  286. // AccountAccess: Defines the Google Tag Manager Account access
  287. // permissions.
  288. type AccountAccess struct {
  289. // Permission: List of Account permissions. Valid account permissions
  290. // are read and manage.
  291. //
  292. // Possible values:
  293. // "delete"
  294. // "edit"
  295. // "editWorkspace"
  296. // "manage"
  297. // "publish"
  298. // "read"
  299. Permission []string `json:"permission,omitempty"`
  300. // ForceSendFields is a list of field names (e.g. "Permission") to
  301. // unconditionally include in API requests. By default, fields with
  302. // empty values are omitted from API requests. However, any non-pointer,
  303. // non-interface field appearing in ForceSendFields will be sent to the
  304. // server regardless of whether the field is empty or not. This may be
  305. // used to include empty fields in Patch requests.
  306. ForceSendFields []string `json:"-"`
  307. // NullFields is a list of field names (e.g. "Permission") to include in
  308. // API requests with the JSON null value. By default, fields with empty
  309. // values are omitted from API requests. However, any field with an
  310. // empty value appearing in NullFields will be sent to the server as
  311. // null. It is an error if a field in this list has a non-empty value.
  312. // This may be used to include null fields in Patch requests.
  313. NullFields []string `json:"-"`
  314. }
  315. func (s *AccountAccess) MarshalJSON() ([]byte, error) {
  316. type NoMethod AccountAccess
  317. raw := NoMethod(*s)
  318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  319. }
  320. // Condition: Represents a predicate.
  321. type Condition struct {
  322. // Parameter: A list of named parameters (key/value), depending on the
  323. // condition's type. Notes:
  324. // - For binary operators, include parameters named arg0 and arg1 for
  325. // specifying the left and right operands, respectively.
  326. // - At this time, the left operand (arg0) must be a reference to a
  327. // variable.
  328. // - For case-insensitive Regex matching, include a boolean parameter
  329. // named ignore_case that is set to true. If not specified or set to any
  330. // other value, the matching will be case sensitive.
  331. // - To negate an operator, include a boolean parameter named negate
  332. // boolean parameter that is set to true.
  333. Parameter []*Parameter `json:"parameter,omitempty"`
  334. // Type: The type of operator for this condition.
  335. //
  336. // Possible values:
  337. // "contains"
  338. // "cssSelector"
  339. // "endsWith"
  340. // "equals"
  341. // "greater"
  342. // "greaterOrEquals"
  343. // "less"
  344. // "lessOrEquals"
  345. // "matchRegex"
  346. // "startsWith"
  347. // "urlMatches"
  348. Type string `json:"type,omitempty"`
  349. // ForceSendFields is a list of field names (e.g. "Parameter") to
  350. // unconditionally include in API requests. By default, fields with
  351. // empty values are omitted from API requests. However, any non-pointer,
  352. // non-interface field appearing in ForceSendFields will be sent to the
  353. // server regardless of whether the field is empty or not. This may be
  354. // used to include empty fields in Patch requests.
  355. ForceSendFields []string `json:"-"`
  356. // NullFields is a list of field names (e.g. "Parameter") to include in
  357. // API requests with the JSON null value. By default, fields with empty
  358. // values are omitted from API requests. However, any field with an
  359. // empty value appearing in NullFields will be sent to the server as
  360. // null. It is an error if a field in this list has a non-empty value.
  361. // This may be used to include null fields in Patch requests.
  362. NullFields []string `json:"-"`
  363. }
  364. func (s *Condition) MarshalJSON() ([]byte, error) {
  365. type NoMethod Condition
  366. raw := NoMethod(*s)
  367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  368. }
  369. // Container: Represents a Google Tag Manager Container.
  370. type Container struct {
  371. // AccountId: GTM Account ID.
  372. AccountId string `json:"accountId,omitempty"`
  373. // ContainerId: The Container ID uniquely identifies the GTM Container.
  374. ContainerId string `json:"containerId,omitempty"`
  375. // DomainName: Optional list of domain names associated with the
  376. // Container.
  377. DomainName []string `json:"domainName,omitempty"`
  378. // EnabledBuiltInVariable: List of enabled built-in variables. Valid
  379. // values include: pageUrl, pageHostname, pagePath, referrer, event,
  380. // clickElement, clickClasses, clickId, clickTarget, clickUrl,
  381. // clickText, formElement, formClasses, formId, formTarget, formUrl,
  382. // formText, errorMessage, errorUrl, errorLine, newHistoryFragment,
  383. // oldHistoryFragment, newHistoryState, oldHistoryState, historySource,
  384. // containerVersion, debugMode, randomNumber, containerId.
  385. //
  386. // Possible values:
  387. // "advertiserId"
  388. // "advertisingTrackingEnabled"
  389. // "ampBrowserLanguage"
  390. // "ampCanonicalHost"
  391. // "ampCanonicalPath"
  392. // "ampCanonicalUrl"
  393. // "ampClientId"
  394. // "ampClientMaxScrollX"
  395. // "ampClientMaxScrollY"
  396. // "ampClientScreenHeight"
  397. // "ampClientScreenWidth"
  398. // "ampClientScrollX"
  399. // "ampClientScrollY"
  400. // "ampClientTimestamp"
  401. // "ampClientTimezone"
  402. // "ampGtmEvent"
  403. // "ampPageDownloadTime"
  404. // "ampPageLoadTime"
  405. // "ampPageViewId"
  406. // "ampReferrer"
  407. // "ampTitle"
  408. // "ampTotalEngagedTime"
  409. // "appId"
  410. // "appName"
  411. // "appVersionCode"
  412. // "appVersionName"
  413. // "clickClasses"
  414. // "clickElement"
  415. // "clickId"
  416. // "clickTarget"
  417. // "clickText"
  418. // "clickUrl"
  419. // "containerId"
  420. // "containerVersion"
  421. // "debugMode"
  422. // "deviceName"
  423. // "elementVisibilityFirstTime"
  424. // "elementVisibilityRatio"
  425. // "elementVisibilityRecentTime"
  426. // "elementVisibilityTime"
  427. // "environmentName"
  428. // "errorLine"
  429. // "errorMessage"
  430. // "errorUrl"
  431. // "event"
  432. // "eventName"
  433. // "firebaseEventParameterCampaign"
  434. // "firebaseEventParameterCampaignAclid"
  435. // "firebaseEventParameterCampaignAnid"
  436. // "firebaseEventParameterCampaignClickTimestamp"
  437. // "firebaseEventParameterCampaignContent"
  438. // "firebaseEventParameterCampaignCp1"
  439. // "firebaseEventParameterCampaignGclid"
  440. // "firebaseEventParameterCampaignSource"
  441. // "firebaseEventParameterCampaignTerm"
  442. // "firebaseEventParameterCurrency"
  443. // "firebaseEventParameterDynamicLinkAcceptTime"
  444. // "firebaseEventParameterDynamicLinkLinkid"
  445. // "firebaseEventParameterNotificationMessageDeviceTime"
  446. // "firebaseEventParameterNotificationMessageId"
  447. // "firebaseEventParameterNotificationMessageName"
  448. // "firebaseEventParameterNotificationMessageTime"
  449. // "firebaseEventParameterNotificationTopic"
  450. // "firebaseEventParameterPreviousAppVersion"
  451. // "firebaseEventParameterPreviousOsVersion"
  452. // "firebaseEventParameterPrice"
  453. // "firebaseEventParameterProductId"
  454. // "firebaseEventParameterQuantity"
  455. // "firebaseEventParameterValue"
  456. // "formClasses"
  457. // "formElement"
  458. // "formId"
  459. // "formTarget"
  460. // "formText"
  461. // "formUrl"
  462. // "historySource"
  463. // "htmlId"
  464. // "language"
  465. // "newHistoryFragment"
  466. // "newHistoryState"
  467. // "oldHistoryFragment"
  468. // "oldHistoryState"
  469. // "osVersion"
  470. // "pageHostname"
  471. // "pagePath"
  472. // "pageUrl"
  473. // "platform"
  474. // "randomNumber"
  475. // "referrer"
  476. // "resolution"
  477. // "scrollDepthDirection"
  478. // "scrollDepthThreshold"
  479. // "scrollDepthUnits"
  480. // "sdkVersion"
  481. // "videoCurrentTime"
  482. // "videoDuration"
  483. // "videoPercent"
  484. // "videoProvider"
  485. // "videoStatus"
  486. // "videoTitle"
  487. // "videoUrl"
  488. // "videoVisible"
  489. EnabledBuiltInVariable []string `json:"enabledBuiltInVariable,omitempty"`
  490. // Fingerprint: The fingerprint of the GTM Container as computed at
  491. // storage time. This value is recomputed whenever the account is
  492. // modified.
  493. Fingerprint string `json:"fingerprint,omitempty"`
  494. // Name: Container display name.
  495. Name string `json:"name,omitempty"`
  496. // Notes: Container Notes.
  497. Notes string `json:"notes,omitempty"`
  498. // PublicId: Container Public ID.
  499. PublicId string `json:"publicId,omitempty"`
  500. // TimeZoneCountryId: Container Country ID.
  501. TimeZoneCountryId string `json:"timeZoneCountryId,omitempty"`
  502. // TimeZoneId: Container Time Zone ID.
  503. TimeZoneId string `json:"timeZoneId,omitempty"`
  504. // UsageContext: List of Usage Contexts for the Container. Valid values
  505. // include: web, android, ios.
  506. //
  507. // Possible values:
  508. // "amp"
  509. // "android"
  510. // "androidSdk5"
  511. // "ios"
  512. // "iosSdk5"
  513. // "web"
  514. UsageContext []string `json:"usageContext,omitempty"`
  515. // ServerResponse contains the HTTP response code and headers from the
  516. // server.
  517. googleapi.ServerResponse `json:"-"`
  518. // ForceSendFields is a list of field names (e.g. "AccountId") to
  519. // unconditionally include in API requests. By default, fields with
  520. // empty values are omitted from API requests. However, any non-pointer,
  521. // non-interface field appearing in ForceSendFields will be sent to the
  522. // server regardless of whether the field is empty or not. This may be
  523. // used to include empty fields in Patch requests.
  524. ForceSendFields []string `json:"-"`
  525. // NullFields is a list of field names (e.g. "AccountId") to include in
  526. // API requests with the JSON null value. By default, fields with empty
  527. // values are omitted from API requests. However, any field with an
  528. // empty value appearing in NullFields will be sent to the server as
  529. // null. It is an error if a field in this list has a non-empty value.
  530. // This may be used to include null fields in Patch requests.
  531. NullFields []string `json:"-"`
  532. }
  533. func (s *Container) MarshalJSON() ([]byte, error) {
  534. type NoMethod Container
  535. raw := NoMethod(*s)
  536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  537. }
  538. // ContainerAccess: Defines the Google Tag Manager Container access
  539. // permissions.
  540. type ContainerAccess struct {
  541. // ContainerId: GTM Container ID.
  542. ContainerId string `json:"containerId,omitempty"`
  543. // Permission: List of Container permissions. Valid container
  544. // permissions are: read, edit, delete, publish.
  545. //
  546. // Possible values:
  547. // "delete"
  548. // "edit"
  549. // "editWorkspace"
  550. // "manage"
  551. // "publish"
  552. // "read"
  553. Permission []string `json:"permission,omitempty"`
  554. // ForceSendFields is a list of field names (e.g. "ContainerId") to
  555. // unconditionally include in API requests. By default, fields with
  556. // empty values are omitted from API requests. However, any non-pointer,
  557. // non-interface field appearing in ForceSendFields will be sent to the
  558. // server regardless of whether the field is empty or not. This may be
  559. // used to include empty fields in Patch requests.
  560. ForceSendFields []string `json:"-"`
  561. // NullFields is a list of field names (e.g. "ContainerId") to include
  562. // in API requests with the JSON null value. By default, fields with
  563. // empty values are omitted from API requests. However, any field with
  564. // an empty value appearing in NullFields will be sent to the server as
  565. // null. It is an error if a field in this list has a non-empty value.
  566. // This may be used to include null fields in Patch requests.
  567. NullFields []string `json:"-"`
  568. }
  569. func (s *ContainerAccess) MarshalJSON() ([]byte, error) {
  570. type NoMethod ContainerAccess
  571. raw := NoMethod(*s)
  572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  573. }
  574. // ContainerVersion: Represents a Google Tag Manager Container Version.
  575. type ContainerVersion struct {
  576. // AccountId: GTM Account ID.
  577. AccountId string `json:"accountId,omitempty"`
  578. // Container: The container that this version was taken from.
  579. Container *Container `json:"container,omitempty"`
  580. // ContainerId: GTM Container ID.
  581. ContainerId string `json:"containerId,omitempty"`
  582. // ContainerVersionId: The Container Version ID uniquely identifies the
  583. // GTM Container Version.
  584. ContainerVersionId string `json:"containerVersionId,omitempty"`
  585. // Deleted: A value of true indicates this container version has been
  586. // deleted.
  587. Deleted bool `json:"deleted,omitempty"`
  588. // Fingerprint: The fingerprint of the GTM Container Version as computed
  589. // at storage time. This value is recomputed whenever the container
  590. // version is modified.
  591. Fingerprint string `json:"fingerprint,omitempty"`
  592. // Folder: The folders in the container that this version was taken
  593. // from.
  594. Folder []*Folder `json:"folder,omitempty"`
  595. // Macro: The macros in the container that this version was taken from.
  596. Macro []*Macro `json:"macro,omitempty"`
  597. // Name: Container version display name.
  598. Name string `json:"name,omitempty"`
  599. // Notes: User notes on how to apply this container version in the
  600. // container.
  601. Notes string `json:"notes,omitempty"`
  602. // Rule: The rules in the container that this version was taken from.
  603. Rule []*Rule `json:"rule,omitempty"`
  604. // Tag: The tags in the container that this version was taken from.
  605. Tag []*Tag `json:"tag,omitempty"`
  606. // Trigger: The triggers in the container that this version was taken
  607. // from.
  608. Trigger []*Trigger `json:"trigger,omitempty"`
  609. // Variable: The variables in the container that this version was taken
  610. // from.
  611. Variable []*Variable `json:"variable,omitempty"`
  612. // ServerResponse contains the HTTP response code and headers from the
  613. // server.
  614. googleapi.ServerResponse `json:"-"`
  615. // ForceSendFields is a list of field names (e.g. "AccountId") to
  616. // unconditionally include in API requests. By default, fields with
  617. // empty values are omitted from API requests. However, any non-pointer,
  618. // non-interface field appearing in ForceSendFields will be sent to the
  619. // server regardless of whether the field is empty or not. This may be
  620. // used to include empty fields in Patch requests.
  621. ForceSendFields []string `json:"-"`
  622. // NullFields is a list of field names (e.g. "AccountId") to include in
  623. // API requests with the JSON null value. By default, fields with empty
  624. // values are omitted from API requests. However, any field with an
  625. // empty value appearing in NullFields will be sent to the server as
  626. // null. It is an error if a field in this list has a non-empty value.
  627. // This may be used to include null fields in Patch requests.
  628. NullFields []string `json:"-"`
  629. }
  630. func (s *ContainerVersion) MarshalJSON() ([]byte, error) {
  631. type NoMethod ContainerVersion
  632. raw := NoMethod(*s)
  633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  634. }
  635. // ContainerVersionHeader: Represents a Google Tag Manager Container
  636. // Version Header.
  637. type ContainerVersionHeader struct {
  638. // AccountId: GTM Account ID.
  639. AccountId string `json:"accountId,omitempty"`
  640. // ContainerId: GTM Container ID.
  641. ContainerId string `json:"containerId,omitempty"`
  642. // ContainerVersionId: The Container Version ID uniquely identifies the
  643. // GTM Container Version.
  644. ContainerVersionId string `json:"containerVersionId,omitempty"`
  645. // Deleted: A value of true indicates this container version has been
  646. // deleted.
  647. Deleted bool `json:"deleted,omitempty"`
  648. // Name: Container version display name.
  649. Name string `json:"name,omitempty"`
  650. // NumMacros: Number of macros in the container version.
  651. NumMacros string `json:"numMacros,omitempty"`
  652. // NumRules: Number of rules in the container version.
  653. NumRules string `json:"numRules,omitempty"`
  654. // NumTags: Number of tags in the container version.
  655. NumTags string `json:"numTags,omitempty"`
  656. // NumTriggers: Number of triggers in the container version.
  657. NumTriggers string `json:"numTriggers,omitempty"`
  658. // NumVariables: Number of variables in the container version.
  659. NumVariables string `json:"numVariables,omitempty"`
  660. // ForceSendFields is a list of field names (e.g. "AccountId") to
  661. // unconditionally include in API requests. By default, fields with
  662. // empty values are omitted from API requests. However, any non-pointer,
  663. // non-interface field appearing in ForceSendFields will be sent to the
  664. // server regardless of whether the field is empty or not. This may be
  665. // used to include empty fields in Patch requests.
  666. ForceSendFields []string `json:"-"`
  667. // NullFields is a list of field names (e.g. "AccountId") to include in
  668. // API requests with the JSON null value. By default, fields with empty
  669. // values are omitted from API requests. However, any field with an
  670. // empty value appearing in NullFields will be sent to the server as
  671. // null. It is an error if a field in this list has a non-empty value.
  672. // This may be used to include null fields in Patch requests.
  673. NullFields []string `json:"-"`
  674. }
  675. func (s *ContainerVersionHeader) MarshalJSON() ([]byte, error) {
  676. type NoMethod ContainerVersionHeader
  677. raw := NoMethod(*s)
  678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  679. }
  680. // CreateContainerVersionRequestVersionOptions: Options for new
  681. // container versions.
  682. type CreateContainerVersionRequestVersionOptions struct {
  683. // Name: The name of the container version to be created.
  684. Name string `json:"name,omitempty"`
  685. // Notes: The notes of the container version to be created.
  686. Notes string `json:"notes,omitempty"`
  687. // QuickPreview: The creation of this version may be for quick preview
  688. // and shouldn't be saved.
  689. QuickPreview bool `json:"quickPreview,omitempty"`
  690. // ForceSendFields is a list of field names (e.g. "Name") to
  691. // unconditionally include in API requests. By default, fields with
  692. // empty values are omitted from API requests. However, any non-pointer,
  693. // non-interface field appearing in ForceSendFields will be sent to the
  694. // server regardless of whether the field is empty or not. This may be
  695. // used to include empty fields in Patch requests.
  696. ForceSendFields []string `json:"-"`
  697. // NullFields is a list of field names (e.g. "Name") to include in API
  698. // requests with the JSON null value. By default, fields with empty
  699. // values are omitted from API requests. However, any field with an
  700. // empty value appearing in NullFields will be sent to the server as
  701. // null. It is an error if a field in this list has a non-empty value.
  702. // This may be used to include null fields in Patch requests.
  703. NullFields []string `json:"-"`
  704. }
  705. func (s *CreateContainerVersionRequestVersionOptions) MarshalJSON() ([]byte, error) {
  706. type NoMethod CreateContainerVersionRequestVersionOptions
  707. raw := NoMethod(*s)
  708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  709. }
  710. // CreateContainerVersionResponse: Create container versions response.
  711. type CreateContainerVersionResponse struct {
  712. // CompilerError: Compiler errors or not.
  713. CompilerError bool `json:"compilerError,omitempty"`
  714. // ContainerVersion: The container version created.
  715. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  716. // ServerResponse contains the HTTP response code and headers from the
  717. // server.
  718. googleapi.ServerResponse `json:"-"`
  719. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  720. // unconditionally include in API requests. By default, fields with
  721. // empty values are omitted from API requests. However, any non-pointer,
  722. // non-interface field appearing in ForceSendFields will be sent to the
  723. // server regardless of whether the field is empty or not. This may be
  724. // used to include empty fields in Patch requests.
  725. ForceSendFields []string `json:"-"`
  726. // NullFields is a list of field names (e.g. "CompilerError") to include
  727. // in API requests with the JSON null value. By default, fields with
  728. // empty values are omitted from API requests. However, any field with
  729. // an empty value appearing in NullFields will be sent to the server as
  730. // null. It is an error if a field in this list has a non-empty value.
  731. // This may be used to include null fields in Patch requests.
  732. NullFields []string `json:"-"`
  733. }
  734. func (s *CreateContainerVersionResponse) MarshalJSON() ([]byte, error) {
  735. type NoMethod CreateContainerVersionResponse
  736. raw := NoMethod(*s)
  737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  738. }
  739. // Environment: Represents a Google Tag Manager Environment. Note that a
  740. // user can create, delete and update environments of type USER, but can
  741. // only update the enable_debug and url fields of environments of other
  742. // types.
  743. type Environment struct {
  744. // AccountId: GTM Account ID.
  745. AccountId string `json:"accountId,omitempty"`
  746. // AuthorizationCode: The environment authorization code.
  747. AuthorizationCode string `json:"authorizationCode,omitempty"`
  748. // AuthorizationTimestampMs: The last update time-stamp for the
  749. // authorization code.
  750. AuthorizationTimestampMs int64 `json:"authorizationTimestampMs,omitempty,string"`
  751. // ContainerId: GTM Container ID.
  752. ContainerId string `json:"containerId,omitempty"`
  753. ContainerVersionId string `json:"containerVersionId,omitempty"`
  754. // Description: The environment description. Can be set or changed only
  755. // on USER type environments.
  756. Description string `json:"description,omitempty"`
  757. // EnableDebug: Whether or not to enable debug by default on for the
  758. // environment.
  759. EnableDebug bool `json:"enableDebug,omitempty"`
  760. // EnvironmentId: GTM Environment ID uniquely identifies the GTM
  761. // Environment.
  762. EnvironmentId string `json:"environmentId,omitempty"`
  763. // Fingerprint: The fingerprint of the GTM environment as computed at
  764. // storage time. This value is recomputed whenever the environment is
  765. // modified.
  766. Fingerprint string `json:"fingerprint,omitempty"`
  767. // Name: The environment display name. Can be set or changed only on
  768. // USER type environments.
  769. Name string `json:"name,omitempty"`
  770. // Type: The type of this environment.
  771. //
  772. // Possible values:
  773. // "draft"
  774. // "latest"
  775. // "live"
  776. // "user"
  777. Type string `json:"type,omitempty"`
  778. // Url: Default preview page url for the environment.
  779. Url string `json:"url,omitempty"`
  780. // ServerResponse contains the HTTP response code and headers from the
  781. // server.
  782. googleapi.ServerResponse `json:"-"`
  783. // ForceSendFields is a list of field names (e.g. "AccountId") to
  784. // unconditionally include in API requests. By default, fields with
  785. // empty values are omitted from API requests. However, any non-pointer,
  786. // non-interface field appearing in ForceSendFields will be sent to the
  787. // server regardless of whether the field is empty or not. This may be
  788. // used to include empty fields in Patch requests.
  789. ForceSendFields []string `json:"-"`
  790. // NullFields is a list of field names (e.g. "AccountId") to include in
  791. // API requests with the JSON null value. By default, fields with empty
  792. // values are omitted from API requests. However, any field with an
  793. // empty value appearing in NullFields will be sent to the server as
  794. // null. It is an error if a field in this list has a non-empty value.
  795. // This may be used to include null fields in Patch requests.
  796. NullFields []string `json:"-"`
  797. }
  798. func (s *Environment) MarshalJSON() ([]byte, error) {
  799. type NoMethod Environment
  800. raw := NoMethod(*s)
  801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  802. }
  803. // Folder: Represents a Google Tag Manager Folder.
  804. type Folder struct {
  805. // AccountId: GTM Account ID.
  806. AccountId string `json:"accountId,omitempty"`
  807. // ContainerId: GTM Container ID.
  808. ContainerId string `json:"containerId,omitempty"`
  809. // Fingerprint: The fingerprint of the GTM Folder as computed at storage
  810. // time. This value is recomputed whenever the folder is modified.
  811. Fingerprint string `json:"fingerprint,omitempty"`
  812. // FolderId: The Folder ID uniquely identifies the GTM Folder.
  813. FolderId string `json:"folderId,omitempty"`
  814. // Name: Folder display name.
  815. Name string `json:"name,omitempty"`
  816. // ServerResponse contains the HTTP response code and headers from the
  817. // server.
  818. googleapi.ServerResponse `json:"-"`
  819. // ForceSendFields is a list of field names (e.g. "AccountId") to
  820. // unconditionally include in API requests. By default, fields with
  821. // empty values are omitted from API requests. However, any non-pointer,
  822. // non-interface field appearing in ForceSendFields will be sent to the
  823. // server regardless of whether the field is empty or not. This may be
  824. // used to include empty fields in Patch requests.
  825. ForceSendFields []string `json:"-"`
  826. // NullFields is a list of field names (e.g. "AccountId") to include in
  827. // API requests with the JSON null value. By default, fields with empty
  828. // values are omitted from API requests. However, any field with an
  829. // empty value appearing in NullFields will be sent to the server as
  830. // null. It is an error if a field in this list has a non-empty value.
  831. // This may be used to include null fields in Patch requests.
  832. NullFields []string `json:"-"`
  833. }
  834. func (s *Folder) MarshalJSON() ([]byte, error) {
  835. type NoMethod Folder
  836. raw := NoMethod(*s)
  837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  838. }
  839. // FolderEntities: Represents a Google Tag Manager Folder's contents.
  840. type FolderEntities struct {
  841. // Tag: The list of tags inside the folder.
  842. Tag []*Tag `json:"tag,omitempty"`
  843. // Trigger: The list of triggers inside the folder.
  844. Trigger []*Trigger `json:"trigger,omitempty"`
  845. // Variable: The list of variables inside the folder.
  846. Variable []*Variable `json:"variable,omitempty"`
  847. // ServerResponse contains the HTTP response code and headers from the
  848. // server.
  849. googleapi.ServerResponse `json:"-"`
  850. // ForceSendFields is a list of field names (e.g. "Tag") to
  851. // unconditionally include in API requests. By default, fields with
  852. // empty values are omitted from API requests. However, any non-pointer,
  853. // non-interface field appearing in ForceSendFields will be sent to the
  854. // server regardless of whether the field is empty or not. This may be
  855. // used to include empty fields in Patch requests.
  856. ForceSendFields []string `json:"-"`
  857. // NullFields is a list of field names (e.g. "Tag") to include in API
  858. // requests with the JSON null value. By default, fields with empty
  859. // values are omitted from API requests. However, any field with an
  860. // empty value appearing in NullFields will be sent to the server as
  861. // null. It is an error if a field in this list has a non-empty value.
  862. // This may be used to include null fields in Patch requests.
  863. NullFields []string `json:"-"`
  864. }
  865. func (s *FolderEntities) MarshalJSON() ([]byte, error) {
  866. type NoMethod FolderEntities
  867. raw := NoMethod(*s)
  868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  869. }
  870. // ListAccountUsersResponse: List AccountUsers Response.
  871. type ListAccountUsersResponse struct {
  872. // UserAccess: All GTM AccountUsers of a GTM Account.
  873. UserAccess []*UserAccess `json:"userAccess,omitempty"`
  874. // ServerResponse contains the HTTP response code and headers from the
  875. // server.
  876. googleapi.ServerResponse `json:"-"`
  877. // ForceSendFields is a list of field names (e.g. "UserAccess") to
  878. // unconditionally include in API requests. By default, fields with
  879. // empty values are omitted from API requests. However, any non-pointer,
  880. // non-interface field appearing in ForceSendFields will be sent to the
  881. // server regardless of whether the field is empty or not. This may be
  882. // used to include empty fields in Patch requests.
  883. ForceSendFields []string `json:"-"`
  884. // NullFields is a list of field names (e.g. "UserAccess") to include in
  885. // API requests with the JSON null value. By default, fields with empty
  886. // values are omitted from API requests. However, any field with an
  887. // empty value appearing in NullFields will be sent to the server as
  888. // null. It is an error if a field in this list has a non-empty value.
  889. // This may be used to include null fields in Patch requests.
  890. NullFields []string `json:"-"`
  891. }
  892. func (s *ListAccountUsersResponse) MarshalJSON() ([]byte, error) {
  893. type NoMethod ListAccountUsersResponse
  894. raw := NoMethod(*s)
  895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  896. }
  897. // ListAccountsResponse: List Accounts Response.
  898. type ListAccountsResponse struct {
  899. // Accounts: List of GTM Accounts that a user has access to.
  900. Accounts []*Account `json:"accounts,omitempty"`
  901. // ServerResponse contains the HTTP response code and headers from the
  902. // server.
  903. googleapi.ServerResponse `json:"-"`
  904. // ForceSendFields is a list of field names (e.g. "Accounts") to
  905. // unconditionally include in API requests. By default, fields with
  906. // empty values are omitted from API requests. However, any non-pointer,
  907. // non-interface field appearing in ForceSendFields will be sent to the
  908. // server regardless of whether the field is empty or not. This may be
  909. // used to include empty fields in Patch requests.
  910. ForceSendFields []string `json:"-"`
  911. // NullFields is a list of field names (e.g. "Accounts") to include in
  912. // API requests with the JSON null value. By default, fields with empty
  913. // values are omitted from API requests. However, any field with an
  914. // empty value appearing in NullFields will be sent to the server as
  915. // null. It is an error if a field in this list has a non-empty value.
  916. // This may be used to include null fields in Patch requests.
  917. NullFields []string `json:"-"`
  918. }
  919. func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
  920. type NoMethod ListAccountsResponse
  921. raw := NoMethod(*s)
  922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  923. }
  924. // ListContainerVersionsResponse: List container versions response.
  925. type ListContainerVersionsResponse struct {
  926. // ContainerVersion: All versions of a GTM Container.
  927. ContainerVersion []*ContainerVersion `json:"containerVersion,omitempty"`
  928. // ContainerVersionHeader: All container version headers of a GTM
  929. // Container.
  930. ContainerVersionHeader []*ContainerVersionHeader `json:"containerVersionHeader,omitempty"`
  931. // ServerResponse contains the HTTP response code and headers from the
  932. // server.
  933. googleapi.ServerResponse `json:"-"`
  934. // ForceSendFields is a list of field names (e.g. "ContainerVersion") to
  935. // unconditionally include in API requests. By default, fields with
  936. // empty values are omitted from API requests. However, any non-pointer,
  937. // non-interface field appearing in ForceSendFields will be sent to the
  938. // server regardless of whether the field is empty or not. This may be
  939. // used to include empty fields in Patch requests.
  940. ForceSendFields []string `json:"-"`
  941. // NullFields is a list of field names (e.g. "ContainerVersion") to
  942. // include in API requests with the JSON null value. By default, fields
  943. // with empty values are omitted from API requests. However, any field
  944. // with an empty value appearing in NullFields will be sent to the
  945. // server as null. It is an error if a field in this list has a
  946. // non-empty value. This may be used to include null fields in Patch
  947. // requests.
  948. NullFields []string `json:"-"`
  949. }
  950. func (s *ListContainerVersionsResponse) MarshalJSON() ([]byte, error) {
  951. type NoMethod ListContainerVersionsResponse
  952. raw := NoMethod(*s)
  953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  954. }
  955. // ListContainersResponse: List Containers Response.
  956. type ListContainersResponse struct {
  957. // Containers: All Containers of a GTM Account.
  958. Containers []*Container `json:"containers,omitempty"`
  959. // ServerResponse contains the HTTP response code and headers from the
  960. // server.
  961. googleapi.ServerResponse `json:"-"`
  962. // ForceSendFields is a list of field names (e.g. "Containers") to
  963. // unconditionally include in API requests. By default, fields with
  964. // empty values are omitted from API requests. However, any non-pointer,
  965. // non-interface field appearing in ForceSendFields will be sent to the
  966. // server regardless of whether the field is empty or not. This may be
  967. // used to include empty fields in Patch requests.
  968. ForceSendFields []string `json:"-"`
  969. // NullFields is a list of field names (e.g. "Containers") to include in
  970. // API requests with the JSON null value. By default, fields with empty
  971. // values are omitted from API requests. However, any field with an
  972. // empty value appearing in NullFields will be sent to the server as
  973. // null. It is an error if a field in this list has a non-empty value.
  974. // This may be used to include null fields in Patch requests.
  975. NullFields []string `json:"-"`
  976. }
  977. func (s *ListContainersResponse) MarshalJSON() ([]byte, error) {
  978. type NoMethod ListContainersResponse
  979. raw := NoMethod(*s)
  980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  981. }
  982. // ListEnvironmentsResponse: List Environments Response.
  983. type ListEnvironmentsResponse struct {
  984. // Environments: All Environments of a GTM Container.
  985. Environments []*Environment `json:"environments,omitempty"`
  986. // ServerResponse contains the HTTP response code and headers from the
  987. // server.
  988. googleapi.ServerResponse `json:"-"`
  989. // ForceSendFields is a list of field names (e.g. "Environments") to
  990. // unconditionally include in API requests. By default, fields with
  991. // empty values are omitted from API requests. However, any non-pointer,
  992. // non-interface field appearing in ForceSendFields will be sent to the
  993. // server regardless of whether the field is empty or not. This may be
  994. // used to include empty fields in Patch requests.
  995. ForceSendFields []string `json:"-"`
  996. // NullFields is a list of field names (e.g. "Environments") to include
  997. // in API requests with the JSON null value. By default, fields with
  998. // empty values are omitted from API requests. However, any field with
  999. // an empty value appearing in NullFields will be sent to the server as
  1000. // null. It is an error if a field in this list has a non-empty value.
  1001. // This may be used to include null fields in Patch requests.
  1002. NullFields []string `json:"-"`
  1003. }
  1004. func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
  1005. type NoMethod ListEnvironmentsResponse
  1006. raw := NoMethod(*s)
  1007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1008. }
  1009. // ListFoldersResponse: List Folders Response.
  1010. type ListFoldersResponse struct {
  1011. // Folders: All GTM Folders of a GTM Container.
  1012. Folders []*Folder `json:"folders,omitempty"`
  1013. // ServerResponse contains the HTTP response code and headers from the
  1014. // server.
  1015. googleapi.ServerResponse `json:"-"`
  1016. // ForceSendFields is a list of field names (e.g. "Folders") to
  1017. // unconditionally include in API requests. By default, fields with
  1018. // empty values are omitted from API requests. However, any non-pointer,
  1019. // non-interface field appearing in ForceSendFields will be sent to the
  1020. // server regardless of whether the field is empty or not. This may be
  1021. // used to include empty fields in Patch requests.
  1022. ForceSendFields []string `json:"-"`
  1023. // NullFields is a list of field names (e.g. "Folders") to include in
  1024. // API requests with the JSON null value. By default, fields with empty
  1025. // values are omitted from API requests. However, any field with an
  1026. // empty value appearing in NullFields will be sent to the server as
  1027. // null. It is an error if a field in this list has a non-empty value.
  1028. // This may be used to include null fields in Patch requests.
  1029. NullFields []string `json:"-"`
  1030. }
  1031. func (s *ListFoldersResponse) MarshalJSON() ([]byte, error) {
  1032. type NoMethod ListFoldersResponse
  1033. raw := NoMethod(*s)
  1034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1035. }
  1036. // ListTagsResponse: List Tags Response.
  1037. type ListTagsResponse struct {
  1038. // Tags: All GTM Tags of a GTM Container.
  1039. Tags []*Tag `json:"tags,omitempty"`
  1040. // ServerResponse contains the HTTP response code and headers from the
  1041. // server.
  1042. googleapi.ServerResponse `json:"-"`
  1043. // ForceSendFields is a list of field names (e.g. "Tags") to
  1044. // unconditionally include in API requests. By default, fields with
  1045. // empty values are omitted from API requests. However, any non-pointer,
  1046. // non-interface field appearing in ForceSendFields will be sent to the
  1047. // server regardless of whether the field is empty or not. This may be
  1048. // used to include empty fields in Patch requests.
  1049. ForceSendFields []string `json:"-"`
  1050. // NullFields is a list of field names (e.g. "Tags") to include in API
  1051. // requests with the JSON null value. By default, fields with empty
  1052. // values are omitted from API requests. However, any field with an
  1053. // empty value appearing in NullFields will be sent to the server as
  1054. // null. It is an error if a field in this list has a non-empty value.
  1055. // This may be used to include null fields in Patch requests.
  1056. NullFields []string `json:"-"`
  1057. }
  1058. func (s *ListTagsResponse) MarshalJSON() ([]byte, error) {
  1059. type NoMethod ListTagsResponse
  1060. raw := NoMethod(*s)
  1061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1062. }
  1063. // ListTriggersResponse: List triggers response.
  1064. type ListTriggersResponse struct {
  1065. // Triggers: All GTM Triggers of a GTM Container.
  1066. Triggers []*Trigger `json:"triggers,omitempty"`
  1067. // ServerResponse contains the HTTP response code and headers from the
  1068. // server.
  1069. googleapi.ServerResponse `json:"-"`
  1070. // ForceSendFields is a list of field names (e.g. "Triggers") to
  1071. // unconditionally include in API requests. By default, fields with
  1072. // empty values are omitted from API requests. However, any non-pointer,
  1073. // non-interface field appearing in ForceSendFields will be sent to the
  1074. // server regardless of whether the field is empty or not. This may be
  1075. // used to include empty fields in Patch requests.
  1076. ForceSendFields []string `json:"-"`
  1077. // NullFields is a list of field names (e.g. "Triggers") to include in
  1078. // API requests with the JSON null value. By default, fields with empty
  1079. // values are omitted from API requests. However, any field with an
  1080. // empty value appearing in NullFields will be sent to the server as
  1081. // null. It is an error if a field in this list has a non-empty value.
  1082. // This may be used to include null fields in Patch requests.
  1083. NullFields []string `json:"-"`
  1084. }
  1085. func (s *ListTriggersResponse) MarshalJSON() ([]byte, error) {
  1086. type NoMethod ListTriggersResponse
  1087. raw := NoMethod(*s)
  1088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1089. }
  1090. // ListVariablesResponse: List Variables Response.
  1091. type ListVariablesResponse struct {
  1092. // Variables: All GTM Variables of a GTM Container.
  1093. Variables []*Variable `json:"variables,omitempty"`
  1094. // ServerResponse contains the HTTP response code and headers from the
  1095. // server.
  1096. googleapi.ServerResponse `json:"-"`
  1097. // ForceSendFields is a list of field names (e.g. "Variables") to
  1098. // unconditionally include in API requests. By default, fields with
  1099. // empty values are omitted from API requests. However, any non-pointer,
  1100. // non-interface field appearing in ForceSendFields will be sent to the
  1101. // server regardless of whether the field is empty or not. This may be
  1102. // used to include empty fields in Patch requests.
  1103. ForceSendFields []string `json:"-"`
  1104. // NullFields is a list of field names (e.g. "Variables") to include in
  1105. // API requests with the JSON null value. By default, fields with empty
  1106. // values are omitted from API requests. However, any field with an
  1107. // empty value appearing in NullFields will be sent to the server as
  1108. // null. It is an error if a field in this list has a non-empty value.
  1109. // This may be used to include null fields in Patch requests.
  1110. NullFields []string `json:"-"`
  1111. }
  1112. func (s *ListVariablesResponse) MarshalJSON() ([]byte, error) {
  1113. type NoMethod ListVariablesResponse
  1114. raw := NoMethod(*s)
  1115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1116. }
  1117. // Macro: Represents a Google Tag Manager Macro.
  1118. type Macro struct {
  1119. // AccountId: GTM Account ID.
  1120. AccountId string `json:"accountId,omitempty"`
  1121. // ContainerId: GTM Container ID.
  1122. ContainerId string `json:"containerId,omitempty"`
  1123. // DisablingRuleId: For mobile containers only: A list of rule IDs for
  1124. // disabling conditional macros; the macro is enabled if one of the
  1125. // enabling rules is true while all the disabling rules are false.
  1126. // Treated as an unordered set.
  1127. DisablingRuleId []string `json:"disablingRuleId,omitempty"`
  1128. // EnablingRuleId: For mobile containers only: A list of rule IDs for
  1129. // enabling conditional macros; the macro is enabled if one of the
  1130. // enabling rules is true while all the disabling rules are false.
  1131. // Treated as an unordered set.
  1132. EnablingRuleId []string `json:"enablingRuleId,omitempty"`
  1133. // Fingerprint: The fingerprint of the GTM Macro as computed at storage
  1134. // time. This value is recomputed whenever the macro is modified.
  1135. Fingerprint string `json:"fingerprint,omitempty"`
  1136. // MacroId: The Macro ID uniquely identifies the GTM Macro.
  1137. MacroId string `json:"macroId,omitempty"`
  1138. // Name: Macro display name.
  1139. Name string `json:"name,omitempty"`
  1140. // Notes: User notes on how to apply this macro in the container.
  1141. Notes string `json:"notes,omitempty"`
  1142. // Parameter: The macro's parameters.
  1143. Parameter []*Parameter `json:"parameter,omitempty"`
  1144. // ParentFolderId: Parent folder id.
  1145. ParentFolderId string `json:"parentFolderId,omitempty"`
  1146. // ScheduleEndMs: The end timestamp in milliseconds to schedule a macro.
  1147. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  1148. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  1149. // macro.
  1150. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  1151. // Type: GTM Macro Type.
  1152. Type string `json:"type,omitempty"`
  1153. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1154. // unconditionally include in API requests. By default, fields with
  1155. // empty values are omitted from API requests. However, any non-pointer,
  1156. // non-interface field appearing in ForceSendFields will be sent to the
  1157. // server regardless of whether the field is empty or not. This may be
  1158. // used to include empty fields in Patch requests.
  1159. ForceSendFields []string `json:"-"`
  1160. // NullFields is a list of field names (e.g. "AccountId") to include in
  1161. // API requests with the JSON null value. By default, fields with empty
  1162. // values are omitted from API requests. However, any field with an
  1163. // empty value appearing in NullFields will be sent to the server as
  1164. // null. It is an error if a field in this list has a non-empty value.
  1165. // This may be used to include null fields in Patch requests.
  1166. NullFields []string `json:"-"`
  1167. }
  1168. func (s *Macro) MarshalJSON() ([]byte, error) {
  1169. type NoMethod Macro
  1170. raw := NoMethod(*s)
  1171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1172. }
  1173. // Parameter: Represents a Google Tag Manager Parameter.
  1174. type Parameter struct {
  1175. // Key: The named key that uniquely identifies a parameter. Required for
  1176. // top-level parameters, as well as map values. Ignored for list values.
  1177. Key string `json:"key,omitempty"`
  1178. // List: This list parameter's parameters (keys will be ignored).
  1179. List []*Parameter `json:"list,omitempty"`
  1180. // Map: This map parameter's parameters (must have keys; keys must be
  1181. // unique).
  1182. Map []*Parameter `json:"map,omitempty"`
  1183. // Type: The parameter type. Valid values are:
  1184. // - boolean: The value represents a boolean, represented as 'true' or
  1185. // 'false'
  1186. // - integer: The value represents a 64-bit signed integer value, in
  1187. // base 10
  1188. // - list: A list of parameters should be specified
  1189. // - map: A map of parameters should be specified
  1190. // - template: The value represents any text; this can include variable
  1191. // references (even variable references that might return non-string
  1192. // types)
  1193. //
  1194. // Possible values:
  1195. // "boolean"
  1196. // "integer"
  1197. // "list"
  1198. // "map"
  1199. // "template"
  1200. Type string `json:"type,omitempty"`
  1201. // Value: A parameter's value (may contain variable references such as
  1202. // "{{myVariable}}") as appropriate to the specified type.
  1203. Value string `json:"value,omitempty"`
  1204. // ForceSendFields is a list of field names (e.g. "Key") to
  1205. // unconditionally include in API requests. By default, fields with
  1206. // empty values are omitted from API requests. However, any non-pointer,
  1207. // non-interface field appearing in ForceSendFields will be sent to the
  1208. // server regardless of whether the field is empty or not. This may be
  1209. // used to include empty fields in Patch requests.
  1210. ForceSendFields []string `json:"-"`
  1211. // NullFields is a list of field names (e.g. "Key") to include in API
  1212. // requests with the JSON null value. By default, fields with empty
  1213. // values are omitted from API requests. However, any field with an
  1214. // empty value appearing in NullFields will be sent to the server as
  1215. // null. It is an error if a field in this list has a non-empty value.
  1216. // This may be used to include null fields in Patch requests.
  1217. NullFields []string `json:"-"`
  1218. }
  1219. func (s *Parameter) MarshalJSON() ([]byte, error) {
  1220. type NoMethod Parameter
  1221. raw := NoMethod(*s)
  1222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1223. }
  1224. // PublishContainerVersionResponse: Publish container version response.
  1225. type PublishContainerVersionResponse struct {
  1226. // CompilerError: Compiler errors or not.
  1227. CompilerError bool `json:"compilerError,omitempty"`
  1228. // ContainerVersion: The container version created.
  1229. ContainerVersion *ContainerVersion `json:"containerVersion,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. "CompilerError") 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. "CompilerError") 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 *PublishContainerVersionResponse) MarshalJSON() ([]byte, error) {
  1249. type NoMethod PublishContainerVersionResponse
  1250. raw := NoMethod(*s)
  1251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1252. }
  1253. // Rule: Represents a Google Tag Manager Rule.
  1254. type Rule struct {
  1255. // AccountId: GTM Account ID.
  1256. AccountId string `json:"accountId,omitempty"`
  1257. // Condition: The list of conditions that make up this rule (implicit
  1258. // AND between them).
  1259. Condition []*Condition `json:"condition,omitempty"`
  1260. // ContainerId: GTM Container ID.
  1261. ContainerId string `json:"containerId,omitempty"`
  1262. // Fingerprint: The fingerprint of the GTM Rule as computed at storage
  1263. // time. This value is recomputed whenever the rule is modified.
  1264. Fingerprint string `json:"fingerprint,omitempty"`
  1265. // Name: Rule display name.
  1266. Name string `json:"name,omitempty"`
  1267. // Notes: User notes on how to apply this rule in the container.
  1268. Notes string `json:"notes,omitempty"`
  1269. // RuleId: The Rule ID uniquely identifies the GTM Rule.
  1270. RuleId string `json:"ruleId,omitempty"`
  1271. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1272. // unconditionally include in API requests. By default, fields with
  1273. // empty values are omitted from API requests. However, any non-pointer,
  1274. // non-interface field appearing in ForceSendFields will be sent to the
  1275. // server regardless of whether the field is empty or not. This may be
  1276. // used to include empty fields in Patch requests.
  1277. ForceSendFields []string `json:"-"`
  1278. // NullFields is a list of field names (e.g. "AccountId") to include in
  1279. // API requests with the JSON null value. By default, fields with empty
  1280. // values are omitted from API requests. However, any field with an
  1281. // empty value appearing in NullFields will be sent to the server as
  1282. // null. It is an error if a field in this list has a non-empty value.
  1283. // This may be used to include null fields in Patch requests.
  1284. NullFields []string `json:"-"`
  1285. }
  1286. func (s *Rule) MarshalJSON() ([]byte, error) {
  1287. type NoMethod Rule
  1288. raw := NoMethod(*s)
  1289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1290. }
  1291. type SetupTag struct {
  1292. // StopOnSetupFailure: If true, fire the main tag if and only if the
  1293. // setup tag fires successfully. If false, fire the main tag regardless
  1294. // of setup tag firing status.
  1295. StopOnSetupFailure bool `json:"stopOnSetupFailure,omitempty"`
  1296. // TagName: The name of the setup tag.
  1297. TagName string `json:"tagName,omitempty"`
  1298. // ForceSendFields is a list of field names (e.g. "StopOnSetupFailure")
  1299. // to unconditionally include in API requests. By default, fields with
  1300. // empty values are omitted from API requests. However, any non-pointer,
  1301. // non-interface field appearing in ForceSendFields will be sent to the
  1302. // server regardless of whether the field is empty or not. This may be
  1303. // used to include empty fields in Patch requests.
  1304. ForceSendFields []string `json:"-"`
  1305. // NullFields is a list of field names (e.g. "StopOnSetupFailure") to
  1306. // include in API requests with the JSON null value. By default, fields
  1307. // with empty values are omitted from API requests. However, any field
  1308. // with an empty value appearing in NullFields will be sent to the
  1309. // server as null. It is an error if a field in this list has a
  1310. // non-empty value. This may be used to include null fields in Patch
  1311. // requests.
  1312. NullFields []string `json:"-"`
  1313. }
  1314. func (s *SetupTag) MarshalJSON() ([]byte, error) {
  1315. type NoMethod SetupTag
  1316. raw := NoMethod(*s)
  1317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1318. }
  1319. // Tag: Represents a Google Tag Manager Tag.
  1320. type Tag struct {
  1321. // AccountId: GTM Account ID.
  1322. AccountId string `json:"accountId,omitempty"`
  1323. // BlockingRuleId: Blocking rule IDs. If any of the listed rules
  1324. // evaluate to true, the tag will not fire.
  1325. BlockingRuleId []string `json:"blockingRuleId,omitempty"`
  1326. // BlockingTriggerId: Blocking trigger IDs. If any of the listed
  1327. // triggers evaluate to true, the tag will not fire.
  1328. BlockingTriggerId []string `json:"blockingTriggerId,omitempty"`
  1329. // ContainerId: GTM Container ID.
  1330. ContainerId string `json:"containerId,omitempty"`
  1331. // Fingerprint: The fingerprint of the GTM Tag as computed at storage
  1332. // time. This value is recomputed whenever the tag is modified.
  1333. Fingerprint string `json:"fingerprint,omitempty"`
  1334. // FiringRuleId: Firing rule IDs. A tag will fire when any of the listed
  1335. // rules are true and all of its blockingRuleIds (if any specified) are
  1336. // false.
  1337. FiringRuleId []string `json:"firingRuleId,omitempty"`
  1338. // FiringTriggerId: Firing trigger IDs. A tag will fire when any of the
  1339. // listed triggers are true and all of its blockingTriggerIds (if any
  1340. // specified) are false.
  1341. FiringTriggerId []string `json:"firingTriggerId,omitempty"`
  1342. // LiveOnly: If set to true, this tag will only fire in the live
  1343. // environment (e.g. not in preview or debug mode).
  1344. LiveOnly bool `json:"liveOnly,omitempty"`
  1345. // Name: Tag display name.
  1346. Name string `json:"name,omitempty"`
  1347. // Notes: User notes on how to apply this tag in the container.
  1348. Notes string `json:"notes,omitempty"`
  1349. // Parameter: The tag's parameters.
  1350. Parameter []*Parameter `json:"parameter,omitempty"`
  1351. // ParentFolderId: Parent folder id.
  1352. ParentFolderId string `json:"parentFolderId,omitempty"`
  1353. // Paused: True if the tag is paused.
  1354. Paused bool `json:"paused,omitempty"`
  1355. // Priority: User defined numeric priority of the tag. Tags are fired
  1356. // asynchronously in order of priority. Tags with higher numeric value
  1357. // fire first. A tag's priority can be a positive or negative value. The
  1358. // default value is 0.
  1359. Priority *Parameter `json:"priority,omitempty"`
  1360. // ScheduleEndMs: The end timestamp in milliseconds to schedule a tag.
  1361. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  1362. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  1363. // tag.
  1364. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  1365. // SetupTag: The list of setup tags. Currently we only allow one.
  1366. SetupTag []*SetupTag `json:"setupTag,omitempty"`
  1367. // TagFiringOption: Option to fire this tag.
  1368. //
  1369. // Possible values:
  1370. // "oncePerEvent"
  1371. // "oncePerLoad"
  1372. // "unlimited"
  1373. TagFiringOption string `json:"tagFiringOption,omitempty"`
  1374. // TagId: The Tag ID uniquely identifies the GTM Tag.
  1375. TagId string `json:"tagId,omitempty"`
  1376. // TeardownTag: The list of teardown tags. Currently we only allow one.
  1377. TeardownTag []*TeardownTag `json:"teardownTag,omitempty"`
  1378. // Type: GTM Tag Type.
  1379. Type string `json:"type,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. "AccountId") 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. "AccountId") to include in
  1391. // API requests with the JSON null value. By default, fields with empty
  1392. // values are omitted from API requests. However, any field with an
  1393. // 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 *Tag) MarshalJSON() ([]byte, error) {
  1399. type NoMethod Tag
  1400. raw := NoMethod(*s)
  1401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402. }
  1403. type TeardownTag struct {
  1404. // StopTeardownOnFailure: If true, fire the teardown tag if and only if
  1405. // the main tag fires successfully. If false, fire the teardown tag
  1406. // regardless of main tag firing status.
  1407. StopTeardownOnFailure bool `json:"stopTeardownOnFailure,omitempty"`
  1408. // TagName: The name of the teardown tag.
  1409. TagName string `json:"tagName,omitempty"`
  1410. // ForceSendFields is a list of field names (e.g.
  1411. // "StopTeardownOnFailure") to unconditionally include in API requests.
  1412. // By default, fields with empty values are omitted from API requests.
  1413. // However, any non-pointer, non-interface field appearing in
  1414. // ForceSendFields will be sent to the server regardless of whether the
  1415. // field is empty or not. This may be used to include empty fields in
  1416. // Patch requests.
  1417. ForceSendFields []string `json:"-"`
  1418. // NullFields is a list of field names (e.g. "StopTeardownOnFailure") to
  1419. // include in API requests with the JSON null value. By default, fields
  1420. // with empty values are omitted from API requests. However, any field
  1421. // with an empty value appearing in NullFields will be sent to the
  1422. // server as null. It is an error if a field in this list has a
  1423. // non-empty value. This may be used to include null fields in Patch
  1424. // requests.
  1425. NullFields []string `json:"-"`
  1426. }
  1427. func (s *TeardownTag) MarshalJSON() ([]byte, error) {
  1428. type NoMethod TeardownTag
  1429. raw := NoMethod(*s)
  1430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1431. }
  1432. // Trigger: Represents a Google Tag Manager Trigger
  1433. type Trigger struct {
  1434. // AccountId: GTM Account ID.
  1435. AccountId string `json:"accountId,omitempty"`
  1436. // AutoEventFilter: Used in the case of auto event tracking.
  1437. AutoEventFilter []*Condition `json:"autoEventFilter,omitempty"`
  1438. // CheckValidation: Whether or not we should only fire tags if the form
  1439. // submit or link click event is not cancelled by some other event
  1440. // handler (e.g. because of validation). Only valid for Form Submission
  1441. // and Link Click triggers.
  1442. CheckValidation *Parameter `json:"checkValidation,omitempty"`
  1443. // ContainerId: GTM Container ID.
  1444. ContainerId string `json:"containerId,omitempty"`
  1445. // ContinuousTimeMinMilliseconds: A visibility trigger minimum
  1446. // continuous visible time (in milliseconds). Only valid for AMP
  1447. // Visibility trigger.
  1448. ContinuousTimeMinMilliseconds *Parameter `json:"continuousTimeMinMilliseconds,omitempty"`
  1449. // CustomEventFilter: Used in the case of custom event, which is fired
  1450. // iff all Conditions are true.
  1451. CustomEventFilter []*Condition `json:"customEventFilter,omitempty"`
  1452. // EventName: Name of the GTM event that is fired. Only valid for Timer
  1453. // triggers.
  1454. EventName *Parameter `json:"eventName,omitempty"`
  1455. // Filter: The trigger will only fire iff all Conditions are true.
  1456. Filter []*Condition `json:"filter,omitempty"`
  1457. // Fingerprint: The fingerprint of the GTM Trigger as computed at
  1458. // storage time. This value is recomputed whenever the trigger is
  1459. // modified.
  1460. Fingerprint string `json:"fingerprint,omitempty"`
  1461. // HorizontalScrollPercentageList: List of integer percentage values for
  1462. // scroll triggers. The trigger will fire when each percentage is
  1463. // reached when the view is scrolled horizontally. Only valid for AMP
  1464. // scroll triggers.
  1465. HorizontalScrollPercentageList *Parameter `json:"horizontalScrollPercentageList,omitempty"`
  1466. // Interval: Time between triggering recurring Timer Events (in
  1467. // milliseconds). Only valid for Timer triggers.
  1468. Interval *Parameter `json:"interval,omitempty"`
  1469. // IntervalSeconds: Time between Timer Events to fire (in seconds). Only
  1470. // valid for AMP Timer trigger.
  1471. IntervalSeconds *Parameter `json:"intervalSeconds,omitempty"`
  1472. // Limit: Limit of the number of GTM events this Timer Trigger will
  1473. // fire. If no limit is set, we will continue to fire GTM events until
  1474. // the user leaves the page. Only valid for Timer triggers.
  1475. Limit *Parameter `json:"limit,omitempty"`
  1476. // MaxTimerLengthSeconds: Max time to fire Timer Events (in seconds).
  1477. // Only valid for AMP Timer trigger.
  1478. MaxTimerLengthSeconds *Parameter `json:"maxTimerLengthSeconds,omitempty"`
  1479. // Name: Trigger display name.
  1480. Name string `json:"name,omitempty"`
  1481. // Parameter: Additional parameters.
  1482. Parameter []*Parameter `json:"parameter,omitempty"`
  1483. // ParentFolderId: Parent folder id.
  1484. ParentFolderId string `json:"parentFolderId,omitempty"`
  1485. // Selector: A click trigger CSS selector (i.e. "a", "button" etc.).
  1486. // Only valid for AMP Click trigger.
  1487. Selector *Parameter `json:"selector,omitempty"`
  1488. // TotalTimeMinMilliseconds: A visibility trigger minimum total visible
  1489. // time (in milliseconds). Only valid for AMP Visibility trigger.
  1490. TotalTimeMinMilliseconds *Parameter `json:"totalTimeMinMilliseconds,omitempty"`
  1491. // TriggerId: The Trigger ID uniquely identifies the GTM Trigger.
  1492. TriggerId string `json:"triggerId,omitempty"`
  1493. // Type: Defines the data layer event that causes this trigger.
  1494. //
  1495. // Possible values:
  1496. // "always"
  1497. // "ampClick"
  1498. // "ampScroll"
  1499. // "ampTimer"
  1500. // "ampVisibility"
  1501. // "click"
  1502. // "customEvent"
  1503. // "domReady"
  1504. // "elementVisibility"
  1505. // "formSubmission"
  1506. // "historyChange"
  1507. // "jsError"
  1508. // "linkClick"
  1509. // "pageview"
  1510. // "scrollDepth"
  1511. // "timer"
  1512. // "windowLoaded"
  1513. // "youTubeVideo"
  1514. Type string `json:"type,omitempty"`
  1515. // UniqueTriggerId: Globally unique id of the trigger that
  1516. // auto-generates this (a Form Submit, Link Click or Timer listener) if
  1517. // any. Used to make incompatible auto-events work together with trigger
  1518. // filtering based on trigger ids. This value is populated during output
  1519. // generation since the tags implied by triggers don't exist until then.
  1520. // Only valid for Form Submit, Link Click and Timer triggers.
  1521. UniqueTriggerId *Parameter `json:"uniqueTriggerId,omitempty"`
  1522. // VerticalScrollPercentageList: List of integer percentage values for
  1523. // scroll triggers. The trigger will fire when each percentage is
  1524. // reached when the view is scrolled vertically. Only valid for AMP
  1525. // scroll triggers.
  1526. VerticalScrollPercentageList *Parameter `json:"verticalScrollPercentageList,omitempty"`
  1527. // VisibilitySelector: A visibility trigger CSS selector (i.e. "#id").
  1528. // Only valid for AMP Visibility trigger.
  1529. VisibilitySelector *Parameter `json:"visibilitySelector,omitempty"`
  1530. // VisiblePercentageMax: A visibility trigger maximum percent
  1531. // visibility. Only valid for AMP Visibility trigger.
  1532. VisiblePercentageMax *Parameter `json:"visiblePercentageMax,omitempty"`
  1533. // VisiblePercentageMin: A visibility trigger minimum percent
  1534. // visibility. Only valid for AMP Visibility trigger.
  1535. VisiblePercentageMin *Parameter `json:"visiblePercentageMin,omitempty"`
  1536. // WaitForTags: Whether or not we should delay the form submissions or
  1537. // link opening until all of the tags have fired (by preventing the
  1538. // default action and later simulating the default action). Only valid
  1539. // for Form Submission and Link Click triggers.
  1540. WaitForTags *Parameter `json:"waitForTags,omitempty"`
  1541. // WaitForTagsTimeout: How long to wait (in milliseconds) for tags to
  1542. // fire when 'waits_for_tags' above evaluates to true. Only valid for
  1543. // Form Submission and Link Click triggers.
  1544. WaitForTagsTimeout *Parameter `json:"waitForTagsTimeout,omitempty"`
  1545. // ServerResponse contains the HTTP response code and headers from the
  1546. // server.
  1547. googleapi.ServerResponse `json:"-"`
  1548. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1549. // unconditionally include in API requests. By default, fields with
  1550. // empty values are omitted from API requests. However, any non-pointer,
  1551. // non-interface field appearing in ForceSendFields will be sent to the
  1552. // server regardless of whether the field is empty or not. This may be
  1553. // used to include empty fields in Patch requests.
  1554. ForceSendFields []string `json:"-"`
  1555. // NullFields is a list of field names (e.g. "AccountId") to include in
  1556. // API requests with the JSON null value. By default, fields with empty
  1557. // values are omitted from API requests. However, any field with an
  1558. // empty value appearing in NullFields will be sent to the server as
  1559. // null. It is an error if a field in this list has a non-empty value.
  1560. // This may be used to include null fields in Patch requests.
  1561. NullFields []string `json:"-"`
  1562. }
  1563. func (s *Trigger) MarshalJSON() ([]byte, error) {
  1564. type NoMethod Trigger
  1565. raw := NoMethod(*s)
  1566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1567. }
  1568. // UserAccess: Represents a user's permissions to an account and its
  1569. // container.
  1570. type UserAccess struct {
  1571. // AccountAccess: GTM Account access permissions.
  1572. AccountAccess *AccountAccess `json:"accountAccess,omitempty"`
  1573. // AccountId: GTM Account ID.
  1574. AccountId string `json:"accountId,omitempty"`
  1575. // ContainerAccess: GTM Container access permissions.
  1576. ContainerAccess []*ContainerAccess `json:"containerAccess,omitempty"`
  1577. // EmailAddress: User's email address.
  1578. EmailAddress string `json:"emailAddress,omitempty"`
  1579. // PermissionId: Account Permission ID.
  1580. PermissionId string `json:"permissionId,omitempty"`
  1581. // ServerResponse contains the HTTP response code and headers from the
  1582. // server.
  1583. googleapi.ServerResponse `json:"-"`
  1584. // ForceSendFields is a list of field names (e.g. "AccountAccess") to
  1585. // unconditionally include in API requests. By default, fields with
  1586. // empty values are omitted from API requests. However, any non-pointer,
  1587. // non-interface field appearing in ForceSendFields will be sent to the
  1588. // server regardless of whether the field is empty or not. This may be
  1589. // used to include empty fields in Patch requests.
  1590. ForceSendFields []string `json:"-"`
  1591. // NullFields is a list of field names (e.g. "AccountAccess") to include
  1592. // in API requests with the JSON null value. By default, fields with
  1593. // empty values are omitted from API requests. However, any field with
  1594. // an empty value appearing in NullFields will be sent to the server as
  1595. // null. It is an error if a field in this list has a non-empty value.
  1596. // This may be used to include null fields in Patch requests.
  1597. NullFields []string `json:"-"`
  1598. }
  1599. func (s *UserAccess) MarshalJSON() ([]byte, error) {
  1600. type NoMethod UserAccess
  1601. raw := NoMethod(*s)
  1602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1603. }
  1604. // Variable: Represents a Google Tag Manager Variable.
  1605. type Variable struct {
  1606. // AccountId: GTM Account ID.
  1607. AccountId string `json:"accountId,omitempty"`
  1608. // ContainerId: GTM Container ID.
  1609. ContainerId string `json:"containerId,omitempty"`
  1610. // DisablingTriggerId: For mobile containers only: A list of trigger IDs
  1611. // for disabling conditional variables; the variable is enabled if one
  1612. // of the enabling trigger is true while all the disabling trigger are
  1613. // false. Treated as an unordered set.
  1614. DisablingTriggerId []string `json:"disablingTriggerId,omitempty"`
  1615. // EnablingTriggerId: For mobile containers only: A list of trigger IDs
  1616. // for enabling conditional variables; the variable is enabled if one of
  1617. // the enabling triggers is true while all the disabling triggers are
  1618. // false. Treated as an unordered set.
  1619. EnablingTriggerId []string `json:"enablingTriggerId,omitempty"`
  1620. // Fingerprint: The fingerprint of the GTM Variable as computed at
  1621. // storage time. This value is recomputed whenever the variable is
  1622. // modified.
  1623. Fingerprint string `json:"fingerprint,omitempty"`
  1624. // Name: Variable display name.
  1625. Name string `json:"name,omitempty"`
  1626. // Notes: User notes on how to apply this variable in the container.
  1627. Notes string `json:"notes,omitempty"`
  1628. // Parameter: The variable's parameters.
  1629. Parameter []*Parameter `json:"parameter,omitempty"`
  1630. // ParentFolderId: Parent folder id.
  1631. ParentFolderId string `json:"parentFolderId,omitempty"`
  1632. // ScheduleEndMs: The end timestamp in milliseconds to schedule a
  1633. // variable.
  1634. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  1635. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  1636. // variable.
  1637. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  1638. // Type: GTM Variable Type.
  1639. Type string `json:"type,omitempty"`
  1640. // VariableId: The Variable ID uniquely identifies the GTM Variable.
  1641. VariableId string `json:"variableId,omitempty"`
  1642. // ServerResponse contains the HTTP response code and headers from the
  1643. // server.
  1644. googleapi.ServerResponse `json:"-"`
  1645. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1646. // unconditionally include in API requests. By default, fields with
  1647. // empty values are omitted from API requests. However, any non-pointer,
  1648. // non-interface field appearing in ForceSendFields will be sent to the
  1649. // server regardless of whether the field is empty or not. This may be
  1650. // used to include empty fields in Patch requests.
  1651. ForceSendFields []string `json:"-"`
  1652. // NullFields is a list of field names (e.g. "AccountId") to include in
  1653. // API requests with the JSON null value. By default, fields with empty
  1654. // values are omitted from API requests. However, any field with an
  1655. // empty value appearing in NullFields will be sent to the server as
  1656. // null. It is an error if a field in this list has a non-empty value.
  1657. // This may be used to include null fields in Patch requests.
  1658. NullFields []string `json:"-"`
  1659. }
  1660. func (s *Variable) MarshalJSON() ([]byte, error) {
  1661. type NoMethod Variable
  1662. raw := NoMethod(*s)
  1663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1664. }
  1665. // method id "tagmanager.accounts.get":
  1666. type AccountsGetCall struct {
  1667. s *Service
  1668. accountId string
  1669. urlParams_ gensupport.URLParams
  1670. ifNoneMatch_ string
  1671. ctx_ context.Context
  1672. header_ http.Header
  1673. }
  1674. // Get: Gets a GTM Account.
  1675. func (r *AccountsService) Get(accountId string) *AccountsGetCall {
  1676. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1677. c.accountId = accountId
  1678. return c
  1679. }
  1680. // Fields allows partial responses to be retrieved. See
  1681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1682. // for more information.
  1683. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  1684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1685. return c
  1686. }
  1687. // IfNoneMatch sets the optional parameter which makes the operation
  1688. // fail if the object's ETag matches the given value. This is useful for
  1689. // getting updates only after the object has changed since the last
  1690. // request. Use googleapi.IsNotModified to check whether the response
  1691. // error from Do is the result of In-None-Match.
  1692. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  1693. c.ifNoneMatch_ = entityTag
  1694. return c
  1695. }
  1696. // Context sets the context to be used in this call's Do method. Any
  1697. // pending HTTP request will be aborted if the provided context is
  1698. // canceled.
  1699. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  1700. c.ctx_ = ctx
  1701. return c
  1702. }
  1703. // Header returns an http.Header that can be modified by the caller to
  1704. // add HTTP headers to the request.
  1705. func (c *AccountsGetCall) Header() http.Header {
  1706. if c.header_ == nil {
  1707. c.header_ = make(http.Header)
  1708. }
  1709. return c.header_
  1710. }
  1711. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  1712. reqHeaders := make(http.Header)
  1713. for k, v := range c.header_ {
  1714. reqHeaders[k] = v
  1715. }
  1716. reqHeaders.Set("User-Agent", c.s.userAgent())
  1717. if c.ifNoneMatch_ != "" {
  1718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1719. }
  1720. var body io.Reader = nil
  1721. c.urlParams_.Set("alt", alt)
  1722. c.urlParams_.Set("prettyPrint", "false")
  1723. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
  1724. urls += "?" + c.urlParams_.Encode()
  1725. req, err := http.NewRequest("GET", urls, body)
  1726. if err != nil {
  1727. return nil, err
  1728. }
  1729. req.Header = reqHeaders
  1730. googleapi.Expand(req.URL, map[string]string{
  1731. "accountId": c.accountId,
  1732. })
  1733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1734. }
  1735. // Do executes the "tagmanager.accounts.get" call.
  1736. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  1737. // code is an error. Response headers are in either
  1738. // *Account.ServerResponse.Header or (if a response was returned at all)
  1739. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1740. // check whether the returned error was because http.StatusNotModified
  1741. // was returned.
  1742. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  1743. gensupport.SetOptions(c.urlParams_, opts...)
  1744. res, err := c.doRequest("json")
  1745. if res != nil && res.StatusCode == http.StatusNotModified {
  1746. if res.Body != nil {
  1747. res.Body.Close()
  1748. }
  1749. return nil, &googleapi.Error{
  1750. Code: res.StatusCode,
  1751. Header: res.Header,
  1752. }
  1753. }
  1754. if err != nil {
  1755. return nil, err
  1756. }
  1757. defer googleapi.CloseBody(res)
  1758. if err := googleapi.CheckResponse(res); err != nil {
  1759. return nil, err
  1760. }
  1761. ret := &Account{
  1762. ServerResponse: googleapi.ServerResponse{
  1763. Header: res.Header,
  1764. HTTPStatusCode: res.StatusCode,
  1765. },
  1766. }
  1767. target := &ret
  1768. if err := gensupport.DecodeResponse(target, res); err != nil {
  1769. return nil, err
  1770. }
  1771. return ret, nil
  1772. // {
  1773. // "description": "Gets a GTM Account.",
  1774. // "httpMethod": "GET",
  1775. // "id": "tagmanager.accounts.get",
  1776. // "parameterOrder": [
  1777. // "accountId"
  1778. // ],
  1779. // "parameters": {
  1780. // "accountId": {
  1781. // "description": "The GTM Account ID.",
  1782. // "location": "path",
  1783. // "required": true,
  1784. // "type": "string"
  1785. // }
  1786. // },
  1787. // "path": "accounts/{accountId}",
  1788. // "response": {
  1789. // "$ref": "Account"
  1790. // },
  1791. // "scopes": [
  1792. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  1793. // "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  1794. // "https://www.googleapis.com/auth/tagmanager.readonly"
  1795. // ]
  1796. // }
  1797. }
  1798. // method id "tagmanager.accounts.list":
  1799. type AccountsListCall struct {
  1800. s *Service
  1801. urlParams_ gensupport.URLParams
  1802. ifNoneMatch_ string
  1803. ctx_ context.Context
  1804. header_ http.Header
  1805. }
  1806. // List: Lists all GTM Accounts that a user has access to.
  1807. func (r *AccountsService) List() *AccountsListCall {
  1808. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1809. return c
  1810. }
  1811. // Fields allows partial responses to be retrieved. See
  1812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1813. // for more information.
  1814. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  1815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1816. return c
  1817. }
  1818. // IfNoneMatch sets the optional parameter which makes the operation
  1819. // fail if the object's ETag matches the given value. This is useful for
  1820. // getting updates only after the object has changed since the last
  1821. // request. Use googleapi.IsNotModified to check whether the response
  1822. // error from Do is the result of In-None-Match.
  1823. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  1824. c.ifNoneMatch_ = entityTag
  1825. return c
  1826. }
  1827. // Context sets the context to be used in this call's Do method. Any
  1828. // pending HTTP request will be aborted if the provided context is
  1829. // canceled.
  1830. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  1831. c.ctx_ = ctx
  1832. return c
  1833. }
  1834. // Header returns an http.Header that can be modified by the caller to
  1835. // add HTTP headers to the request.
  1836. func (c *AccountsListCall) Header() http.Header {
  1837. if c.header_ == nil {
  1838. c.header_ = make(http.Header)
  1839. }
  1840. return c.header_
  1841. }
  1842. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  1843. reqHeaders := make(http.Header)
  1844. for k, v := range c.header_ {
  1845. reqHeaders[k] = v
  1846. }
  1847. reqHeaders.Set("User-Agent", c.s.userAgent())
  1848. if c.ifNoneMatch_ != "" {
  1849. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1850. }
  1851. var body io.Reader = nil
  1852. c.urlParams_.Set("alt", alt)
  1853. c.urlParams_.Set("prettyPrint", "false")
  1854. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
  1855. urls += "?" + c.urlParams_.Encode()
  1856. req, err := http.NewRequest("GET", urls, body)
  1857. if err != nil {
  1858. return nil, err
  1859. }
  1860. req.Header = reqHeaders
  1861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1862. }
  1863. // Do executes the "tagmanager.accounts.list" call.
  1864. // Exactly one of *ListAccountsResponse or error will be non-nil. Any
  1865. // non-2xx status code is an error. Response headers are in either
  1866. // *ListAccountsResponse.ServerResponse.Header or (if a response was
  1867. // returned at all) in error.(*googleapi.Error).Header. Use
  1868. // googleapi.IsNotModified to check whether the returned error was
  1869. // because http.StatusNotModified was returned.
  1870. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error) {
  1871. gensupport.SetOptions(c.urlParams_, opts...)
  1872. res, err := c.doRequest("json")
  1873. if res != nil && res.StatusCode == http.StatusNotModified {
  1874. if res.Body != nil {
  1875. res.Body.Close()
  1876. }
  1877. return nil, &googleapi.Error{
  1878. Code: res.StatusCode,
  1879. Header: res.Header,
  1880. }
  1881. }
  1882. if err != nil {
  1883. return nil, err
  1884. }
  1885. defer googleapi.CloseBody(res)
  1886. if err := googleapi.CheckResponse(res); err != nil {
  1887. return nil, err
  1888. }
  1889. ret := &ListAccountsResponse{
  1890. ServerResponse: googleapi.ServerResponse{
  1891. Header: res.Header,
  1892. HTTPStatusCode: res.StatusCode,
  1893. },
  1894. }
  1895. target := &ret
  1896. if err := gensupport.DecodeResponse(target, res); err != nil {
  1897. return nil, err
  1898. }
  1899. return ret, nil
  1900. // {
  1901. // "description": "Lists all GTM Accounts that a user has access to.",
  1902. // "httpMethod": "GET",
  1903. // "id": "tagmanager.accounts.list",
  1904. // "path": "accounts",
  1905. // "response": {
  1906. // "$ref": "ListAccountsResponse"
  1907. // },
  1908. // "scopes": [
  1909. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  1910. // "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  1911. // "https://www.googleapis.com/auth/tagmanager.readonly"
  1912. // ]
  1913. // }
  1914. }
  1915. // method id "tagmanager.accounts.update":
  1916. type AccountsUpdateCall struct {
  1917. s *Service
  1918. accountId string
  1919. account *Account
  1920. urlParams_ gensupport.URLParams
  1921. ctx_ context.Context
  1922. header_ http.Header
  1923. }
  1924. // Update: Updates a GTM Account.
  1925. func (r *AccountsService) Update(accountId string, account *Account) *AccountsUpdateCall {
  1926. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1927. c.accountId = accountId
  1928. c.account = account
  1929. return c
  1930. }
  1931. // Fingerprint sets the optional parameter "fingerprint": When provided,
  1932. // this fingerprint must match the fingerprint of the account in
  1933. // storage.
  1934. func (c *AccountsUpdateCall) Fingerprint(fingerprint string) *AccountsUpdateCall {
  1935. c.urlParams_.Set("fingerprint", fingerprint)
  1936. return c
  1937. }
  1938. // Fields allows partial responses to be retrieved. See
  1939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1940. // for more information.
  1941. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  1942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1943. return c
  1944. }
  1945. // Context sets the context to be used in this call's Do method. Any
  1946. // pending HTTP request will be aborted if the provided context is
  1947. // canceled.
  1948. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  1949. c.ctx_ = ctx
  1950. return c
  1951. }
  1952. // Header returns an http.Header that can be modified by the caller to
  1953. // add HTTP headers to the request.
  1954. func (c *AccountsUpdateCall) Header() http.Header {
  1955. if c.header_ == nil {
  1956. c.header_ = make(http.Header)
  1957. }
  1958. return c.header_
  1959. }
  1960. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1961. reqHeaders := make(http.Header)
  1962. for k, v := range c.header_ {
  1963. reqHeaders[k] = v
  1964. }
  1965. reqHeaders.Set("User-Agent", c.s.userAgent())
  1966. var body io.Reader = nil
  1967. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  1968. if err != nil {
  1969. return nil, err
  1970. }
  1971. reqHeaders.Set("Content-Type", "application/json")
  1972. c.urlParams_.Set("alt", alt)
  1973. c.urlParams_.Set("prettyPrint", "false")
  1974. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
  1975. urls += "?" + c.urlParams_.Encode()
  1976. req, err := http.NewRequest("PUT", urls, body)
  1977. if err != nil {
  1978. return nil, err
  1979. }
  1980. req.Header = reqHeaders
  1981. googleapi.Expand(req.URL, map[string]string{
  1982. "accountId": c.accountId,
  1983. })
  1984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1985. }
  1986. // Do executes the "tagmanager.accounts.update" call.
  1987. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  1988. // code is an error. Response headers are in either
  1989. // *Account.ServerResponse.Header or (if a response was returned at all)
  1990. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1991. // check whether the returned error was because http.StatusNotModified
  1992. // was returned.
  1993. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  1994. gensupport.SetOptions(c.urlParams_, opts...)
  1995. res, err := c.doRequest("json")
  1996. if res != nil && res.StatusCode == http.StatusNotModified {
  1997. if res.Body != nil {
  1998. res.Body.Close()
  1999. }
  2000. return nil, &googleapi.Error{
  2001. Code: res.StatusCode,
  2002. Header: res.Header,
  2003. }
  2004. }
  2005. if err != nil {
  2006. return nil, err
  2007. }
  2008. defer googleapi.CloseBody(res)
  2009. if err := googleapi.CheckResponse(res); err != nil {
  2010. return nil, err
  2011. }
  2012. ret := &Account{
  2013. ServerResponse: googleapi.ServerResponse{
  2014. Header: res.Header,
  2015. HTTPStatusCode: res.StatusCode,
  2016. },
  2017. }
  2018. target := &ret
  2019. if err := gensupport.DecodeResponse(target, res); err != nil {
  2020. return nil, err
  2021. }
  2022. return ret, nil
  2023. // {
  2024. // "description": "Updates a GTM Account.",
  2025. // "httpMethod": "PUT",
  2026. // "id": "tagmanager.accounts.update",
  2027. // "parameterOrder": [
  2028. // "accountId"
  2029. // ],
  2030. // "parameters": {
  2031. // "accountId": {
  2032. // "description": "The GTM Account ID.",
  2033. // "location": "path",
  2034. // "required": true,
  2035. // "type": "string"
  2036. // },
  2037. // "fingerprint": {
  2038. // "description": "When provided, this fingerprint must match the fingerprint of the account in storage.",
  2039. // "location": "query",
  2040. // "type": "string"
  2041. // }
  2042. // },
  2043. // "path": "accounts/{accountId}",
  2044. // "request": {
  2045. // "$ref": "Account"
  2046. // },
  2047. // "response": {
  2048. // "$ref": "Account"
  2049. // },
  2050. // "scopes": [
  2051. // "https://www.googleapis.com/auth/tagmanager.manage.accounts"
  2052. // ]
  2053. // }
  2054. }
  2055. // method id "tagmanager.accounts.containers.create":
  2056. type AccountsContainersCreateCall struct {
  2057. s *Service
  2058. accountId string
  2059. container *Container
  2060. urlParams_ gensupport.URLParams
  2061. ctx_ context.Context
  2062. header_ http.Header
  2063. }
  2064. // Create: Creates a Container.
  2065. func (r *AccountsContainersService) Create(accountId string, container *Container) *AccountsContainersCreateCall {
  2066. c := &AccountsContainersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2067. c.accountId = accountId
  2068. c.container = container
  2069. return c
  2070. }
  2071. // Fields allows partial responses to be retrieved. See
  2072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2073. // for more information.
  2074. func (c *AccountsContainersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersCreateCall {
  2075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2076. return c
  2077. }
  2078. // Context sets the context to be used in this call's Do method. Any
  2079. // pending HTTP request will be aborted if the provided context is
  2080. // canceled.
  2081. func (c *AccountsContainersCreateCall) Context(ctx context.Context) *AccountsContainersCreateCall {
  2082. c.ctx_ = ctx
  2083. return c
  2084. }
  2085. // Header returns an http.Header that can be modified by the caller to
  2086. // add HTTP headers to the request.
  2087. func (c *AccountsContainersCreateCall) Header() http.Header {
  2088. if c.header_ == nil {
  2089. c.header_ = make(http.Header)
  2090. }
  2091. return c.header_
  2092. }
  2093. func (c *AccountsContainersCreateCall) doRequest(alt string) (*http.Response, error) {
  2094. reqHeaders := make(http.Header)
  2095. for k, v := range c.header_ {
  2096. reqHeaders[k] = v
  2097. }
  2098. reqHeaders.Set("User-Agent", c.s.userAgent())
  2099. var body io.Reader = nil
  2100. body, err := googleapi.WithoutDataWrapper.JSONReader(c.container)
  2101. if err != nil {
  2102. return nil, err
  2103. }
  2104. reqHeaders.Set("Content-Type", "application/json")
  2105. c.urlParams_.Set("alt", alt)
  2106. c.urlParams_.Set("prettyPrint", "false")
  2107. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers")
  2108. urls += "?" + c.urlParams_.Encode()
  2109. req, err := http.NewRequest("POST", urls, body)
  2110. if err != nil {
  2111. return nil, err
  2112. }
  2113. req.Header = reqHeaders
  2114. googleapi.Expand(req.URL, map[string]string{
  2115. "accountId": c.accountId,
  2116. })
  2117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2118. }
  2119. // Do executes the "tagmanager.accounts.containers.create" call.
  2120. // Exactly one of *Container or error will be non-nil. Any non-2xx
  2121. // status code is an error. Response headers are in either
  2122. // *Container.ServerResponse.Header or (if a response was returned at
  2123. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2124. // to check whether the returned error was because
  2125. // http.StatusNotModified was returned.
  2126. func (c *AccountsContainersCreateCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  2127. gensupport.SetOptions(c.urlParams_, opts...)
  2128. res, err := c.doRequest("json")
  2129. if res != nil && res.StatusCode == http.StatusNotModified {
  2130. if res.Body != nil {
  2131. res.Body.Close()
  2132. }
  2133. return nil, &googleapi.Error{
  2134. Code: res.StatusCode,
  2135. Header: res.Header,
  2136. }
  2137. }
  2138. if err != nil {
  2139. return nil, err
  2140. }
  2141. defer googleapi.CloseBody(res)
  2142. if err := googleapi.CheckResponse(res); err != nil {
  2143. return nil, err
  2144. }
  2145. ret := &Container{
  2146. ServerResponse: googleapi.ServerResponse{
  2147. Header: res.Header,
  2148. HTTPStatusCode: res.StatusCode,
  2149. },
  2150. }
  2151. target := &ret
  2152. if err := gensupport.DecodeResponse(target, res); err != nil {
  2153. return nil, err
  2154. }
  2155. return ret, nil
  2156. // {
  2157. // "description": "Creates a Container.",
  2158. // "httpMethod": "POST",
  2159. // "id": "tagmanager.accounts.containers.create",
  2160. // "parameterOrder": [
  2161. // "accountId"
  2162. // ],
  2163. // "parameters": {
  2164. // "accountId": {
  2165. // "description": "The GTM Account ID.",
  2166. // "location": "path",
  2167. // "required": true,
  2168. // "type": "string"
  2169. // }
  2170. // },
  2171. // "path": "accounts/{accountId}/containers",
  2172. // "request": {
  2173. // "$ref": "Container"
  2174. // },
  2175. // "response": {
  2176. // "$ref": "Container"
  2177. // },
  2178. // "scopes": [
  2179. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  2180. // ]
  2181. // }
  2182. }
  2183. // method id "tagmanager.accounts.containers.delete":
  2184. type AccountsContainersDeleteCall struct {
  2185. s *Service
  2186. accountId string
  2187. containerId string
  2188. urlParams_ gensupport.URLParams
  2189. ctx_ context.Context
  2190. header_ http.Header
  2191. }
  2192. // Delete: Deletes a Container.
  2193. func (r *AccountsContainersService) Delete(accountId string, containerId string) *AccountsContainersDeleteCall {
  2194. c := &AccountsContainersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2195. c.accountId = accountId
  2196. c.containerId = containerId
  2197. return c
  2198. }
  2199. // Fields allows partial responses to be retrieved. See
  2200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2201. // for more information.
  2202. func (c *AccountsContainersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersDeleteCall {
  2203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2204. return c
  2205. }
  2206. // Context sets the context to be used in this call's Do method. Any
  2207. // pending HTTP request will be aborted if the provided context is
  2208. // canceled.
  2209. func (c *AccountsContainersDeleteCall) Context(ctx context.Context) *AccountsContainersDeleteCall {
  2210. c.ctx_ = ctx
  2211. return c
  2212. }
  2213. // Header returns an http.Header that can be modified by the caller to
  2214. // add HTTP headers to the request.
  2215. func (c *AccountsContainersDeleteCall) Header() http.Header {
  2216. if c.header_ == nil {
  2217. c.header_ = make(http.Header)
  2218. }
  2219. return c.header_
  2220. }
  2221. func (c *AccountsContainersDeleteCall) doRequest(alt string) (*http.Response, error) {
  2222. reqHeaders := make(http.Header)
  2223. for k, v := range c.header_ {
  2224. reqHeaders[k] = v
  2225. }
  2226. reqHeaders.Set("User-Agent", c.s.userAgent())
  2227. var body io.Reader = nil
  2228. c.urlParams_.Set("alt", alt)
  2229. c.urlParams_.Set("prettyPrint", "false")
  2230. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}")
  2231. urls += "?" + c.urlParams_.Encode()
  2232. req, err := http.NewRequest("DELETE", urls, body)
  2233. if err != nil {
  2234. return nil, err
  2235. }
  2236. req.Header = reqHeaders
  2237. googleapi.Expand(req.URL, map[string]string{
  2238. "accountId": c.accountId,
  2239. "containerId": c.containerId,
  2240. })
  2241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2242. }
  2243. // Do executes the "tagmanager.accounts.containers.delete" call.
  2244. func (c *AccountsContainersDeleteCall) Do(opts ...googleapi.CallOption) error {
  2245. gensupport.SetOptions(c.urlParams_, opts...)
  2246. res, err := c.doRequest("json")
  2247. if err != nil {
  2248. return err
  2249. }
  2250. defer googleapi.CloseBody(res)
  2251. if err := googleapi.CheckResponse(res); err != nil {
  2252. return err
  2253. }
  2254. return nil
  2255. // {
  2256. // "description": "Deletes a Container.",
  2257. // "httpMethod": "DELETE",
  2258. // "id": "tagmanager.accounts.containers.delete",
  2259. // "parameterOrder": [
  2260. // "accountId",
  2261. // "containerId"
  2262. // ],
  2263. // "parameters": {
  2264. // "accountId": {
  2265. // "description": "The GTM Account ID.",
  2266. // "location": "path",
  2267. // "required": true,
  2268. // "type": "string"
  2269. // },
  2270. // "containerId": {
  2271. // "description": "The GTM Container ID.",
  2272. // "location": "path",
  2273. // "required": true,
  2274. // "type": "string"
  2275. // }
  2276. // },
  2277. // "path": "accounts/{accountId}/containers/{containerId}",
  2278. // "scopes": [
  2279. // "https://www.googleapis.com/auth/tagmanager.delete.containers"
  2280. // ]
  2281. // }
  2282. }
  2283. // method id "tagmanager.accounts.containers.get":
  2284. type AccountsContainersGetCall struct {
  2285. s *Service
  2286. accountId string
  2287. containerId string
  2288. urlParams_ gensupport.URLParams
  2289. ifNoneMatch_ string
  2290. ctx_ context.Context
  2291. header_ http.Header
  2292. }
  2293. // Get: Gets a Container.
  2294. func (r *AccountsContainersService) Get(accountId string, containerId string) *AccountsContainersGetCall {
  2295. c := &AccountsContainersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2296. c.accountId = accountId
  2297. c.containerId = containerId
  2298. return c
  2299. }
  2300. // Fields allows partial responses to be retrieved. See
  2301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2302. // for more information.
  2303. func (c *AccountsContainersGetCall) Fields(s ...googleapi.Field) *AccountsContainersGetCall {
  2304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2305. return c
  2306. }
  2307. // IfNoneMatch sets the optional parameter which makes the operation
  2308. // fail if the object's ETag matches the given value. This is useful for
  2309. // getting updates only after the object has changed since the last
  2310. // request. Use googleapi.IsNotModified to check whether the response
  2311. // error from Do is the result of In-None-Match.
  2312. func (c *AccountsContainersGetCall) IfNoneMatch(entityTag string) *AccountsContainersGetCall {
  2313. c.ifNoneMatch_ = entityTag
  2314. return c
  2315. }
  2316. // Context sets the context to be used in this call's Do method. Any
  2317. // pending HTTP request will be aborted if the provided context is
  2318. // canceled.
  2319. func (c *AccountsContainersGetCall) Context(ctx context.Context) *AccountsContainersGetCall {
  2320. c.ctx_ = ctx
  2321. return c
  2322. }
  2323. // Header returns an http.Header that can be modified by the caller to
  2324. // add HTTP headers to the request.
  2325. func (c *AccountsContainersGetCall) Header() http.Header {
  2326. if c.header_ == nil {
  2327. c.header_ = make(http.Header)
  2328. }
  2329. return c.header_
  2330. }
  2331. func (c *AccountsContainersGetCall) doRequest(alt string) (*http.Response, error) {
  2332. reqHeaders := make(http.Header)
  2333. for k, v := range c.header_ {
  2334. reqHeaders[k] = v
  2335. }
  2336. reqHeaders.Set("User-Agent", c.s.userAgent())
  2337. if c.ifNoneMatch_ != "" {
  2338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2339. }
  2340. var body io.Reader = nil
  2341. c.urlParams_.Set("alt", alt)
  2342. c.urlParams_.Set("prettyPrint", "false")
  2343. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}")
  2344. urls += "?" + c.urlParams_.Encode()
  2345. req, err := http.NewRequest("GET", urls, body)
  2346. if err != nil {
  2347. return nil, err
  2348. }
  2349. req.Header = reqHeaders
  2350. googleapi.Expand(req.URL, map[string]string{
  2351. "accountId": c.accountId,
  2352. "containerId": c.containerId,
  2353. })
  2354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2355. }
  2356. // Do executes the "tagmanager.accounts.containers.get" call.
  2357. // Exactly one of *Container or error will be non-nil. Any non-2xx
  2358. // status code is an error. Response headers are in either
  2359. // *Container.ServerResponse.Header or (if a response was returned at
  2360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2361. // to check whether the returned error was because
  2362. // http.StatusNotModified was returned.
  2363. func (c *AccountsContainersGetCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  2364. gensupport.SetOptions(c.urlParams_, opts...)
  2365. res, err := c.doRequest("json")
  2366. if res != nil && res.StatusCode == http.StatusNotModified {
  2367. if res.Body != nil {
  2368. res.Body.Close()
  2369. }
  2370. return nil, &googleapi.Error{
  2371. Code: res.StatusCode,
  2372. Header: res.Header,
  2373. }
  2374. }
  2375. if err != nil {
  2376. return nil, err
  2377. }
  2378. defer googleapi.CloseBody(res)
  2379. if err := googleapi.CheckResponse(res); err != nil {
  2380. return nil, err
  2381. }
  2382. ret := &Container{
  2383. ServerResponse: googleapi.ServerResponse{
  2384. Header: res.Header,
  2385. HTTPStatusCode: res.StatusCode,
  2386. },
  2387. }
  2388. target := &ret
  2389. if err := gensupport.DecodeResponse(target, res); err != nil {
  2390. return nil, err
  2391. }
  2392. return ret, nil
  2393. // {
  2394. // "description": "Gets a Container.",
  2395. // "httpMethod": "GET",
  2396. // "id": "tagmanager.accounts.containers.get",
  2397. // "parameterOrder": [
  2398. // "accountId",
  2399. // "containerId"
  2400. // ],
  2401. // "parameters": {
  2402. // "accountId": {
  2403. // "description": "The GTM Account ID.",
  2404. // "location": "path",
  2405. // "required": true,
  2406. // "type": "string"
  2407. // },
  2408. // "containerId": {
  2409. // "description": "The GTM Container ID.",
  2410. // "location": "path",
  2411. // "required": true,
  2412. // "type": "string"
  2413. // }
  2414. // },
  2415. // "path": "accounts/{accountId}/containers/{containerId}",
  2416. // "response": {
  2417. // "$ref": "Container"
  2418. // },
  2419. // "scopes": [
  2420. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  2421. // "https://www.googleapis.com/auth/tagmanager.readonly"
  2422. // ]
  2423. // }
  2424. }
  2425. // method id "tagmanager.accounts.containers.list":
  2426. type AccountsContainersListCall struct {
  2427. s *Service
  2428. accountId string
  2429. urlParams_ gensupport.URLParams
  2430. ifNoneMatch_ string
  2431. ctx_ context.Context
  2432. header_ http.Header
  2433. }
  2434. // List: Lists all Containers that belongs to a GTM Account.
  2435. func (r *AccountsContainersService) List(accountId string) *AccountsContainersListCall {
  2436. c := &AccountsContainersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2437. c.accountId = accountId
  2438. return c
  2439. }
  2440. // Fields allows partial responses to be retrieved. See
  2441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2442. // for more information.
  2443. func (c *AccountsContainersListCall) Fields(s ...googleapi.Field) *AccountsContainersListCall {
  2444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2445. return c
  2446. }
  2447. // IfNoneMatch sets the optional parameter which makes the operation
  2448. // fail if the object's ETag matches the given value. This is useful for
  2449. // getting updates only after the object has changed since the last
  2450. // request. Use googleapi.IsNotModified to check whether the response
  2451. // error from Do is the result of In-None-Match.
  2452. func (c *AccountsContainersListCall) IfNoneMatch(entityTag string) *AccountsContainersListCall {
  2453. c.ifNoneMatch_ = entityTag
  2454. return c
  2455. }
  2456. // Context sets the context to be used in this call's Do method. Any
  2457. // pending HTTP request will be aborted if the provided context is
  2458. // canceled.
  2459. func (c *AccountsContainersListCall) Context(ctx context.Context) *AccountsContainersListCall {
  2460. c.ctx_ = ctx
  2461. return c
  2462. }
  2463. // Header returns an http.Header that can be modified by the caller to
  2464. // add HTTP headers to the request.
  2465. func (c *AccountsContainersListCall) Header() http.Header {
  2466. if c.header_ == nil {
  2467. c.header_ = make(http.Header)
  2468. }
  2469. return c.header_
  2470. }
  2471. func (c *AccountsContainersListCall) doRequest(alt string) (*http.Response, error) {
  2472. reqHeaders := make(http.Header)
  2473. for k, v := range c.header_ {
  2474. reqHeaders[k] = v
  2475. }
  2476. reqHeaders.Set("User-Agent", c.s.userAgent())
  2477. if c.ifNoneMatch_ != "" {
  2478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2479. }
  2480. var body io.Reader = nil
  2481. c.urlParams_.Set("alt", alt)
  2482. c.urlParams_.Set("prettyPrint", "false")
  2483. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers")
  2484. urls += "?" + c.urlParams_.Encode()
  2485. req, err := http.NewRequest("GET", urls, body)
  2486. if err != nil {
  2487. return nil, err
  2488. }
  2489. req.Header = reqHeaders
  2490. googleapi.Expand(req.URL, map[string]string{
  2491. "accountId": c.accountId,
  2492. })
  2493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2494. }
  2495. // Do executes the "tagmanager.accounts.containers.list" call.
  2496. // Exactly one of *ListContainersResponse or error will be non-nil. Any
  2497. // non-2xx status code is an error. Response headers are in either
  2498. // *ListContainersResponse.ServerResponse.Header or (if a response was
  2499. // returned at all) in error.(*googleapi.Error).Header. Use
  2500. // googleapi.IsNotModified to check whether the returned error was
  2501. // because http.StatusNotModified was returned.
  2502. func (c *AccountsContainersListCall) Do(opts ...googleapi.CallOption) (*ListContainersResponse, error) {
  2503. gensupport.SetOptions(c.urlParams_, opts...)
  2504. res, err := c.doRequest("json")
  2505. if res != nil && res.StatusCode == http.StatusNotModified {
  2506. if res.Body != nil {
  2507. res.Body.Close()
  2508. }
  2509. return nil, &googleapi.Error{
  2510. Code: res.StatusCode,
  2511. Header: res.Header,
  2512. }
  2513. }
  2514. if err != nil {
  2515. return nil, err
  2516. }
  2517. defer googleapi.CloseBody(res)
  2518. if err := googleapi.CheckResponse(res); err != nil {
  2519. return nil, err
  2520. }
  2521. ret := &ListContainersResponse{
  2522. ServerResponse: googleapi.ServerResponse{
  2523. Header: res.Header,
  2524. HTTPStatusCode: res.StatusCode,
  2525. },
  2526. }
  2527. target := &ret
  2528. if err := gensupport.DecodeResponse(target, res); err != nil {
  2529. return nil, err
  2530. }
  2531. return ret, nil
  2532. // {
  2533. // "description": "Lists all Containers that belongs to a GTM Account.",
  2534. // "httpMethod": "GET",
  2535. // "id": "tagmanager.accounts.containers.list",
  2536. // "parameterOrder": [
  2537. // "accountId"
  2538. // ],
  2539. // "parameters": {
  2540. // "accountId": {
  2541. // "description": "The GTM Account ID.",
  2542. // "location": "path",
  2543. // "required": true,
  2544. // "type": "string"
  2545. // }
  2546. // },
  2547. // "path": "accounts/{accountId}/containers",
  2548. // "response": {
  2549. // "$ref": "ListContainersResponse"
  2550. // },
  2551. // "scopes": [
  2552. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  2553. // "https://www.googleapis.com/auth/tagmanager.readonly"
  2554. // ]
  2555. // }
  2556. }
  2557. // method id "tagmanager.accounts.containers.update":
  2558. type AccountsContainersUpdateCall struct {
  2559. s *Service
  2560. accountId string
  2561. containerId string
  2562. container *Container
  2563. urlParams_ gensupport.URLParams
  2564. ctx_ context.Context
  2565. header_ http.Header
  2566. }
  2567. // Update: Updates a Container.
  2568. func (r *AccountsContainersService) Update(accountId string, containerId string, container *Container) *AccountsContainersUpdateCall {
  2569. c := &AccountsContainersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2570. c.accountId = accountId
  2571. c.containerId = containerId
  2572. c.container = container
  2573. return c
  2574. }
  2575. // Fingerprint sets the optional parameter "fingerprint": When provided,
  2576. // this fingerprint must match the fingerprint of the container in
  2577. // storage.
  2578. func (c *AccountsContainersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersUpdateCall {
  2579. c.urlParams_.Set("fingerprint", fingerprint)
  2580. return c
  2581. }
  2582. // Fields allows partial responses to be retrieved. See
  2583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2584. // for more information.
  2585. func (c *AccountsContainersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersUpdateCall {
  2586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2587. return c
  2588. }
  2589. // Context sets the context to be used in this call's Do method. Any
  2590. // pending HTTP request will be aborted if the provided context is
  2591. // canceled.
  2592. func (c *AccountsContainersUpdateCall) Context(ctx context.Context) *AccountsContainersUpdateCall {
  2593. c.ctx_ = ctx
  2594. return c
  2595. }
  2596. // Header returns an http.Header that can be modified by the caller to
  2597. // add HTTP headers to the request.
  2598. func (c *AccountsContainersUpdateCall) Header() http.Header {
  2599. if c.header_ == nil {
  2600. c.header_ = make(http.Header)
  2601. }
  2602. return c.header_
  2603. }
  2604. func (c *AccountsContainersUpdateCall) doRequest(alt string) (*http.Response, error) {
  2605. reqHeaders := make(http.Header)
  2606. for k, v := range c.header_ {
  2607. reqHeaders[k] = v
  2608. }
  2609. reqHeaders.Set("User-Agent", c.s.userAgent())
  2610. var body io.Reader = nil
  2611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.container)
  2612. if err != nil {
  2613. return nil, err
  2614. }
  2615. reqHeaders.Set("Content-Type", "application/json")
  2616. c.urlParams_.Set("alt", alt)
  2617. c.urlParams_.Set("prettyPrint", "false")
  2618. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}")
  2619. urls += "?" + c.urlParams_.Encode()
  2620. req, err := http.NewRequest("PUT", urls, body)
  2621. if err != nil {
  2622. return nil, err
  2623. }
  2624. req.Header = reqHeaders
  2625. googleapi.Expand(req.URL, map[string]string{
  2626. "accountId": c.accountId,
  2627. "containerId": c.containerId,
  2628. })
  2629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2630. }
  2631. // Do executes the "tagmanager.accounts.containers.update" call.
  2632. // Exactly one of *Container or error will be non-nil. Any non-2xx
  2633. // status code is an error. Response headers are in either
  2634. // *Container.ServerResponse.Header or (if a response was returned at
  2635. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2636. // to check whether the returned error was because
  2637. // http.StatusNotModified was returned.
  2638. func (c *AccountsContainersUpdateCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  2639. gensupport.SetOptions(c.urlParams_, opts...)
  2640. res, err := c.doRequest("json")
  2641. if res != nil && res.StatusCode == http.StatusNotModified {
  2642. if res.Body != nil {
  2643. res.Body.Close()
  2644. }
  2645. return nil, &googleapi.Error{
  2646. Code: res.StatusCode,
  2647. Header: res.Header,
  2648. }
  2649. }
  2650. if err != nil {
  2651. return nil, err
  2652. }
  2653. defer googleapi.CloseBody(res)
  2654. if err := googleapi.CheckResponse(res); err != nil {
  2655. return nil, err
  2656. }
  2657. ret := &Container{
  2658. ServerResponse: googleapi.ServerResponse{
  2659. Header: res.Header,
  2660. HTTPStatusCode: res.StatusCode,
  2661. },
  2662. }
  2663. target := &ret
  2664. if err := gensupport.DecodeResponse(target, res); err != nil {
  2665. return nil, err
  2666. }
  2667. return ret, nil
  2668. // {
  2669. // "description": "Updates a Container.",
  2670. // "httpMethod": "PUT",
  2671. // "id": "tagmanager.accounts.containers.update",
  2672. // "parameterOrder": [
  2673. // "accountId",
  2674. // "containerId"
  2675. // ],
  2676. // "parameters": {
  2677. // "accountId": {
  2678. // "description": "The GTM Account ID.",
  2679. // "location": "path",
  2680. // "required": true,
  2681. // "type": "string"
  2682. // },
  2683. // "containerId": {
  2684. // "description": "The GTM Container ID.",
  2685. // "location": "path",
  2686. // "required": true,
  2687. // "type": "string"
  2688. // },
  2689. // "fingerprint": {
  2690. // "description": "When provided, this fingerprint must match the fingerprint of the container in storage.",
  2691. // "location": "query",
  2692. // "type": "string"
  2693. // }
  2694. // },
  2695. // "path": "accounts/{accountId}/containers/{containerId}",
  2696. // "request": {
  2697. // "$ref": "Container"
  2698. // },
  2699. // "response": {
  2700. // "$ref": "Container"
  2701. // },
  2702. // "scopes": [
  2703. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  2704. // ]
  2705. // }
  2706. }
  2707. // method id "tagmanager.accounts.containers.environments.create":
  2708. type AccountsContainersEnvironmentsCreateCall struct {
  2709. s *Service
  2710. accountId string
  2711. containerId string
  2712. environment *Environment
  2713. urlParams_ gensupport.URLParams
  2714. ctx_ context.Context
  2715. header_ http.Header
  2716. }
  2717. // Create: Creates a GTM Environment.
  2718. func (r *AccountsContainersEnvironmentsService) Create(accountId string, containerId string, environment *Environment) *AccountsContainersEnvironmentsCreateCall {
  2719. c := &AccountsContainersEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2720. c.accountId = accountId
  2721. c.containerId = containerId
  2722. c.environment = environment
  2723. return c
  2724. }
  2725. // Fields allows partial responses to be retrieved. See
  2726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2727. // for more information.
  2728. func (c *AccountsContainersEnvironmentsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsCreateCall {
  2729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2730. return c
  2731. }
  2732. // Context sets the context to be used in this call's Do method. Any
  2733. // pending HTTP request will be aborted if the provided context is
  2734. // canceled.
  2735. func (c *AccountsContainersEnvironmentsCreateCall) Context(ctx context.Context) *AccountsContainersEnvironmentsCreateCall {
  2736. c.ctx_ = ctx
  2737. return c
  2738. }
  2739. // Header returns an http.Header that can be modified by the caller to
  2740. // add HTTP headers to the request.
  2741. func (c *AccountsContainersEnvironmentsCreateCall) Header() http.Header {
  2742. if c.header_ == nil {
  2743. c.header_ = make(http.Header)
  2744. }
  2745. return c.header_
  2746. }
  2747. func (c *AccountsContainersEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) {
  2748. reqHeaders := make(http.Header)
  2749. for k, v := range c.header_ {
  2750. reqHeaders[k] = v
  2751. }
  2752. reqHeaders.Set("User-Agent", c.s.userAgent())
  2753. var body io.Reader = nil
  2754. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  2755. if err != nil {
  2756. return nil, err
  2757. }
  2758. reqHeaders.Set("Content-Type", "application/json")
  2759. c.urlParams_.Set("alt", alt)
  2760. c.urlParams_.Set("prettyPrint", "false")
  2761. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/environments")
  2762. urls += "?" + c.urlParams_.Encode()
  2763. req, err := http.NewRequest("POST", urls, body)
  2764. if err != nil {
  2765. return nil, err
  2766. }
  2767. req.Header = reqHeaders
  2768. googleapi.Expand(req.URL, map[string]string{
  2769. "accountId": c.accountId,
  2770. "containerId": c.containerId,
  2771. })
  2772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2773. }
  2774. // Do executes the "tagmanager.accounts.containers.environments.create" call.
  2775. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  2776. // status code is an error. Response headers are in either
  2777. // *Environment.ServerResponse.Header or (if a response was returned at
  2778. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2779. // to check whether the returned error was because
  2780. // http.StatusNotModified was returned.
  2781. func (c *AccountsContainersEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  2782. gensupport.SetOptions(c.urlParams_, opts...)
  2783. res, err := c.doRequest("json")
  2784. if res != nil && res.StatusCode == http.StatusNotModified {
  2785. if res.Body != nil {
  2786. res.Body.Close()
  2787. }
  2788. return nil, &googleapi.Error{
  2789. Code: res.StatusCode,
  2790. Header: res.Header,
  2791. }
  2792. }
  2793. if err != nil {
  2794. return nil, err
  2795. }
  2796. defer googleapi.CloseBody(res)
  2797. if err := googleapi.CheckResponse(res); err != nil {
  2798. return nil, err
  2799. }
  2800. ret := &Environment{
  2801. ServerResponse: googleapi.ServerResponse{
  2802. Header: res.Header,
  2803. HTTPStatusCode: res.StatusCode,
  2804. },
  2805. }
  2806. target := &ret
  2807. if err := gensupport.DecodeResponse(target, res); err != nil {
  2808. return nil, err
  2809. }
  2810. return ret, nil
  2811. // {
  2812. // "description": "Creates a GTM Environment.",
  2813. // "httpMethod": "POST",
  2814. // "id": "tagmanager.accounts.containers.environments.create",
  2815. // "parameterOrder": [
  2816. // "accountId",
  2817. // "containerId"
  2818. // ],
  2819. // "parameters": {
  2820. // "accountId": {
  2821. // "description": "The GTM Account ID.",
  2822. // "location": "path",
  2823. // "required": true,
  2824. // "type": "string"
  2825. // },
  2826. // "containerId": {
  2827. // "description": "The GTM Container ID.",
  2828. // "location": "path",
  2829. // "required": true,
  2830. // "type": "string"
  2831. // }
  2832. // },
  2833. // "path": "accounts/{accountId}/containers/{containerId}/environments",
  2834. // "request": {
  2835. // "$ref": "Environment"
  2836. // },
  2837. // "response": {
  2838. // "$ref": "Environment"
  2839. // },
  2840. // "scopes": [
  2841. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  2842. // ]
  2843. // }
  2844. }
  2845. // method id "tagmanager.accounts.containers.environments.delete":
  2846. type AccountsContainersEnvironmentsDeleteCall struct {
  2847. s *Service
  2848. accountId string
  2849. containerId string
  2850. environmentId string
  2851. urlParams_ gensupport.URLParams
  2852. ctx_ context.Context
  2853. header_ http.Header
  2854. }
  2855. // Delete: Deletes a GTM Environment.
  2856. func (r *AccountsContainersEnvironmentsService) Delete(accountId string, containerId string, environmentId string) *AccountsContainersEnvironmentsDeleteCall {
  2857. c := &AccountsContainersEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2858. c.accountId = accountId
  2859. c.containerId = containerId
  2860. c.environmentId = environmentId
  2861. return c
  2862. }
  2863. // Fields allows partial responses to be retrieved. See
  2864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2865. // for more information.
  2866. func (c *AccountsContainersEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsDeleteCall {
  2867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2868. return c
  2869. }
  2870. // Context sets the context to be used in this call's Do method. Any
  2871. // pending HTTP request will be aborted if the provided context is
  2872. // canceled.
  2873. func (c *AccountsContainersEnvironmentsDeleteCall) Context(ctx context.Context) *AccountsContainersEnvironmentsDeleteCall {
  2874. c.ctx_ = ctx
  2875. return c
  2876. }
  2877. // Header returns an http.Header that can be modified by the caller to
  2878. // add HTTP headers to the request.
  2879. func (c *AccountsContainersEnvironmentsDeleteCall) Header() http.Header {
  2880. if c.header_ == nil {
  2881. c.header_ = make(http.Header)
  2882. }
  2883. return c.header_
  2884. }
  2885. func (c *AccountsContainersEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2886. reqHeaders := make(http.Header)
  2887. for k, v := range c.header_ {
  2888. reqHeaders[k] = v
  2889. }
  2890. reqHeaders.Set("User-Agent", c.s.userAgent())
  2891. var body io.Reader = nil
  2892. c.urlParams_.Set("alt", alt)
  2893. c.urlParams_.Set("prettyPrint", "false")
  2894. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/environments/{environmentId}")
  2895. urls += "?" + c.urlParams_.Encode()
  2896. req, err := http.NewRequest("DELETE", urls, body)
  2897. if err != nil {
  2898. return nil, err
  2899. }
  2900. req.Header = reqHeaders
  2901. googleapi.Expand(req.URL, map[string]string{
  2902. "accountId": c.accountId,
  2903. "containerId": c.containerId,
  2904. "environmentId": c.environmentId,
  2905. })
  2906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2907. }
  2908. // Do executes the "tagmanager.accounts.containers.environments.delete" call.
  2909. func (c *AccountsContainersEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2910. gensupport.SetOptions(c.urlParams_, opts...)
  2911. res, err := c.doRequest("json")
  2912. if err != nil {
  2913. return err
  2914. }
  2915. defer googleapi.CloseBody(res)
  2916. if err := googleapi.CheckResponse(res); err != nil {
  2917. return err
  2918. }
  2919. return nil
  2920. // {
  2921. // "description": "Deletes a GTM Environment.",
  2922. // "httpMethod": "DELETE",
  2923. // "id": "tagmanager.accounts.containers.environments.delete",
  2924. // "parameterOrder": [
  2925. // "accountId",
  2926. // "containerId",
  2927. // "environmentId"
  2928. // ],
  2929. // "parameters": {
  2930. // "accountId": {
  2931. // "description": "The GTM Account ID.",
  2932. // "location": "path",
  2933. // "required": true,
  2934. // "type": "string"
  2935. // },
  2936. // "containerId": {
  2937. // "description": "The GTM Container ID.",
  2938. // "location": "path",
  2939. // "required": true,
  2940. // "type": "string"
  2941. // },
  2942. // "environmentId": {
  2943. // "description": "The GTM Environment ID.",
  2944. // "location": "path",
  2945. // "required": true,
  2946. // "type": "string"
  2947. // }
  2948. // },
  2949. // "path": "accounts/{accountId}/containers/{containerId}/environments/{environmentId}",
  2950. // "scopes": [
  2951. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  2952. // ]
  2953. // }
  2954. }
  2955. // method id "tagmanager.accounts.containers.environments.get":
  2956. type AccountsContainersEnvironmentsGetCall struct {
  2957. s *Service
  2958. accountId string
  2959. containerId string
  2960. environmentId string
  2961. urlParams_ gensupport.URLParams
  2962. ifNoneMatch_ string
  2963. ctx_ context.Context
  2964. header_ http.Header
  2965. }
  2966. // Get: Gets a GTM Environment.
  2967. func (r *AccountsContainersEnvironmentsService) Get(accountId string, containerId string, environmentId string) *AccountsContainersEnvironmentsGetCall {
  2968. c := &AccountsContainersEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2969. c.accountId = accountId
  2970. c.containerId = containerId
  2971. c.environmentId = environmentId
  2972. return c
  2973. }
  2974. // Fields allows partial responses to be retrieved. See
  2975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2976. // for more information.
  2977. func (c *AccountsContainersEnvironmentsGetCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsGetCall {
  2978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2979. return c
  2980. }
  2981. // IfNoneMatch sets the optional parameter which makes the operation
  2982. // fail if the object's ETag matches the given value. This is useful for
  2983. // getting updates only after the object has changed since the last
  2984. // request. Use googleapi.IsNotModified to check whether the response
  2985. // error from Do is the result of In-None-Match.
  2986. func (c *AccountsContainersEnvironmentsGetCall) IfNoneMatch(entityTag string) *AccountsContainersEnvironmentsGetCall {
  2987. c.ifNoneMatch_ = entityTag
  2988. return c
  2989. }
  2990. // Context sets the context to be used in this call's Do method. Any
  2991. // pending HTTP request will be aborted if the provided context is
  2992. // canceled.
  2993. func (c *AccountsContainersEnvironmentsGetCall) Context(ctx context.Context) *AccountsContainersEnvironmentsGetCall {
  2994. c.ctx_ = ctx
  2995. return c
  2996. }
  2997. // Header returns an http.Header that can be modified by the caller to
  2998. // add HTTP headers to the request.
  2999. func (c *AccountsContainersEnvironmentsGetCall) Header() http.Header {
  3000. if c.header_ == nil {
  3001. c.header_ = make(http.Header)
  3002. }
  3003. return c.header_
  3004. }
  3005. func (c *AccountsContainersEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  3006. reqHeaders := make(http.Header)
  3007. for k, v := range c.header_ {
  3008. reqHeaders[k] = v
  3009. }
  3010. reqHeaders.Set("User-Agent", c.s.userAgent())
  3011. if c.ifNoneMatch_ != "" {
  3012. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3013. }
  3014. var body io.Reader = nil
  3015. c.urlParams_.Set("alt", alt)
  3016. c.urlParams_.Set("prettyPrint", "false")
  3017. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/environments/{environmentId}")
  3018. urls += "?" + c.urlParams_.Encode()
  3019. req, err := http.NewRequest("GET", urls, body)
  3020. if err != nil {
  3021. return nil, err
  3022. }
  3023. req.Header = reqHeaders
  3024. googleapi.Expand(req.URL, map[string]string{
  3025. "accountId": c.accountId,
  3026. "containerId": c.containerId,
  3027. "environmentId": c.environmentId,
  3028. })
  3029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3030. }
  3031. // Do executes the "tagmanager.accounts.containers.environments.get" call.
  3032. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  3033. // status code is an error. Response headers are in either
  3034. // *Environment.ServerResponse.Header or (if a response was returned at
  3035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3036. // to check whether the returned error was because
  3037. // http.StatusNotModified was returned.
  3038. func (c *AccountsContainersEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  3039. gensupport.SetOptions(c.urlParams_, opts...)
  3040. res, err := c.doRequest("json")
  3041. if res != nil && res.StatusCode == http.StatusNotModified {
  3042. if res.Body != nil {
  3043. res.Body.Close()
  3044. }
  3045. return nil, &googleapi.Error{
  3046. Code: res.StatusCode,
  3047. Header: res.Header,
  3048. }
  3049. }
  3050. if err != nil {
  3051. return nil, err
  3052. }
  3053. defer googleapi.CloseBody(res)
  3054. if err := googleapi.CheckResponse(res); err != nil {
  3055. return nil, err
  3056. }
  3057. ret := &Environment{
  3058. ServerResponse: googleapi.ServerResponse{
  3059. Header: res.Header,
  3060. HTTPStatusCode: res.StatusCode,
  3061. },
  3062. }
  3063. target := &ret
  3064. if err := gensupport.DecodeResponse(target, res); err != nil {
  3065. return nil, err
  3066. }
  3067. return ret, nil
  3068. // {
  3069. // "description": "Gets a GTM Environment.",
  3070. // "httpMethod": "GET",
  3071. // "id": "tagmanager.accounts.containers.environments.get",
  3072. // "parameterOrder": [
  3073. // "accountId",
  3074. // "containerId",
  3075. // "environmentId"
  3076. // ],
  3077. // "parameters": {
  3078. // "accountId": {
  3079. // "description": "The GTM Account ID.",
  3080. // "location": "path",
  3081. // "required": true,
  3082. // "type": "string"
  3083. // },
  3084. // "containerId": {
  3085. // "description": "The GTM Container ID.",
  3086. // "location": "path",
  3087. // "required": true,
  3088. // "type": "string"
  3089. // },
  3090. // "environmentId": {
  3091. // "description": "The GTM Environment ID.",
  3092. // "location": "path",
  3093. // "required": true,
  3094. // "type": "string"
  3095. // }
  3096. // },
  3097. // "path": "accounts/{accountId}/containers/{containerId}/environments/{environmentId}",
  3098. // "response": {
  3099. // "$ref": "Environment"
  3100. // },
  3101. // "scopes": [
  3102. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3103. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3104. // ]
  3105. // }
  3106. }
  3107. // method id "tagmanager.accounts.containers.environments.list":
  3108. type AccountsContainersEnvironmentsListCall struct {
  3109. s *Service
  3110. accountId string
  3111. containerId string
  3112. urlParams_ gensupport.URLParams
  3113. ifNoneMatch_ string
  3114. ctx_ context.Context
  3115. header_ http.Header
  3116. }
  3117. // List: Lists all GTM Environments of a GTM Container.
  3118. func (r *AccountsContainersEnvironmentsService) List(accountId string, containerId string) *AccountsContainersEnvironmentsListCall {
  3119. c := &AccountsContainersEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3120. c.accountId = accountId
  3121. c.containerId = containerId
  3122. return c
  3123. }
  3124. // Fields allows partial responses to be retrieved. See
  3125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3126. // for more information.
  3127. func (c *AccountsContainersEnvironmentsListCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsListCall {
  3128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3129. return c
  3130. }
  3131. // IfNoneMatch sets the optional parameter which makes the operation
  3132. // fail if the object's ETag matches the given value. This is useful for
  3133. // getting updates only after the object has changed since the last
  3134. // request. Use googleapi.IsNotModified to check whether the response
  3135. // error from Do is the result of In-None-Match.
  3136. func (c *AccountsContainersEnvironmentsListCall) IfNoneMatch(entityTag string) *AccountsContainersEnvironmentsListCall {
  3137. c.ifNoneMatch_ = entityTag
  3138. return c
  3139. }
  3140. // Context sets the context to be used in this call's Do method. Any
  3141. // pending HTTP request will be aborted if the provided context is
  3142. // canceled.
  3143. func (c *AccountsContainersEnvironmentsListCall) Context(ctx context.Context) *AccountsContainersEnvironmentsListCall {
  3144. c.ctx_ = ctx
  3145. return c
  3146. }
  3147. // Header returns an http.Header that can be modified by the caller to
  3148. // add HTTP headers to the request.
  3149. func (c *AccountsContainersEnvironmentsListCall) Header() http.Header {
  3150. if c.header_ == nil {
  3151. c.header_ = make(http.Header)
  3152. }
  3153. return c.header_
  3154. }
  3155. func (c *AccountsContainersEnvironmentsListCall) doRequest(alt string) (*http.Response, error) {
  3156. reqHeaders := make(http.Header)
  3157. for k, v := range c.header_ {
  3158. reqHeaders[k] = v
  3159. }
  3160. reqHeaders.Set("User-Agent", c.s.userAgent())
  3161. if c.ifNoneMatch_ != "" {
  3162. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3163. }
  3164. var body io.Reader = nil
  3165. c.urlParams_.Set("alt", alt)
  3166. c.urlParams_.Set("prettyPrint", "false")
  3167. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/environments")
  3168. urls += "?" + c.urlParams_.Encode()
  3169. req, err := http.NewRequest("GET", urls, body)
  3170. if err != nil {
  3171. return nil, err
  3172. }
  3173. req.Header = reqHeaders
  3174. googleapi.Expand(req.URL, map[string]string{
  3175. "accountId": c.accountId,
  3176. "containerId": c.containerId,
  3177. })
  3178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3179. }
  3180. // Do executes the "tagmanager.accounts.containers.environments.list" call.
  3181. // Exactly one of *ListEnvironmentsResponse or error will be non-nil.
  3182. // Any non-2xx status code is an error. Response headers are in either
  3183. // *ListEnvironmentsResponse.ServerResponse.Header or (if a response was
  3184. // returned at all) in error.(*googleapi.Error).Header. Use
  3185. // googleapi.IsNotModified to check whether the returned error was
  3186. // because http.StatusNotModified was returned.
  3187. func (c *AccountsContainersEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) {
  3188. gensupport.SetOptions(c.urlParams_, opts...)
  3189. res, err := c.doRequest("json")
  3190. if res != nil && res.StatusCode == http.StatusNotModified {
  3191. if res.Body != nil {
  3192. res.Body.Close()
  3193. }
  3194. return nil, &googleapi.Error{
  3195. Code: res.StatusCode,
  3196. Header: res.Header,
  3197. }
  3198. }
  3199. if err != nil {
  3200. return nil, err
  3201. }
  3202. defer googleapi.CloseBody(res)
  3203. if err := googleapi.CheckResponse(res); err != nil {
  3204. return nil, err
  3205. }
  3206. ret := &ListEnvironmentsResponse{
  3207. ServerResponse: googleapi.ServerResponse{
  3208. Header: res.Header,
  3209. HTTPStatusCode: res.StatusCode,
  3210. },
  3211. }
  3212. target := &ret
  3213. if err := gensupport.DecodeResponse(target, res); err != nil {
  3214. return nil, err
  3215. }
  3216. return ret, nil
  3217. // {
  3218. // "description": "Lists all GTM Environments of a GTM Container.",
  3219. // "httpMethod": "GET",
  3220. // "id": "tagmanager.accounts.containers.environments.list",
  3221. // "parameterOrder": [
  3222. // "accountId",
  3223. // "containerId"
  3224. // ],
  3225. // "parameters": {
  3226. // "accountId": {
  3227. // "description": "The GTM Account ID.",
  3228. // "location": "path",
  3229. // "required": true,
  3230. // "type": "string"
  3231. // },
  3232. // "containerId": {
  3233. // "description": "The GTM Container ID.",
  3234. // "location": "path",
  3235. // "required": true,
  3236. // "type": "string"
  3237. // }
  3238. // },
  3239. // "path": "accounts/{accountId}/containers/{containerId}/environments",
  3240. // "response": {
  3241. // "$ref": "ListEnvironmentsResponse"
  3242. // },
  3243. // "scopes": [
  3244. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3245. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3246. // ]
  3247. // }
  3248. }
  3249. // method id "tagmanager.accounts.containers.environments.update":
  3250. type AccountsContainersEnvironmentsUpdateCall struct {
  3251. s *Service
  3252. accountId string
  3253. containerId string
  3254. environmentId string
  3255. environment *Environment
  3256. urlParams_ gensupport.URLParams
  3257. ctx_ context.Context
  3258. header_ http.Header
  3259. }
  3260. // Update: Updates a GTM Environment.
  3261. func (r *AccountsContainersEnvironmentsService) Update(accountId string, containerId string, environmentId string, environment *Environment) *AccountsContainersEnvironmentsUpdateCall {
  3262. c := &AccountsContainersEnvironmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3263. c.accountId = accountId
  3264. c.containerId = containerId
  3265. c.environmentId = environmentId
  3266. c.environment = environment
  3267. return c
  3268. }
  3269. // Fingerprint sets the optional parameter "fingerprint": When provided,
  3270. // this fingerprint must match the fingerprint of the environment in
  3271. // storage.
  3272. func (c *AccountsContainersEnvironmentsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersEnvironmentsUpdateCall {
  3273. c.urlParams_.Set("fingerprint", fingerprint)
  3274. return c
  3275. }
  3276. // Fields allows partial responses to be retrieved. See
  3277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3278. // for more information.
  3279. func (c *AccountsContainersEnvironmentsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsUpdateCall {
  3280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3281. return c
  3282. }
  3283. // Context sets the context to be used in this call's Do method. Any
  3284. // pending HTTP request will be aborted if the provided context is
  3285. // canceled.
  3286. func (c *AccountsContainersEnvironmentsUpdateCall) Context(ctx context.Context) *AccountsContainersEnvironmentsUpdateCall {
  3287. c.ctx_ = ctx
  3288. return c
  3289. }
  3290. // Header returns an http.Header that can be modified by the caller to
  3291. // add HTTP headers to the request.
  3292. func (c *AccountsContainersEnvironmentsUpdateCall) Header() http.Header {
  3293. if c.header_ == nil {
  3294. c.header_ = make(http.Header)
  3295. }
  3296. return c.header_
  3297. }
  3298. func (c *AccountsContainersEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3299. reqHeaders := make(http.Header)
  3300. for k, v := range c.header_ {
  3301. reqHeaders[k] = v
  3302. }
  3303. reqHeaders.Set("User-Agent", c.s.userAgent())
  3304. var body io.Reader = nil
  3305. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  3306. if err != nil {
  3307. return nil, err
  3308. }
  3309. reqHeaders.Set("Content-Type", "application/json")
  3310. c.urlParams_.Set("alt", alt)
  3311. c.urlParams_.Set("prettyPrint", "false")
  3312. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/environments/{environmentId}")
  3313. urls += "?" + c.urlParams_.Encode()
  3314. req, err := http.NewRequest("PUT", urls, body)
  3315. if err != nil {
  3316. return nil, err
  3317. }
  3318. req.Header = reqHeaders
  3319. googleapi.Expand(req.URL, map[string]string{
  3320. "accountId": c.accountId,
  3321. "containerId": c.containerId,
  3322. "environmentId": c.environmentId,
  3323. })
  3324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3325. }
  3326. // Do executes the "tagmanager.accounts.containers.environments.update" call.
  3327. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  3328. // status code is an error. Response headers are in either
  3329. // *Environment.ServerResponse.Header or (if a response was returned at
  3330. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3331. // to check whether the returned error was because
  3332. // http.StatusNotModified was returned.
  3333. func (c *AccountsContainersEnvironmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  3334. gensupport.SetOptions(c.urlParams_, opts...)
  3335. res, err := c.doRequest("json")
  3336. if res != nil && res.StatusCode == http.StatusNotModified {
  3337. if res.Body != nil {
  3338. res.Body.Close()
  3339. }
  3340. return nil, &googleapi.Error{
  3341. Code: res.StatusCode,
  3342. Header: res.Header,
  3343. }
  3344. }
  3345. if err != nil {
  3346. return nil, err
  3347. }
  3348. defer googleapi.CloseBody(res)
  3349. if err := googleapi.CheckResponse(res); err != nil {
  3350. return nil, err
  3351. }
  3352. ret := &Environment{
  3353. ServerResponse: googleapi.ServerResponse{
  3354. Header: res.Header,
  3355. HTTPStatusCode: res.StatusCode,
  3356. },
  3357. }
  3358. target := &ret
  3359. if err := gensupport.DecodeResponse(target, res); err != nil {
  3360. return nil, err
  3361. }
  3362. return ret, nil
  3363. // {
  3364. // "description": "Updates a GTM Environment.",
  3365. // "httpMethod": "PUT",
  3366. // "id": "tagmanager.accounts.containers.environments.update",
  3367. // "parameterOrder": [
  3368. // "accountId",
  3369. // "containerId",
  3370. // "environmentId"
  3371. // ],
  3372. // "parameters": {
  3373. // "accountId": {
  3374. // "description": "The GTM Account ID.",
  3375. // "location": "path",
  3376. // "required": true,
  3377. // "type": "string"
  3378. // },
  3379. // "containerId": {
  3380. // "description": "The GTM Container ID.",
  3381. // "location": "path",
  3382. // "required": true,
  3383. // "type": "string"
  3384. // },
  3385. // "environmentId": {
  3386. // "description": "The GTM Environment ID.",
  3387. // "location": "path",
  3388. // "required": true,
  3389. // "type": "string"
  3390. // },
  3391. // "fingerprint": {
  3392. // "description": "When provided, this fingerprint must match the fingerprint of the environment in storage.",
  3393. // "location": "query",
  3394. // "type": "string"
  3395. // }
  3396. // },
  3397. // "path": "accounts/{accountId}/containers/{containerId}/environments/{environmentId}",
  3398. // "request": {
  3399. // "$ref": "Environment"
  3400. // },
  3401. // "response": {
  3402. // "$ref": "Environment"
  3403. // },
  3404. // "scopes": [
  3405. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3406. // ]
  3407. // }
  3408. }
  3409. // method id "tagmanager.accounts.containers.folders.create":
  3410. type AccountsContainersFoldersCreateCall struct {
  3411. s *Service
  3412. accountId string
  3413. containerId string
  3414. folder *Folder
  3415. urlParams_ gensupport.URLParams
  3416. ctx_ context.Context
  3417. header_ http.Header
  3418. }
  3419. // Create: Creates a GTM Folder.
  3420. func (r *AccountsContainersFoldersService) Create(accountId string, containerId string, folder *Folder) *AccountsContainersFoldersCreateCall {
  3421. c := &AccountsContainersFoldersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3422. c.accountId = accountId
  3423. c.containerId = containerId
  3424. c.folder = folder
  3425. return c
  3426. }
  3427. // Fields allows partial responses to be retrieved. See
  3428. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3429. // for more information.
  3430. func (c *AccountsContainersFoldersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersCreateCall {
  3431. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3432. return c
  3433. }
  3434. // Context sets the context to be used in this call's Do method. Any
  3435. // pending HTTP request will be aborted if the provided context is
  3436. // canceled.
  3437. func (c *AccountsContainersFoldersCreateCall) Context(ctx context.Context) *AccountsContainersFoldersCreateCall {
  3438. c.ctx_ = ctx
  3439. return c
  3440. }
  3441. // Header returns an http.Header that can be modified by the caller to
  3442. // add HTTP headers to the request.
  3443. func (c *AccountsContainersFoldersCreateCall) Header() http.Header {
  3444. if c.header_ == nil {
  3445. c.header_ = make(http.Header)
  3446. }
  3447. return c.header_
  3448. }
  3449. func (c *AccountsContainersFoldersCreateCall) doRequest(alt string) (*http.Response, error) {
  3450. reqHeaders := make(http.Header)
  3451. for k, v := range c.header_ {
  3452. reqHeaders[k] = v
  3453. }
  3454. reqHeaders.Set("User-Agent", c.s.userAgent())
  3455. var body io.Reader = nil
  3456. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  3457. if err != nil {
  3458. return nil, err
  3459. }
  3460. reqHeaders.Set("Content-Type", "application/json")
  3461. c.urlParams_.Set("alt", alt)
  3462. c.urlParams_.Set("prettyPrint", "false")
  3463. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders")
  3464. urls += "?" + c.urlParams_.Encode()
  3465. req, err := http.NewRequest("POST", urls, body)
  3466. if err != nil {
  3467. return nil, err
  3468. }
  3469. req.Header = reqHeaders
  3470. googleapi.Expand(req.URL, map[string]string{
  3471. "accountId": c.accountId,
  3472. "containerId": c.containerId,
  3473. })
  3474. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3475. }
  3476. // Do executes the "tagmanager.accounts.containers.folders.create" call.
  3477. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  3478. // code is an error. Response headers are in either
  3479. // *Folder.ServerResponse.Header or (if a response was returned at all)
  3480. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3481. // check whether the returned error was because http.StatusNotModified
  3482. // was returned.
  3483. func (c *AccountsContainersFoldersCreateCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  3484. gensupport.SetOptions(c.urlParams_, opts...)
  3485. res, err := c.doRequest("json")
  3486. if res != nil && res.StatusCode == http.StatusNotModified {
  3487. if res.Body != nil {
  3488. res.Body.Close()
  3489. }
  3490. return nil, &googleapi.Error{
  3491. Code: res.StatusCode,
  3492. Header: res.Header,
  3493. }
  3494. }
  3495. if err != nil {
  3496. return nil, err
  3497. }
  3498. defer googleapi.CloseBody(res)
  3499. if err := googleapi.CheckResponse(res); err != nil {
  3500. return nil, err
  3501. }
  3502. ret := &Folder{
  3503. ServerResponse: googleapi.ServerResponse{
  3504. Header: res.Header,
  3505. HTTPStatusCode: res.StatusCode,
  3506. },
  3507. }
  3508. target := &ret
  3509. if err := gensupport.DecodeResponse(target, res); err != nil {
  3510. return nil, err
  3511. }
  3512. return ret, nil
  3513. // {
  3514. // "description": "Creates a GTM Folder.",
  3515. // "httpMethod": "POST",
  3516. // "id": "tagmanager.accounts.containers.folders.create",
  3517. // "parameterOrder": [
  3518. // "accountId",
  3519. // "containerId"
  3520. // ],
  3521. // "parameters": {
  3522. // "accountId": {
  3523. // "description": "The GTM Account ID.",
  3524. // "location": "path",
  3525. // "required": true,
  3526. // "type": "string"
  3527. // },
  3528. // "containerId": {
  3529. // "description": "The GTM Container ID.",
  3530. // "location": "path",
  3531. // "required": true,
  3532. // "type": "string"
  3533. // }
  3534. // },
  3535. // "path": "accounts/{accountId}/containers/{containerId}/folders",
  3536. // "request": {
  3537. // "$ref": "Folder"
  3538. // },
  3539. // "response": {
  3540. // "$ref": "Folder"
  3541. // },
  3542. // "scopes": [
  3543. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3544. // ]
  3545. // }
  3546. }
  3547. // method id "tagmanager.accounts.containers.folders.delete":
  3548. type AccountsContainersFoldersDeleteCall struct {
  3549. s *Service
  3550. accountId string
  3551. containerId string
  3552. folderId string
  3553. urlParams_ gensupport.URLParams
  3554. ctx_ context.Context
  3555. header_ http.Header
  3556. }
  3557. // Delete: Deletes a GTM Folder.
  3558. func (r *AccountsContainersFoldersService) Delete(accountId string, containerId string, folderId string) *AccountsContainersFoldersDeleteCall {
  3559. c := &AccountsContainersFoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3560. c.accountId = accountId
  3561. c.containerId = containerId
  3562. c.folderId = folderId
  3563. return c
  3564. }
  3565. // Fields allows partial responses to be retrieved. See
  3566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3567. // for more information.
  3568. func (c *AccountsContainersFoldersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersDeleteCall {
  3569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3570. return c
  3571. }
  3572. // Context sets the context to be used in this call's Do method. Any
  3573. // pending HTTP request will be aborted if the provided context is
  3574. // canceled.
  3575. func (c *AccountsContainersFoldersDeleteCall) Context(ctx context.Context) *AccountsContainersFoldersDeleteCall {
  3576. c.ctx_ = ctx
  3577. return c
  3578. }
  3579. // Header returns an http.Header that can be modified by the caller to
  3580. // add HTTP headers to the request.
  3581. func (c *AccountsContainersFoldersDeleteCall) Header() http.Header {
  3582. if c.header_ == nil {
  3583. c.header_ = make(http.Header)
  3584. }
  3585. return c.header_
  3586. }
  3587. func (c *AccountsContainersFoldersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3588. reqHeaders := make(http.Header)
  3589. for k, v := range c.header_ {
  3590. reqHeaders[k] = v
  3591. }
  3592. reqHeaders.Set("User-Agent", c.s.userAgent())
  3593. var body io.Reader = nil
  3594. c.urlParams_.Set("alt", alt)
  3595. c.urlParams_.Set("prettyPrint", "false")
  3596. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}")
  3597. urls += "?" + c.urlParams_.Encode()
  3598. req, err := http.NewRequest("DELETE", urls, body)
  3599. if err != nil {
  3600. return nil, err
  3601. }
  3602. req.Header = reqHeaders
  3603. googleapi.Expand(req.URL, map[string]string{
  3604. "accountId": c.accountId,
  3605. "containerId": c.containerId,
  3606. "folderId": c.folderId,
  3607. })
  3608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3609. }
  3610. // Do executes the "tagmanager.accounts.containers.folders.delete" call.
  3611. func (c *AccountsContainersFoldersDeleteCall) Do(opts ...googleapi.CallOption) error {
  3612. gensupport.SetOptions(c.urlParams_, opts...)
  3613. res, err := c.doRequest("json")
  3614. if err != nil {
  3615. return err
  3616. }
  3617. defer googleapi.CloseBody(res)
  3618. if err := googleapi.CheckResponse(res); err != nil {
  3619. return err
  3620. }
  3621. return nil
  3622. // {
  3623. // "description": "Deletes a GTM Folder.",
  3624. // "httpMethod": "DELETE",
  3625. // "id": "tagmanager.accounts.containers.folders.delete",
  3626. // "parameterOrder": [
  3627. // "accountId",
  3628. // "containerId",
  3629. // "folderId"
  3630. // ],
  3631. // "parameters": {
  3632. // "accountId": {
  3633. // "description": "The GTM Account ID.",
  3634. // "location": "path",
  3635. // "required": true,
  3636. // "type": "string"
  3637. // },
  3638. // "containerId": {
  3639. // "description": "The GTM Container ID.",
  3640. // "location": "path",
  3641. // "required": true,
  3642. // "type": "string"
  3643. // },
  3644. // "folderId": {
  3645. // "description": "The GTM Folder ID.",
  3646. // "location": "path",
  3647. // "required": true,
  3648. // "type": "string"
  3649. // }
  3650. // },
  3651. // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}",
  3652. // "scopes": [
  3653. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3654. // ]
  3655. // }
  3656. }
  3657. // method id "tagmanager.accounts.containers.folders.get":
  3658. type AccountsContainersFoldersGetCall struct {
  3659. s *Service
  3660. accountId string
  3661. containerId string
  3662. folderId string
  3663. urlParams_ gensupport.URLParams
  3664. ifNoneMatch_ string
  3665. ctx_ context.Context
  3666. header_ http.Header
  3667. }
  3668. // Get: Gets a GTM Folder.
  3669. func (r *AccountsContainersFoldersService) Get(accountId string, containerId string, folderId string) *AccountsContainersFoldersGetCall {
  3670. c := &AccountsContainersFoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3671. c.accountId = accountId
  3672. c.containerId = containerId
  3673. c.folderId = folderId
  3674. return c
  3675. }
  3676. // Fields allows partial responses to be retrieved. See
  3677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3678. // for more information.
  3679. func (c *AccountsContainersFoldersGetCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersGetCall {
  3680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3681. return c
  3682. }
  3683. // IfNoneMatch sets the optional parameter which makes the operation
  3684. // fail if the object's ETag matches the given value. This is useful for
  3685. // getting updates only after the object has changed since the last
  3686. // request. Use googleapi.IsNotModified to check whether the response
  3687. // error from Do is the result of In-None-Match.
  3688. func (c *AccountsContainersFoldersGetCall) IfNoneMatch(entityTag string) *AccountsContainersFoldersGetCall {
  3689. c.ifNoneMatch_ = entityTag
  3690. return c
  3691. }
  3692. // Context sets the context to be used in this call's Do method. Any
  3693. // pending HTTP request will be aborted if the provided context is
  3694. // canceled.
  3695. func (c *AccountsContainersFoldersGetCall) Context(ctx context.Context) *AccountsContainersFoldersGetCall {
  3696. c.ctx_ = ctx
  3697. return c
  3698. }
  3699. // Header returns an http.Header that can be modified by the caller to
  3700. // add HTTP headers to the request.
  3701. func (c *AccountsContainersFoldersGetCall) Header() http.Header {
  3702. if c.header_ == nil {
  3703. c.header_ = make(http.Header)
  3704. }
  3705. return c.header_
  3706. }
  3707. func (c *AccountsContainersFoldersGetCall) doRequest(alt string) (*http.Response, error) {
  3708. reqHeaders := make(http.Header)
  3709. for k, v := range c.header_ {
  3710. reqHeaders[k] = v
  3711. }
  3712. reqHeaders.Set("User-Agent", c.s.userAgent())
  3713. if c.ifNoneMatch_ != "" {
  3714. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3715. }
  3716. var body io.Reader = nil
  3717. c.urlParams_.Set("alt", alt)
  3718. c.urlParams_.Set("prettyPrint", "false")
  3719. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}")
  3720. urls += "?" + c.urlParams_.Encode()
  3721. req, err := http.NewRequest("GET", urls, body)
  3722. if err != nil {
  3723. return nil, err
  3724. }
  3725. req.Header = reqHeaders
  3726. googleapi.Expand(req.URL, map[string]string{
  3727. "accountId": c.accountId,
  3728. "containerId": c.containerId,
  3729. "folderId": c.folderId,
  3730. })
  3731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3732. }
  3733. // Do executes the "tagmanager.accounts.containers.folders.get" call.
  3734. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  3735. // code is an error. Response headers are in either
  3736. // *Folder.ServerResponse.Header or (if a response was returned at all)
  3737. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3738. // check whether the returned error was because http.StatusNotModified
  3739. // was returned.
  3740. func (c *AccountsContainersFoldersGetCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  3741. gensupport.SetOptions(c.urlParams_, opts...)
  3742. res, err := c.doRequest("json")
  3743. if res != nil && res.StatusCode == http.StatusNotModified {
  3744. if res.Body != nil {
  3745. res.Body.Close()
  3746. }
  3747. return nil, &googleapi.Error{
  3748. Code: res.StatusCode,
  3749. Header: res.Header,
  3750. }
  3751. }
  3752. if err != nil {
  3753. return nil, err
  3754. }
  3755. defer googleapi.CloseBody(res)
  3756. if err := googleapi.CheckResponse(res); err != nil {
  3757. return nil, err
  3758. }
  3759. ret := &Folder{
  3760. ServerResponse: googleapi.ServerResponse{
  3761. Header: res.Header,
  3762. HTTPStatusCode: res.StatusCode,
  3763. },
  3764. }
  3765. target := &ret
  3766. if err := gensupport.DecodeResponse(target, res); err != nil {
  3767. return nil, err
  3768. }
  3769. return ret, nil
  3770. // {
  3771. // "description": "Gets a GTM Folder.",
  3772. // "httpMethod": "GET",
  3773. // "id": "tagmanager.accounts.containers.folders.get",
  3774. // "parameterOrder": [
  3775. // "accountId",
  3776. // "containerId",
  3777. // "folderId"
  3778. // ],
  3779. // "parameters": {
  3780. // "accountId": {
  3781. // "description": "The GTM Account ID.",
  3782. // "location": "path",
  3783. // "required": true,
  3784. // "type": "string"
  3785. // },
  3786. // "containerId": {
  3787. // "description": "The GTM Container ID.",
  3788. // "location": "path",
  3789. // "required": true,
  3790. // "type": "string"
  3791. // },
  3792. // "folderId": {
  3793. // "description": "The GTM Folder ID.",
  3794. // "location": "path",
  3795. // "required": true,
  3796. // "type": "string"
  3797. // }
  3798. // },
  3799. // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}",
  3800. // "response": {
  3801. // "$ref": "Folder"
  3802. // },
  3803. // "scopes": [
  3804. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3805. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3806. // ]
  3807. // }
  3808. }
  3809. // method id "tagmanager.accounts.containers.folders.list":
  3810. type AccountsContainersFoldersListCall struct {
  3811. s *Service
  3812. accountId string
  3813. containerId string
  3814. urlParams_ gensupport.URLParams
  3815. ifNoneMatch_ string
  3816. ctx_ context.Context
  3817. header_ http.Header
  3818. }
  3819. // List: Lists all GTM Folders of a Container.
  3820. func (r *AccountsContainersFoldersService) List(accountId string, containerId string) *AccountsContainersFoldersListCall {
  3821. c := &AccountsContainersFoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3822. c.accountId = accountId
  3823. c.containerId = containerId
  3824. return c
  3825. }
  3826. // Fields allows partial responses to be retrieved. See
  3827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3828. // for more information.
  3829. func (c *AccountsContainersFoldersListCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersListCall {
  3830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3831. return c
  3832. }
  3833. // IfNoneMatch sets the optional parameter which makes the operation
  3834. // fail if the object's ETag matches the given value. This is useful for
  3835. // getting updates only after the object has changed since the last
  3836. // request. Use googleapi.IsNotModified to check whether the response
  3837. // error from Do is the result of In-None-Match.
  3838. func (c *AccountsContainersFoldersListCall) IfNoneMatch(entityTag string) *AccountsContainersFoldersListCall {
  3839. c.ifNoneMatch_ = entityTag
  3840. return c
  3841. }
  3842. // Context sets the context to be used in this call's Do method. Any
  3843. // pending HTTP request will be aborted if the provided context is
  3844. // canceled.
  3845. func (c *AccountsContainersFoldersListCall) Context(ctx context.Context) *AccountsContainersFoldersListCall {
  3846. c.ctx_ = ctx
  3847. return c
  3848. }
  3849. // Header returns an http.Header that can be modified by the caller to
  3850. // add HTTP headers to the request.
  3851. func (c *AccountsContainersFoldersListCall) Header() http.Header {
  3852. if c.header_ == nil {
  3853. c.header_ = make(http.Header)
  3854. }
  3855. return c.header_
  3856. }
  3857. func (c *AccountsContainersFoldersListCall) doRequest(alt string) (*http.Response, error) {
  3858. reqHeaders := make(http.Header)
  3859. for k, v := range c.header_ {
  3860. reqHeaders[k] = v
  3861. }
  3862. reqHeaders.Set("User-Agent", c.s.userAgent())
  3863. if c.ifNoneMatch_ != "" {
  3864. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3865. }
  3866. var body io.Reader = nil
  3867. c.urlParams_.Set("alt", alt)
  3868. c.urlParams_.Set("prettyPrint", "false")
  3869. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders")
  3870. urls += "?" + c.urlParams_.Encode()
  3871. req, err := http.NewRequest("GET", urls, body)
  3872. if err != nil {
  3873. return nil, err
  3874. }
  3875. req.Header = reqHeaders
  3876. googleapi.Expand(req.URL, map[string]string{
  3877. "accountId": c.accountId,
  3878. "containerId": c.containerId,
  3879. })
  3880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3881. }
  3882. // Do executes the "tagmanager.accounts.containers.folders.list" call.
  3883. // Exactly one of *ListFoldersResponse or error will be non-nil. Any
  3884. // non-2xx status code is an error. Response headers are in either
  3885. // *ListFoldersResponse.ServerResponse.Header or (if a response was
  3886. // returned at all) in error.(*googleapi.Error).Header. Use
  3887. // googleapi.IsNotModified to check whether the returned error was
  3888. // because http.StatusNotModified was returned.
  3889. func (c *AccountsContainersFoldersListCall) Do(opts ...googleapi.CallOption) (*ListFoldersResponse, error) {
  3890. gensupport.SetOptions(c.urlParams_, opts...)
  3891. res, err := c.doRequest("json")
  3892. if res != nil && res.StatusCode == http.StatusNotModified {
  3893. if res.Body != nil {
  3894. res.Body.Close()
  3895. }
  3896. return nil, &googleapi.Error{
  3897. Code: res.StatusCode,
  3898. Header: res.Header,
  3899. }
  3900. }
  3901. if err != nil {
  3902. return nil, err
  3903. }
  3904. defer googleapi.CloseBody(res)
  3905. if err := googleapi.CheckResponse(res); err != nil {
  3906. return nil, err
  3907. }
  3908. ret := &ListFoldersResponse{
  3909. ServerResponse: googleapi.ServerResponse{
  3910. Header: res.Header,
  3911. HTTPStatusCode: res.StatusCode,
  3912. },
  3913. }
  3914. target := &ret
  3915. if err := gensupport.DecodeResponse(target, res); err != nil {
  3916. return nil, err
  3917. }
  3918. return ret, nil
  3919. // {
  3920. // "description": "Lists all GTM Folders of a Container.",
  3921. // "httpMethod": "GET",
  3922. // "id": "tagmanager.accounts.containers.folders.list",
  3923. // "parameterOrder": [
  3924. // "accountId",
  3925. // "containerId"
  3926. // ],
  3927. // "parameters": {
  3928. // "accountId": {
  3929. // "description": "The GTM Account ID.",
  3930. // "location": "path",
  3931. // "required": true,
  3932. // "type": "string"
  3933. // },
  3934. // "containerId": {
  3935. // "description": "The GTM Container ID.",
  3936. // "location": "path",
  3937. // "required": true,
  3938. // "type": "string"
  3939. // }
  3940. // },
  3941. // "path": "accounts/{accountId}/containers/{containerId}/folders",
  3942. // "response": {
  3943. // "$ref": "ListFoldersResponse"
  3944. // },
  3945. // "scopes": [
  3946. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3947. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3948. // ]
  3949. // }
  3950. }
  3951. // method id "tagmanager.accounts.containers.folders.update":
  3952. type AccountsContainersFoldersUpdateCall struct {
  3953. s *Service
  3954. accountId string
  3955. containerId string
  3956. folderId string
  3957. folder *Folder
  3958. urlParams_ gensupport.URLParams
  3959. ctx_ context.Context
  3960. header_ http.Header
  3961. }
  3962. // Update: Updates a GTM Folder.
  3963. func (r *AccountsContainersFoldersService) Update(accountId string, containerId string, folderId string, folder *Folder) *AccountsContainersFoldersUpdateCall {
  3964. c := &AccountsContainersFoldersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3965. c.accountId = accountId
  3966. c.containerId = containerId
  3967. c.folderId = folderId
  3968. c.folder = folder
  3969. return c
  3970. }
  3971. // Fingerprint sets the optional parameter "fingerprint": When provided,
  3972. // this fingerprint must match the fingerprint of the folder in storage.
  3973. func (c *AccountsContainersFoldersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersFoldersUpdateCall {
  3974. c.urlParams_.Set("fingerprint", fingerprint)
  3975. return c
  3976. }
  3977. // Fields allows partial responses to be retrieved. See
  3978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3979. // for more information.
  3980. func (c *AccountsContainersFoldersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersUpdateCall {
  3981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3982. return c
  3983. }
  3984. // Context sets the context to be used in this call's Do method. Any
  3985. // pending HTTP request will be aborted if the provided context is
  3986. // canceled.
  3987. func (c *AccountsContainersFoldersUpdateCall) Context(ctx context.Context) *AccountsContainersFoldersUpdateCall {
  3988. c.ctx_ = ctx
  3989. return c
  3990. }
  3991. // Header returns an http.Header that can be modified by the caller to
  3992. // add HTTP headers to the request.
  3993. func (c *AccountsContainersFoldersUpdateCall) Header() http.Header {
  3994. if c.header_ == nil {
  3995. c.header_ = make(http.Header)
  3996. }
  3997. return c.header_
  3998. }
  3999. func (c *AccountsContainersFoldersUpdateCall) doRequest(alt string) (*http.Response, error) {
  4000. reqHeaders := make(http.Header)
  4001. for k, v := range c.header_ {
  4002. reqHeaders[k] = v
  4003. }
  4004. reqHeaders.Set("User-Agent", c.s.userAgent())
  4005. var body io.Reader = nil
  4006. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  4007. if err != nil {
  4008. return nil, err
  4009. }
  4010. reqHeaders.Set("Content-Type", "application/json")
  4011. c.urlParams_.Set("alt", alt)
  4012. c.urlParams_.Set("prettyPrint", "false")
  4013. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}")
  4014. urls += "?" + c.urlParams_.Encode()
  4015. req, err := http.NewRequest("PUT", urls, body)
  4016. if err != nil {
  4017. return nil, err
  4018. }
  4019. req.Header = reqHeaders
  4020. googleapi.Expand(req.URL, map[string]string{
  4021. "accountId": c.accountId,
  4022. "containerId": c.containerId,
  4023. "folderId": c.folderId,
  4024. })
  4025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4026. }
  4027. // Do executes the "tagmanager.accounts.containers.folders.update" call.
  4028. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  4029. // code is an error. Response headers are in either
  4030. // *Folder.ServerResponse.Header or (if a response was returned at all)
  4031. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4032. // check whether the returned error was because http.StatusNotModified
  4033. // was returned.
  4034. func (c *AccountsContainersFoldersUpdateCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  4035. gensupport.SetOptions(c.urlParams_, opts...)
  4036. res, err := c.doRequest("json")
  4037. if res != nil && res.StatusCode == http.StatusNotModified {
  4038. if res.Body != nil {
  4039. res.Body.Close()
  4040. }
  4041. return nil, &googleapi.Error{
  4042. Code: res.StatusCode,
  4043. Header: res.Header,
  4044. }
  4045. }
  4046. if err != nil {
  4047. return nil, err
  4048. }
  4049. defer googleapi.CloseBody(res)
  4050. if err := googleapi.CheckResponse(res); err != nil {
  4051. return nil, err
  4052. }
  4053. ret := &Folder{
  4054. ServerResponse: googleapi.ServerResponse{
  4055. Header: res.Header,
  4056. HTTPStatusCode: res.StatusCode,
  4057. },
  4058. }
  4059. target := &ret
  4060. if err := gensupport.DecodeResponse(target, res); err != nil {
  4061. return nil, err
  4062. }
  4063. return ret, nil
  4064. // {
  4065. // "description": "Updates a GTM Folder.",
  4066. // "httpMethod": "PUT",
  4067. // "id": "tagmanager.accounts.containers.folders.update",
  4068. // "parameterOrder": [
  4069. // "accountId",
  4070. // "containerId",
  4071. // "folderId"
  4072. // ],
  4073. // "parameters": {
  4074. // "accountId": {
  4075. // "description": "The GTM Account ID.",
  4076. // "location": "path",
  4077. // "required": true,
  4078. // "type": "string"
  4079. // },
  4080. // "containerId": {
  4081. // "description": "The GTM Container ID.",
  4082. // "location": "path",
  4083. // "required": true,
  4084. // "type": "string"
  4085. // },
  4086. // "fingerprint": {
  4087. // "description": "When provided, this fingerprint must match the fingerprint of the folder in storage.",
  4088. // "location": "query",
  4089. // "type": "string"
  4090. // },
  4091. // "folderId": {
  4092. // "description": "The GTM Folder ID.",
  4093. // "location": "path",
  4094. // "required": true,
  4095. // "type": "string"
  4096. // }
  4097. // },
  4098. // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}",
  4099. // "request": {
  4100. // "$ref": "Folder"
  4101. // },
  4102. // "response": {
  4103. // "$ref": "Folder"
  4104. // },
  4105. // "scopes": [
  4106. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4107. // ]
  4108. // }
  4109. }
  4110. // method id "tagmanager.accounts.containers.folders.entities.list":
  4111. type AccountsContainersFoldersEntitiesListCall struct {
  4112. s *Service
  4113. accountId string
  4114. containerId string
  4115. folderId string
  4116. urlParams_ gensupport.URLParams
  4117. ifNoneMatch_ string
  4118. ctx_ context.Context
  4119. header_ http.Header
  4120. }
  4121. // List: List all entities in a GTM Folder.
  4122. func (r *AccountsContainersFoldersEntitiesService) List(accountId string, containerId string, folderId string) *AccountsContainersFoldersEntitiesListCall {
  4123. c := &AccountsContainersFoldersEntitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4124. c.accountId = accountId
  4125. c.containerId = containerId
  4126. c.folderId = folderId
  4127. return c
  4128. }
  4129. // Fields allows partial responses to be retrieved. See
  4130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4131. // for more information.
  4132. func (c *AccountsContainersFoldersEntitiesListCall) Fields(s ...googleapi.Field) *AccountsContainersFoldersEntitiesListCall {
  4133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4134. return c
  4135. }
  4136. // IfNoneMatch sets the optional parameter which makes the operation
  4137. // fail if the object's ETag matches the given value. This is useful for
  4138. // getting updates only after the object has changed since the last
  4139. // request. Use googleapi.IsNotModified to check whether the response
  4140. // error from Do is the result of In-None-Match.
  4141. func (c *AccountsContainersFoldersEntitiesListCall) IfNoneMatch(entityTag string) *AccountsContainersFoldersEntitiesListCall {
  4142. c.ifNoneMatch_ = entityTag
  4143. return c
  4144. }
  4145. // Context sets the context to be used in this call's Do method. Any
  4146. // pending HTTP request will be aborted if the provided context is
  4147. // canceled.
  4148. func (c *AccountsContainersFoldersEntitiesListCall) Context(ctx context.Context) *AccountsContainersFoldersEntitiesListCall {
  4149. c.ctx_ = ctx
  4150. return c
  4151. }
  4152. // Header returns an http.Header that can be modified by the caller to
  4153. // add HTTP headers to the request.
  4154. func (c *AccountsContainersFoldersEntitiesListCall) Header() http.Header {
  4155. if c.header_ == nil {
  4156. c.header_ = make(http.Header)
  4157. }
  4158. return c.header_
  4159. }
  4160. func (c *AccountsContainersFoldersEntitiesListCall) doRequest(alt string) (*http.Response, error) {
  4161. reqHeaders := make(http.Header)
  4162. for k, v := range c.header_ {
  4163. reqHeaders[k] = v
  4164. }
  4165. reqHeaders.Set("User-Agent", c.s.userAgent())
  4166. if c.ifNoneMatch_ != "" {
  4167. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4168. }
  4169. var body io.Reader = nil
  4170. c.urlParams_.Set("alt", alt)
  4171. c.urlParams_.Set("prettyPrint", "false")
  4172. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities")
  4173. urls += "?" + c.urlParams_.Encode()
  4174. req, err := http.NewRequest("GET", urls, body)
  4175. if err != nil {
  4176. return nil, err
  4177. }
  4178. req.Header = reqHeaders
  4179. googleapi.Expand(req.URL, map[string]string{
  4180. "accountId": c.accountId,
  4181. "containerId": c.containerId,
  4182. "folderId": c.folderId,
  4183. })
  4184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4185. }
  4186. // Do executes the "tagmanager.accounts.containers.folders.entities.list" call.
  4187. // Exactly one of *FolderEntities or error will be non-nil. Any non-2xx
  4188. // status code is an error. Response headers are in either
  4189. // *FolderEntities.ServerResponse.Header or (if a response was returned
  4190. // at all) in error.(*googleapi.Error).Header. Use
  4191. // googleapi.IsNotModified to check whether the returned error was
  4192. // because http.StatusNotModified was returned.
  4193. func (c *AccountsContainersFoldersEntitiesListCall) Do(opts ...googleapi.CallOption) (*FolderEntities, error) {
  4194. gensupport.SetOptions(c.urlParams_, opts...)
  4195. res, err := c.doRequest("json")
  4196. if res != nil && res.StatusCode == http.StatusNotModified {
  4197. if res.Body != nil {
  4198. res.Body.Close()
  4199. }
  4200. return nil, &googleapi.Error{
  4201. Code: res.StatusCode,
  4202. Header: res.Header,
  4203. }
  4204. }
  4205. if err != nil {
  4206. return nil, err
  4207. }
  4208. defer googleapi.CloseBody(res)
  4209. if err := googleapi.CheckResponse(res); err != nil {
  4210. return nil, err
  4211. }
  4212. ret := &FolderEntities{
  4213. ServerResponse: googleapi.ServerResponse{
  4214. Header: res.Header,
  4215. HTTPStatusCode: res.StatusCode,
  4216. },
  4217. }
  4218. target := &ret
  4219. if err := gensupport.DecodeResponse(target, res); err != nil {
  4220. return nil, err
  4221. }
  4222. return ret, nil
  4223. // {
  4224. // "description": "List all entities in a GTM Folder.",
  4225. // "httpMethod": "GET",
  4226. // "id": "tagmanager.accounts.containers.folders.entities.list",
  4227. // "parameterOrder": [
  4228. // "accountId",
  4229. // "containerId",
  4230. // "folderId"
  4231. // ],
  4232. // "parameters": {
  4233. // "accountId": {
  4234. // "description": "The GTM Account ID.",
  4235. // "location": "path",
  4236. // "required": true,
  4237. // "type": "string"
  4238. // },
  4239. // "containerId": {
  4240. // "description": "The GTM Container ID.",
  4241. // "location": "path",
  4242. // "required": true,
  4243. // "type": "string"
  4244. // },
  4245. // "folderId": {
  4246. // "description": "The GTM Folder ID.",
  4247. // "location": "path",
  4248. // "required": true,
  4249. // "type": "string"
  4250. // }
  4251. // },
  4252. // "path": "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities",
  4253. // "response": {
  4254. // "$ref": "FolderEntities"
  4255. // },
  4256. // "scopes": [
  4257. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4258. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4259. // ]
  4260. // }
  4261. }
  4262. // method id "tagmanager.accounts.containers.move_folders.update":
  4263. type AccountsContainersMoveFoldersUpdateCall struct {
  4264. s *Service
  4265. accountId string
  4266. containerId string
  4267. folderId string
  4268. folder *Folder
  4269. urlParams_ gensupport.URLParams
  4270. ctx_ context.Context
  4271. header_ http.Header
  4272. }
  4273. // Update: Moves entities to a GTM Folder.
  4274. func (r *AccountsContainersMoveFoldersService) Update(accountId string, containerId string, folderId string, folder *Folder) *AccountsContainersMoveFoldersUpdateCall {
  4275. c := &AccountsContainersMoveFoldersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4276. c.accountId = accountId
  4277. c.containerId = containerId
  4278. c.folderId = folderId
  4279. c.folder = folder
  4280. return c
  4281. }
  4282. // TagId sets the optional parameter "tagId": The tags to be moved to
  4283. // the folder.
  4284. func (c *AccountsContainersMoveFoldersUpdateCall) TagId(tagId ...string) *AccountsContainersMoveFoldersUpdateCall {
  4285. c.urlParams_.SetMulti("tagId", append([]string{}, tagId...))
  4286. return c
  4287. }
  4288. // TriggerId sets the optional parameter "triggerId": The triggers to be
  4289. // moved to the folder.
  4290. func (c *AccountsContainersMoveFoldersUpdateCall) TriggerId(triggerId ...string) *AccountsContainersMoveFoldersUpdateCall {
  4291. c.urlParams_.SetMulti("triggerId", append([]string{}, triggerId...))
  4292. return c
  4293. }
  4294. // VariableId sets the optional parameter "variableId": The variables to
  4295. // be moved to the folder.
  4296. func (c *AccountsContainersMoveFoldersUpdateCall) VariableId(variableId ...string) *AccountsContainersMoveFoldersUpdateCall {
  4297. c.urlParams_.SetMulti("variableId", append([]string{}, variableId...))
  4298. return c
  4299. }
  4300. // Fields allows partial responses to be retrieved. See
  4301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4302. // for more information.
  4303. func (c *AccountsContainersMoveFoldersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersMoveFoldersUpdateCall {
  4304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4305. return c
  4306. }
  4307. // Context sets the context to be used in this call's Do method. Any
  4308. // pending HTTP request will be aborted if the provided context is
  4309. // canceled.
  4310. func (c *AccountsContainersMoveFoldersUpdateCall) Context(ctx context.Context) *AccountsContainersMoveFoldersUpdateCall {
  4311. c.ctx_ = ctx
  4312. return c
  4313. }
  4314. // Header returns an http.Header that can be modified by the caller to
  4315. // add HTTP headers to the request.
  4316. func (c *AccountsContainersMoveFoldersUpdateCall) Header() http.Header {
  4317. if c.header_ == nil {
  4318. c.header_ = make(http.Header)
  4319. }
  4320. return c.header_
  4321. }
  4322. func (c *AccountsContainersMoveFoldersUpdateCall) doRequest(alt string) (*http.Response, error) {
  4323. reqHeaders := make(http.Header)
  4324. for k, v := range c.header_ {
  4325. reqHeaders[k] = v
  4326. }
  4327. reqHeaders.Set("User-Agent", c.s.userAgent())
  4328. var body io.Reader = nil
  4329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  4330. if err != nil {
  4331. return nil, err
  4332. }
  4333. reqHeaders.Set("Content-Type", "application/json")
  4334. c.urlParams_.Set("alt", alt)
  4335. c.urlParams_.Set("prettyPrint", "false")
  4336. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}")
  4337. urls += "?" + c.urlParams_.Encode()
  4338. req, err := http.NewRequest("PUT", urls, body)
  4339. if err != nil {
  4340. return nil, err
  4341. }
  4342. req.Header = reqHeaders
  4343. googleapi.Expand(req.URL, map[string]string{
  4344. "accountId": c.accountId,
  4345. "containerId": c.containerId,
  4346. "folderId": c.folderId,
  4347. })
  4348. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4349. }
  4350. // Do executes the "tagmanager.accounts.containers.move_folders.update" call.
  4351. func (c *AccountsContainersMoveFoldersUpdateCall) Do(opts ...googleapi.CallOption) error {
  4352. gensupport.SetOptions(c.urlParams_, opts...)
  4353. res, err := c.doRequest("json")
  4354. if err != nil {
  4355. return err
  4356. }
  4357. defer googleapi.CloseBody(res)
  4358. if err := googleapi.CheckResponse(res); err != nil {
  4359. return err
  4360. }
  4361. return nil
  4362. // {
  4363. // "description": "Moves entities to a GTM Folder.",
  4364. // "httpMethod": "PUT",
  4365. // "id": "tagmanager.accounts.containers.move_folders.update",
  4366. // "parameterOrder": [
  4367. // "accountId",
  4368. // "containerId",
  4369. // "folderId"
  4370. // ],
  4371. // "parameters": {
  4372. // "accountId": {
  4373. // "description": "The GTM Account ID.",
  4374. // "location": "path",
  4375. // "required": true,
  4376. // "type": "string"
  4377. // },
  4378. // "containerId": {
  4379. // "description": "The GTM Container ID.",
  4380. // "location": "path",
  4381. // "required": true,
  4382. // "type": "string"
  4383. // },
  4384. // "folderId": {
  4385. // "description": "The GTM Folder ID.",
  4386. // "location": "path",
  4387. // "required": true,
  4388. // "type": "string"
  4389. // },
  4390. // "tagId": {
  4391. // "description": "The tags to be moved to the folder.",
  4392. // "location": "query",
  4393. // "repeated": true,
  4394. // "type": "string"
  4395. // },
  4396. // "triggerId": {
  4397. // "description": "The triggers to be moved to the folder.",
  4398. // "location": "query",
  4399. // "repeated": true,
  4400. // "type": "string"
  4401. // },
  4402. // "variableId": {
  4403. // "description": "The variables to be moved to the folder.",
  4404. // "location": "query",
  4405. // "repeated": true,
  4406. // "type": "string"
  4407. // }
  4408. // },
  4409. // "path": "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}",
  4410. // "request": {
  4411. // "$ref": "Folder"
  4412. // },
  4413. // "scopes": [
  4414. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4415. // ]
  4416. // }
  4417. }
  4418. // method id "tagmanager.accounts.containers.reauthorize_environments.update":
  4419. type AccountsContainersReauthorizeEnvironmentsUpdateCall struct {
  4420. s *Service
  4421. accountId string
  4422. containerId string
  4423. environmentId string
  4424. environment *Environment
  4425. urlParams_ gensupport.URLParams
  4426. ctx_ context.Context
  4427. header_ http.Header
  4428. }
  4429. // Update: Re-generates the authorization code for a GTM Environment.
  4430. func (r *AccountsContainersReauthorizeEnvironmentsService) Update(accountId string, containerId string, environmentId string, environment *Environment) *AccountsContainersReauthorizeEnvironmentsUpdateCall {
  4431. c := &AccountsContainersReauthorizeEnvironmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4432. c.accountId = accountId
  4433. c.containerId = containerId
  4434. c.environmentId = environmentId
  4435. c.environment = environment
  4436. return c
  4437. }
  4438. // Fields allows partial responses to be retrieved. See
  4439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4440. // for more information.
  4441. func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersReauthorizeEnvironmentsUpdateCall {
  4442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4443. return c
  4444. }
  4445. // Context sets the context to be used in this call's Do method. Any
  4446. // pending HTTP request will be aborted if the provided context is
  4447. // canceled.
  4448. func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) Context(ctx context.Context) *AccountsContainersReauthorizeEnvironmentsUpdateCall {
  4449. c.ctx_ = ctx
  4450. return c
  4451. }
  4452. // Header returns an http.Header that can be modified by the caller to
  4453. // add HTTP headers to the request.
  4454. func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) Header() http.Header {
  4455. if c.header_ == nil {
  4456. c.header_ = make(http.Header)
  4457. }
  4458. return c.header_
  4459. }
  4460. func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4461. reqHeaders := make(http.Header)
  4462. for k, v := range c.header_ {
  4463. reqHeaders[k] = v
  4464. }
  4465. reqHeaders.Set("User-Agent", c.s.userAgent())
  4466. var body io.Reader = nil
  4467. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  4468. if err != nil {
  4469. return nil, err
  4470. }
  4471. reqHeaders.Set("Content-Type", "application/json")
  4472. c.urlParams_.Set("alt", alt)
  4473. c.urlParams_.Set("prettyPrint", "false")
  4474. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}")
  4475. urls += "?" + c.urlParams_.Encode()
  4476. req, err := http.NewRequest("PUT", urls, body)
  4477. if err != nil {
  4478. return nil, err
  4479. }
  4480. req.Header = reqHeaders
  4481. googleapi.Expand(req.URL, map[string]string{
  4482. "accountId": c.accountId,
  4483. "containerId": c.containerId,
  4484. "environmentId": c.environmentId,
  4485. })
  4486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4487. }
  4488. // Do executes the "tagmanager.accounts.containers.reauthorize_environments.update" call.
  4489. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  4490. // status code is an error. Response headers are in either
  4491. // *Environment.ServerResponse.Header or (if a response was returned at
  4492. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4493. // to check whether the returned error was because
  4494. // http.StatusNotModified was returned.
  4495. func (c *AccountsContainersReauthorizeEnvironmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  4496. gensupport.SetOptions(c.urlParams_, opts...)
  4497. res, err := c.doRequest("json")
  4498. if res != nil && res.StatusCode == http.StatusNotModified {
  4499. if res.Body != nil {
  4500. res.Body.Close()
  4501. }
  4502. return nil, &googleapi.Error{
  4503. Code: res.StatusCode,
  4504. Header: res.Header,
  4505. }
  4506. }
  4507. if err != nil {
  4508. return nil, err
  4509. }
  4510. defer googleapi.CloseBody(res)
  4511. if err := googleapi.CheckResponse(res); err != nil {
  4512. return nil, err
  4513. }
  4514. ret := &Environment{
  4515. ServerResponse: googleapi.ServerResponse{
  4516. Header: res.Header,
  4517. HTTPStatusCode: res.StatusCode,
  4518. },
  4519. }
  4520. target := &ret
  4521. if err := gensupport.DecodeResponse(target, res); err != nil {
  4522. return nil, err
  4523. }
  4524. return ret, nil
  4525. // {
  4526. // "description": "Re-generates the authorization code for a GTM Environment.",
  4527. // "httpMethod": "PUT",
  4528. // "id": "tagmanager.accounts.containers.reauthorize_environments.update",
  4529. // "parameterOrder": [
  4530. // "accountId",
  4531. // "containerId",
  4532. // "environmentId"
  4533. // ],
  4534. // "parameters": {
  4535. // "accountId": {
  4536. // "description": "The GTM Account ID.",
  4537. // "location": "path",
  4538. // "required": true,
  4539. // "type": "string"
  4540. // },
  4541. // "containerId": {
  4542. // "description": "The GTM Container ID.",
  4543. // "location": "path",
  4544. // "required": true,
  4545. // "type": "string"
  4546. // },
  4547. // "environmentId": {
  4548. // "description": "The GTM Environment ID.",
  4549. // "location": "path",
  4550. // "required": true,
  4551. // "type": "string"
  4552. // }
  4553. // },
  4554. // "path": "accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}",
  4555. // "request": {
  4556. // "$ref": "Environment"
  4557. // },
  4558. // "response": {
  4559. // "$ref": "Environment"
  4560. // },
  4561. // "scopes": [
  4562. // "https://www.googleapis.com/auth/tagmanager.publish"
  4563. // ]
  4564. // }
  4565. }
  4566. // method id "tagmanager.accounts.containers.tags.create":
  4567. type AccountsContainersTagsCreateCall struct {
  4568. s *Service
  4569. accountId string
  4570. containerId string
  4571. tag *Tag
  4572. urlParams_ gensupport.URLParams
  4573. ctx_ context.Context
  4574. header_ http.Header
  4575. }
  4576. // Create: Creates a GTM Tag.
  4577. func (r *AccountsContainersTagsService) Create(accountId string, containerId string, tag *Tag) *AccountsContainersTagsCreateCall {
  4578. c := &AccountsContainersTagsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4579. c.accountId = accountId
  4580. c.containerId = containerId
  4581. c.tag = tag
  4582. return c
  4583. }
  4584. // Fields allows partial responses to be retrieved. See
  4585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4586. // for more information.
  4587. func (c *AccountsContainersTagsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersTagsCreateCall {
  4588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4589. return c
  4590. }
  4591. // Context sets the context to be used in this call's Do method. Any
  4592. // pending HTTP request will be aborted if the provided context is
  4593. // canceled.
  4594. func (c *AccountsContainersTagsCreateCall) Context(ctx context.Context) *AccountsContainersTagsCreateCall {
  4595. c.ctx_ = ctx
  4596. return c
  4597. }
  4598. // Header returns an http.Header that can be modified by the caller to
  4599. // add HTTP headers to the request.
  4600. func (c *AccountsContainersTagsCreateCall) Header() http.Header {
  4601. if c.header_ == nil {
  4602. c.header_ = make(http.Header)
  4603. }
  4604. return c.header_
  4605. }
  4606. func (c *AccountsContainersTagsCreateCall) doRequest(alt string) (*http.Response, error) {
  4607. reqHeaders := make(http.Header)
  4608. for k, v := range c.header_ {
  4609. reqHeaders[k] = v
  4610. }
  4611. reqHeaders.Set("User-Agent", c.s.userAgent())
  4612. var body io.Reader = nil
  4613. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag)
  4614. if err != nil {
  4615. return nil, err
  4616. }
  4617. reqHeaders.Set("Content-Type", "application/json")
  4618. c.urlParams_.Set("alt", alt)
  4619. c.urlParams_.Set("prettyPrint", "false")
  4620. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags")
  4621. urls += "?" + c.urlParams_.Encode()
  4622. req, err := http.NewRequest("POST", urls, body)
  4623. if err != nil {
  4624. return nil, err
  4625. }
  4626. req.Header = reqHeaders
  4627. googleapi.Expand(req.URL, map[string]string{
  4628. "accountId": c.accountId,
  4629. "containerId": c.containerId,
  4630. })
  4631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4632. }
  4633. // Do executes the "tagmanager.accounts.containers.tags.create" call.
  4634. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  4635. // is an error. Response headers are in either
  4636. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  4637. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4638. // whether the returned error was because http.StatusNotModified was
  4639. // returned.
  4640. func (c *AccountsContainersTagsCreateCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  4641. gensupport.SetOptions(c.urlParams_, opts...)
  4642. res, err := c.doRequest("json")
  4643. if res != nil && res.StatusCode == http.StatusNotModified {
  4644. if res.Body != nil {
  4645. res.Body.Close()
  4646. }
  4647. return nil, &googleapi.Error{
  4648. Code: res.StatusCode,
  4649. Header: res.Header,
  4650. }
  4651. }
  4652. if err != nil {
  4653. return nil, err
  4654. }
  4655. defer googleapi.CloseBody(res)
  4656. if err := googleapi.CheckResponse(res); err != nil {
  4657. return nil, err
  4658. }
  4659. ret := &Tag{
  4660. ServerResponse: googleapi.ServerResponse{
  4661. Header: res.Header,
  4662. HTTPStatusCode: res.StatusCode,
  4663. },
  4664. }
  4665. target := &ret
  4666. if err := gensupport.DecodeResponse(target, res); err != nil {
  4667. return nil, err
  4668. }
  4669. return ret, nil
  4670. // {
  4671. // "description": "Creates a GTM Tag.",
  4672. // "httpMethod": "POST",
  4673. // "id": "tagmanager.accounts.containers.tags.create",
  4674. // "parameterOrder": [
  4675. // "accountId",
  4676. // "containerId"
  4677. // ],
  4678. // "parameters": {
  4679. // "accountId": {
  4680. // "description": "The GTM Account ID.",
  4681. // "location": "path",
  4682. // "required": true,
  4683. // "type": "string"
  4684. // },
  4685. // "containerId": {
  4686. // "description": "The GTM Container ID.",
  4687. // "location": "path",
  4688. // "required": true,
  4689. // "type": "string"
  4690. // }
  4691. // },
  4692. // "path": "accounts/{accountId}/containers/{containerId}/tags",
  4693. // "request": {
  4694. // "$ref": "Tag"
  4695. // },
  4696. // "response": {
  4697. // "$ref": "Tag"
  4698. // },
  4699. // "scopes": [
  4700. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4701. // ]
  4702. // }
  4703. }
  4704. // method id "tagmanager.accounts.containers.tags.delete":
  4705. type AccountsContainersTagsDeleteCall struct {
  4706. s *Service
  4707. accountId string
  4708. containerId string
  4709. tagId string
  4710. urlParams_ gensupport.URLParams
  4711. ctx_ context.Context
  4712. header_ http.Header
  4713. }
  4714. // Delete: Deletes a GTM Tag.
  4715. func (r *AccountsContainersTagsService) Delete(accountId string, containerId string, tagId string) *AccountsContainersTagsDeleteCall {
  4716. c := &AccountsContainersTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4717. c.accountId = accountId
  4718. c.containerId = containerId
  4719. c.tagId = tagId
  4720. return c
  4721. }
  4722. // Fields allows partial responses to be retrieved. See
  4723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4724. // for more information.
  4725. func (c *AccountsContainersTagsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersTagsDeleteCall {
  4726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4727. return c
  4728. }
  4729. // Context sets the context to be used in this call's Do method. Any
  4730. // pending HTTP request will be aborted if the provided context is
  4731. // canceled.
  4732. func (c *AccountsContainersTagsDeleteCall) Context(ctx context.Context) *AccountsContainersTagsDeleteCall {
  4733. c.ctx_ = ctx
  4734. return c
  4735. }
  4736. // Header returns an http.Header that can be modified by the caller to
  4737. // add HTTP headers to the request.
  4738. func (c *AccountsContainersTagsDeleteCall) Header() http.Header {
  4739. if c.header_ == nil {
  4740. c.header_ = make(http.Header)
  4741. }
  4742. return c.header_
  4743. }
  4744. func (c *AccountsContainersTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4745. reqHeaders := make(http.Header)
  4746. for k, v := range c.header_ {
  4747. reqHeaders[k] = v
  4748. }
  4749. reqHeaders.Set("User-Agent", c.s.userAgent())
  4750. var body io.Reader = nil
  4751. c.urlParams_.Set("alt", alt)
  4752. c.urlParams_.Set("prettyPrint", "false")
  4753. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags/{tagId}")
  4754. urls += "?" + c.urlParams_.Encode()
  4755. req, err := http.NewRequest("DELETE", urls, body)
  4756. if err != nil {
  4757. return nil, err
  4758. }
  4759. req.Header = reqHeaders
  4760. googleapi.Expand(req.URL, map[string]string{
  4761. "accountId": c.accountId,
  4762. "containerId": c.containerId,
  4763. "tagId": c.tagId,
  4764. })
  4765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4766. }
  4767. // Do executes the "tagmanager.accounts.containers.tags.delete" call.
  4768. func (c *AccountsContainersTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4769. gensupport.SetOptions(c.urlParams_, opts...)
  4770. res, err := c.doRequest("json")
  4771. if err != nil {
  4772. return err
  4773. }
  4774. defer googleapi.CloseBody(res)
  4775. if err := googleapi.CheckResponse(res); err != nil {
  4776. return err
  4777. }
  4778. return nil
  4779. // {
  4780. // "description": "Deletes a GTM Tag.",
  4781. // "httpMethod": "DELETE",
  4782. // "id": "tagmanager.accounts.containers.tags.delete",
  4783. // "parameterOrder": [
  4784. // "accountId",
  4785. // "containerId",
  4786. // "tagId"
  4787. // ],
  4788. // "parameters": {
  4789. // "accountId": {
  4790. // "description": "The GTM Account ID.",
  4791. // "location": "path",
  4792. // "required": true,
  4793. // "type": "string"
  4794. // },
  4795. // "containerId": {
  4796. // "description": "The GTM Container ID.",
  4797. // "location": "path",
  4798. // "required": true,
  4799. // "type": "string"
  4800. // },
  4801. // "tagId": {
  4802. // "description": "The GTM Tag ID.",
  4803. // "location": "path",
  4804. // "required": true,
  4805. // "type": "string"
  4806. // }
  4807. // },
  4808. // "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}",
  4809. // "scopes": [
  4810. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4811. // ]
  4812. // }
  4813. }
  4814. // method id "tagmanager.accounts.containers.tags.get":
  4815. type AccountsContainersTagsGetCall struct {
  4816. s *Service
  4817. accountId string
  4818. containerId string
  4819. tagId string
  4820. urlParams_ gensupport.URLParams
  4821. ifNoneMatch_ string
  4822. ctx_ context.Context
  4823. header_ http.Header
  4824. }
  4825. // Get: Gets a GTM Tag.
  4826. func (r *AccountsContainersTagsService) Get(accountId string, containerId string, tagId string) *AccountsContainersTagsGetCall {
  4827. c := &AccountsContainersTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4828. c.accountId = accountId
  4829. c.containerId = containerId
  4830. c.tagId = tagId
  4831. return c
  4832. }
  4833. // Fields allows partial responses to be retrieved. See
  4834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4835. // for more information.
  4836. func (c *AccountsContainersTagsGetCall) Fields(s ...googleapi.Field) *AccountsContainersTagsGetCall {
  4837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4838. return c
  4839. }
  4840. // IfNoneMatch sets the optional parameter which makes the operation
  4841. // fail if the object's ETag matches the given value. This is useful for
  4842. // getting updates only after the object has changed since the last
  4843. // request. Use googleapi.IsNotModified to check whether the response
  4844. // error from Do is the result of In-None-Match.
  4845. func (c *AccountsContainersTagsGetCall) IfNoneMatch(entityTag string) *AccountsContainersTagsGetCall {
  4846. c.ifNoneMatch_ = entityTag
  4847. return c
  4848. }
  4849. // Context sets the context to be used in this call's Do method. Any
  4850. // pending HTTP request will be aborted if the provided context is
  4851. // canceled.
  4852. func (c *AccountsContainersTagsGetCall) Context(ctx context.Context) *AccountsContainersTagsGetCall {
  4853. c.ctx_ = ctx
  4854. return c
  4855. }
  4856. // Header returns an http.Header that can be modified by the caller to
  4857. // add HTTP headers to the request.
  4858. func (c *AccountsContainersTagsGetCall) Header() http.Header {
  4859. if c.header_ == nil {
  4860. c.header_ = make(http.Header)
  4861. }
  4862. return c.header_
  4863. }
  4864. func (c *AccountsContainersTagsGetCall) doRequest(alt string) (*http.Response, error) {
  4865. reqHeaders := make(http.Header)
  4866. for k, v := range c.header_ {
  4867. reqHeaders[k] = v
  4868. }
  4869. reqHeaders.Set("User-Agent", c.s.userAgent())
  4870. if c.ifNoneMatch_ != "" {
  4871. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4872. }
  4873. var body io.Reader = nil
  4874. c.urlParams_.Set("alt", alt)
  4875. c.urlParams_.Set("prettyPrint", "false")
  4876. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags/{tagId}")
  4877. urls += "?" + c.urlParams_.Encode()
  4878. req, err := http.NewRequest("GET", urls, body)
  4879. if err != nil {
  4880. return nil, err
  4881. }
  4882. req.Header = reqHeaders
  4883. googleapi.Expand(req.URL, map[string]string{
  4884. "accountId": c.accountId,
  4885. "containerId": c.containerId,
  4886. "tagId": c.tagId,
  4887. })
  4888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4889. }
  4890. // Do executes the "tagmanager.accounts.containers.tags.get" call.
  4891. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  4892. // is an error. Response headers are in either
  4893. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  4894. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4895. // whether the returned error was because http.StatusNotModified was
  4896. // returned.
  4897. func (c *AccountsContainersTagsGetCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  4898. gensupport.SetOptions(c.urlParams_, opts...)
  4899. res, err := c.doRequest("json")
  4900. if res != nil && res.StatusCode == http.StatusNotModified {
  4901. if res.Body != nil {
  4902. res.Body.Close()
  4903. }
  4904. return nil, &googleapi.Error{
  4905. Code: res.StatusCode,
  4906. Header: res.Header,
  4907. }
  4908. }
  4909. if err != nil {
  4910. return nil, err
  4911. }
  4912. defer googleapi.CloseBody(res)
  4913. if err := googleapi.CheckResponse(res); err != nil {
  4914. return nil, err
  4915. }
  4916. ret := &Tag{
  4917. ServerResponse: googleapi.ServerResponse{
  4918. Header: res.Header,
  4919. HTTPStatusCode: res.StatusCode,
  4920. },
  4921. }
  4922. target := &ret
  4923. if err := gensupport.DecodeResponse(target, res); err != nil {
  4924. return nil, err
  4925. }
  4926. return ret, nil
  4927. // {
  4928. // "description": "Gets a GTM Tag.",
  4929. // "httpMethod": "GET",
  4930. // "id": "tagmanager.accounts.containers.tags.get",
  4931. // "parameterOrder": [
  4932. // "accountId",
  4933. // "containerId",
  4934. // "tagId"
  4935. // ],
  4936. // "parameters": {
  4937. // "accountId": {
  4938. // "description": "The GTM Account ID.",
  4939. // "location": "path",
  4940. // "required": true,
  4941. // "type": "string"
  4942. // },
  4943. // "containerId": {
  4944. // "description": "The GTM Container ID.",
  4945. // "location": "path",
  4946. // "required": true,
  4947. // "type": "string"
  4948. // },
  4949. // "tagId": {
  4950. // "description": "The GTM Tag ID.",
  4951. // "location": "path",
  4952. // "required": true,
  4953. // "type": "string"
  4954. // }
  4955. // },
  4956. // "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}",
  4957. // "response": {
  4958. // "$ref": "Tag"
  4959. // },
  4960. // "scopes": [
  4961. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4962. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4963. // ]
  4964. // }
  4965. }
  4966. // method id "tagmanager.accounts.containers.tags.list":
  4967. type AccountsContainersTagsListCall struct {
  4968. s *Service
  4969. accountId string
  4970. containerId string
  4971. urlParams_ gensupport.URLParams
  4972. ifNoneMatch_ string
  4973. ctx_ context.Context
  4974. header_ http.Header
  4975. }
  4976. // List: Lists all GTM Tags of a Container.
  4977. func (r *AccountsContainersTagsService) List(accountId string, containerId string) *AccountsContainersTagsListCall {
  4978. c := &AccountsContainersTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4979. c.accountId = accountId
  4980. c.containerId = containerId
  4981. return c
  4982. }
  4983. // Fields allows partial responses to be retrieved. See
  4984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4985. // for more information.
  4986. func (c *AccountsContainersTagsListCall) Fields(s ...googleapi.Field) *AccountsContainersTagsListCall {
  4987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4988. return c
  4989. }
  4990. // IfNoneMatch sets the optional parameter which makes the operation
  4991. // fail if the object's ETag matches the given value. This is useful for
  4992. // getting updates only after the object has changed since the last
  4993. // request. Use googleapi.IsNotModified to check whether the response
  4994. // error from Do is the result of In-None-Match.
  4995. func (c *AccountsContainersTagsListCall) IfNoneMatch(entityTag string) *AccountsContainersTagsListCall {
  4996. c.ifNoneMatch_ = entityTag
  4997. return c
  4998. }
  4999. // Context sets the context to be used in this call's Do method. Any
  5000. // pending HTTP request will be aborted if the provided context is
  5001. // canceled.
  5002. func (c *AccountsContainersTagsListCall) Context(ctx context.Context) *AccountsContainersTagsListCall {
  5003. c.ctx_ = ctx
  5004. return c
  5005. }
  5006. // Header returns an http.Header that can be modified by the caller to
  5007. // add HTTP headers to the request.
  5008. func (c *AccountsContainersTagsListCall) Header() http.Header {
  5009. if c.header_ == nil {
  5010. c.header_ = make(http.Header)
  5011. }
  5012. return c.header_
  5013. }
  5014. func (c *AccountsContainersTagsListCall) doRequest(alt string) (*http.Response, error) {
  5015. reqHeaders := make(http.Header)
  5016. for k, v := range c.header_ {
  5017. reqHeaders[k] = v
  5018. }
  5019. reqHeaders.Set("User-Agent", c.s.userAgent())
  5020. if c.ifNoneMatch_ != "" {
  5021. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5022. }
  5023. var body io.Reader = nil
  5024. c.urlParams_.Set("alt", alt)
  5025. c.urlParams_.Set("prettyPrint", "false")
  5026. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags")
  5027. urls += "?" + c.urlParams_.Encode()
  5028. req, err := http.NewRequest("GET", urls, body)
  5029. if err != nil {
  5030. return nil, err
  5031. }
  5032. req.Header = reqHeaders
  5033. googleapi.Expand(req.URL, map[string]string{
  5034. "accountId": c.accountId,
  5035. "containerId": c.containerId,
  5036. })
  5037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5038. }
  5039. // Do executes the "tagmanager.accounts.containers.tags.list" call.
  5040. // Exactly one of *ListTagsResponse or error will be non-nil. Any
  5041. // non-2xx status code is an error. Response headers are in either
  5042. // *ListTagsResponse.ServerResponse.Header or (if a response was
  5043. // returned at all) in error.(*googleapi.Error).Header. Use
  5044. // googleapi.IsNotModified to check whether the returned error was
  5045. // because http.StatusNotModified was returned.
  5046. func (c *AccountsContainersTagsListCall) Do(opts ...googleapi.CallOption) (*ListTagsResponse, error) {
  5047. gensupport.SetOptions(c.urlParams_, opts...)
  5048. res, err := c.doRequest("json")
  5049. if res != nil && res.StatusCode == http.StatusNotModified {
  5050. if res.Body != nil {
  5051. res.Body.Close()
  5052. }
  5053. return nil, &googleapi.Error{
  5054. Code: res.StatusCode,
  5055. Header: res.Header,
  5056. }
  5057. }
  5058. if err != nil {
  5059. return nil, err
  5060. }
  5061. defer googleapi.CloseBody(res)
  5062. if err := googleapi.CheckResponse(res); err != nil {
  5063. return nil, err
  5064. }
  5065. ret := &ListTagsResponse{
  5066. ServerResponse: googleapi.ServerResponse{
  5067. Header: res.Header,
  5068. HTTPStatusCode: res.StatusCode,
  5069. },
  5070. }
  5071. target := &ret
  5072. if err := gensupport.DecodeResponse(target, res); err != nil {
  5073. return nil, err
  5074. }
  5075. return ret, nil
  5076. // {
  5077. // "description": "Lists all GTM Tags of a Container.",
  5078. // "httpMethod": "GET",
  5079. // "id": "tagmanager.accounts.containers.tags.list",
  5080. // "parameterOrder": [
  5081. // "accountId",
  5082. // "containerId"
  5083. // ],
  5084. // "parameters": {
  5085. // "accountId": {
  5086. // "description": "The GTM Account ID.",
  5087. // "location": "path",
  5088. // "required": true,
  5089. // "type": "string"
  5090. // },
  5091. // "containerId": {
  5092. // "description": "The GTM Container ID.",
  5093. // "location": "path",
  5094. // "required": true,
  5095. // "type": "string"
  5096. // }
  5097. // },
  5098. // "path": "accounts/{accountId}/containers/{containerId}/tags",
  5099. // "response": {
  5100. // "$ref": "ListTagsResponse"
  5101. // },
  5102. // "scopes": [
  5103. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  5104. // "https://www.googleapis.com/auth/tagmanager.readonly"
  5105. // ]
  5106. // }
  5107. }
  5108. // method id "tagmanager.accounts.containers.tags.update":
  5109. type AccountsContainersTagsUpdateCall struct {
  5110. s *Service
  5111. accountId string
  5112. containerId string
  5113. tagId string
  5114. tag *Tag
  5115. urlParams_ gensupport.URLParams
  5116. ctx_ context.Context
  5117. header_ http.Header
  5118. }
  5119. // Update: Updates a GTM Tag.
  5120. func (r *AccountsContainersTagsService) Update(accountId string, containerId string, tagId string, tag *Tag) *AccountsContainersTagsUpdateCall {
  5121. c := &AccountsContainersTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5122. c.accountId = accountId
  5123. c.containerId = containerId
  5124. c.tagId = tagId
  5125. c.tag = tag
  5126. return c
  5127. }
  5128. // Fingerprint sets the optional parameter "fingerprint": When provided,
  5129. // this fingerprint must match the fingerprint of the tag in storage.
  5130. func (c *AccountsContainersTagsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersTagsUpdateCall {
  5131. c.urlParams_.Set("fingerprint", fingerprint)
  5132. return c
  5133. }
  5134. // Fields allows partial responses to be retrieved. See
  5135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5136. // for more information.
  5137. func (c *AccountsContainersTagsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersTagsUpdateCall {
  5138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5139. return c
  5140. }
  5141. // Context sets the context to be used in this call's Do method. Any
  5142. // pending HTTP request will be aborted if the provided context is
  5143. // canceled.
  5144. func (c *AccountsContainersTagsUpdateCall) Context(ctx context.Context) *AccountsContainersTagsUpdateCall {
  5145. c.ctx_ = ctx
  5146. return c
  5147. }
  5148. // Header returns an http.Header that can be modified by the caller to
  5149. // add HTTP headers to the request.
  5150. func (c *AccountsContainersTagsUpdateCall) Header() http.Header {
  5151. if c.header_ == nil {
  5152. c.header_ = make(http.Header)
  5153. }
  5154. return c.header_
  5155. }
  5156. func (c *AccountsContainersTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5157. reqHeaders := make(http.Header)
  5158. for k, v := range c.header_ {
  5159. reqHeaders[k] = v
  5160. }
  5161. reqHeaders.Set("User-Agent", c.s.userAgent())
  5162. var body io.Reader = nil
  5163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag)
  5164. if err != nil {
  5165. return nil, err
  5166. }
  5167. reqHeaders.Set("Content-Type", "application/json")
  5168. c.urlParams_.Set("alt", alt)
  5169. c.urlParams_.Set("prettyPrint", "false")
  5170. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/tags/{tagId}")
  5171. urls += "?" + c.urlParams_.Encode()
  5172. req, err := http.NewRequest("PUT", urls, body)
  5173. if err != nil {
  5174. return nil, err
  5175. }
  5176. req.Header = reqHeaders
  5177. googleapi.Expand(req.URL, map[string]string{
  5178. "accountId": c.accountId,
  5179. "containerId": c.containerId,
  5180. "tagId": c.tagId,
  5181. })
  5182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5183. }
  5184. // Do executes the "tagmanager.accounts.containers.tags.update" call.
  5185. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  5186. // is an error. Response headers are in either
  5187. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  5188. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5189. // whether the returned error was because http.StatusNotModified was
  5190. // returned.
  5191. func (c *AccountsContainersTagsUpdateCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  5192. gensupport.SetOptions(c.urlParams_, opts...)
  5193. res, err := c.doRequest("json")
  5194. if res != nil && res.StatusCode == http.StatusNotModified {
  5195. if res.Body != nil {
  5196. res.Body.Close()
  5197. }
  5198. return nil, &googleapi.Error{
  5199. Code: res.StatusCode,
  5200. Header: res.Header,
  5201. }
  5202. }
  5203. if err != nil {
  5204. return nil, err
  5205. }
  5206. defer googleapi.CloseBody(res)
  5207. if err := googleapi.CheckResponse(res); err != nil {
  5208. return nil, err
  5209. }
  5210. ret := &Tag{
  5211. ServerResponse: googleapi.ServerResponse{
  5212. Header: res.Header,
  5213. HTTPStatusCode: res.StatusCode,
  5214. },
  5215. }
  5216. target := &ret
  5217. if err := gensupport.DecodeResponse(target, res); err != nil {
  5218. return nil, err
  5219. }
  5220. return ret, nil
  5221. // {
  5222. // "description": "Updates a GTM Tag.",
  5223. // "httpMethod": "PUT",
  5224. // "id": "tagmanager.accounts.containers.tags.update",
  5225. // "parameterOrder": [
  5226. // "accountId",
  5227. // "containerId",
  5228. // "tagId"
  5229. // ],
  5230. // "parameters": {
  5231. // "accountId": {
  5232. // "description": "The GTM Account ID.",
  5233. // "location": "path",
  5234. // "required": true,
  5235. // "type": "string"
  5236. // },
  5237. // "containerId": {
  5238. // "description": "The GTM Container ID.",
  5239. // "location": "path",
  5240. // "required": true,
  5241. // "type": "string"
  5242. // },
  5243. // "fingerprint": {
  5244. // "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.",
  5245. // "location": "query",
  5246. // "type": "string"
  5247. // },
  5248. // "tagId": {
  5249. // "description": "The GTM Tag ID.",
  5250. // "location": "path",
  5251. // "required": true,
  5252. // "type": "string"
  5253. // }
  5254. // },
  5255. // "path": "accounts/{accountId}/containers/{containerId}/tags/{tagId}",
  5256. // "request": {
  5257. // "$ref": "Tag"
  5258. // },
  5259. // "response": {
  5260. // "$ref": "Tag"
  5261. // },
  5262. // "scopes": [
  5263. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5264. // ]
  5265. // }
  5266. }
  5267. // method id "tagmanager.accounts.containers.triggers.create":
  5268. type AccountsContainersTriggersCreateCall struct {
  5269. s *Service
  5270. accountId string
  5271. containerId string
  5272. trigger *Trigger
  5273. urlParams_ gensupport.URLParams
  5274. ctx_ context.Context
  5275. header_ http.Header
  5276. }
  5277. // Create: Creates a GTM Trigger.
  5278. func (r *AccountsContainersTriggersService) Create(accountId string, containerId string, trigger *Trigger) *AccountsContainersTriggersCreateCall {
  5279. c := &AccountsContainersTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5280. c.accountId = accountId
  5281. c.containerId = containerId
  5282. c.trigger = trigger
  5283. return c
  5284. }
  5285. // Fields allows partial responses to be retrieved. See
  5286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5287. // for more information.
  5288. func (c *AccountsContainersTriggersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersCreateCall {
  5289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5290. return c
  5291. }
  5292. // Context sets the context to be used in this call's Do method. Any
  5293. // pending HTTP request will be aborted if the provided context is
  5294. // canceled.
  5295. func (c *AccountsContainersTriggersCreateCall) Context(ctx context.Context) *AccountsContainersTriggersCreateCall {
  5296. c.ctx_ = ctx
  5297. return c
  5298. }
  5299. // Header returns an http.Header that can be modified by the caller to
  5300. // add HTTP headers to the request.
  5301. func (c *AccountsContainersTriggersCreateCall) Header() http.Header {
  5302. if c.header_ == nil {
  5303. c.header_ = make(http.Header)
  5304. }
  5305. return c.header_
  5306. }
  5307. func (c *AccountsContainersTriggersCreateCall) doRequest(alt string) (*http.Response, error) {
  5308. reqHeaders := make(http.Header)
  5309. for k, v := range c.header_ {
  5310. reqHeaders[k] = v
  5311. }
  5312. reqHeaders.Set("User-Agent", c.s.userAgent())
  5313. var body io.Reader = nil
  5314. body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  5315. if err != nil {
  5316. return nil, err
  5317. }
  5318. reqHeaders.Set("Content-Type", "application/json")
  5319. c.urlParams_.Set("alt", alt)
  5320. c.urlParams_.Set("prettyPrint", "false")
  5321. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers")
  5322. urls += "?" + c.urlParams_.Encode()
  5323. req, err := http.NewRequest("POST", urls, body)
  5324. if err != nil {
  5325. return nil, err
  5326. }
  5327. req.Header = reqHeaders
  5328. googleapi.Expand(req.URL, map[string]string{
  5329. "accountId": c.accountId,
  5330. "containerId": c.containerId,
  5331. })
  5332. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5333. }
  5334. // Do executes the "tagmanager.accounts.containers.triggers.create" call.
  5335. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  5336. // code is an error. Response headers are in either
  5337. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  5338. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5339. // check whether the returned error was because http.StatusNotModified
  5340. // was returned.
  5341. func (c *AccountsContainersTriggersCreateCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  5342. gensupport.SetOptions(c.urlParams_, opts...)
  5343. res, err := c.doRequest("json")
  5344. if res != nil && res.StatusCode == http.StatusNotModified {
  5345. if res.Body != nil {
  5346. res.Body.Close()
  5347. }
  5348. return nil, &googleapi.Error{
  5349. Code: res.StatusCode,
  5350. Header: res.Header,
  5351. }
  5352. }
  5353. if err != nil {
  5354. return nil, err
  5355. }
  5356. defer googleapi.CloseBody(res)
  5357. if err := googleapi.CheckResponse(res); err != nil {
  5358. return nil, err
  5359. }
  5360. ret := &Trigger{
  5361. ServerResponse: googleapi.ServerResponse{
  5362. Header: res.Header,
  5363. HTTPStatusCode: res.StatusCode,
  5364. },
  5365. }
  5366. target := &ret
  5367. if err := gensupport.DecodeResponse(target, res); err != nil {
  5368. return nil, err
  5369. }
  5370. return ret, nil
  5371. // {
  5372. // "description": "Creates a GTM Trigger.",
  5373. // "httpMethod": "POST",
  5374. // "id": "tagmanager.accounts.containers.triggers.create",
  5375. // "parameterOrder": [
  5376. // "accountId",
  5377. // "containerId"
  5378. // ],
  5379. // "parameters": {
  5380. // "accountId": {
  5381. // "description": "The GTM Account ID.",
  5382. // "location": "path",
  5383. // "required": true,
  5384. // "type": "string"
  5385. // },
  5386. // "containerId": {
  5387. // "description": "The GTM Container ID.",
  5388. // "location": "path",
  5389. // "required": true,
  5390. // "type": "string"
  5391. // }
  5392. // },
  5393. // "path": "accounts/{accountId}/containers/{containerId}/triggers",
  5394. // "request": {
  5395. // "$ref": "Trigger"
  5396. // },
  5397. // "response": {
  5398. // "$ref": "Trigger"
  5399. // },
  5400. // "scopes": [
  5401. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5402. // ]
  5403. // }
  5404. }
  5405. // method id "tagmanager.accounts.containers.triggers.delete":
  5406. type AccountsContainersTriggersDeleteCall struct {
  5407. s *Service
  5408. accountId string
  5409. containerId string
  5410. triggerId string
  5411. urlParams_ gensupport.URLParams
  5412. ctx_ context.Context
  5413. header_ http.Header
  5414. }
  5415. // Delete: Deletes a GTM Trigger.
  5416. func (r *AccountsContainersTriggersService) Delete(accountId string, containerId string, triggerId string) *AccountsContainersTriggersDeleteCall {
  5417. c := &AccountsContainersTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5418. c.accountId = accountId
  5419. c.containerId = containerId
  5420. c.triggerId = triggerId
  5421. return c
  5422. }
  5423. // Fields allows partial responses to be retrieved. See
  5424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5425. // for more information.
  5426. func (c *AccountsContainersTriggersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersDeleteCall {
  5427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5428. return c
  5429. }
  5430. // Context sets the context to be used in this call's Do method. Any
  5431. // pending HTTP request will be aborted if the provided context is
  5432. // canceled.
  5433. func (c *AccountsContainersTriggersDeleteCall) Context(ctx context.Context) *AccountsContainersTriggersDeleteCall {
  5434. c.ctx_ = ctx
  5435. return c
  5436. }
  5437. // Header returns an http.Header that can be modified by the caller to
  5438. // add HTTP headers to the request.
  5439. func (c *AccountsContainersTriggersDeleteCall) Header() http.Header {
  5440. if c.header_ == nil {
  5441. c.header_ = make(http.Header)
  5442. }
  5443. return c.header_
  5444. }
  5445. func (c *AccountsContainersTriggersDeleteCall) doRequest(alt string) (*http.Response, error) {
  5446. reqHeaders := make(http.Header)
  5447. for k, v := range c.header_ {
  5448. reqHeaders[k] = v
  5449. }
  5450. reqHeaders.Set("User-Agent", c.s.userAgent())
  5451. var body io.Reader = nil
  5452. c.urlParams_.Set("alt", alt)
  5453. c.urlParams_.Set("prettyPrint", "false")
  5454. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}")
  5455. urls += "?" + c.urlParams_.Encode()
  5456. req, err := http.NewRequest("DELETE", urls, body)
  5457. if err != nil {
  5458. return nil, err
  5459. }
  5460. req.Header = reqHeaders
  5461. googleapi.Expand(req.URL, map[string]string{
  5462. "accountId": c.accountId,
  5463. "containerId": c.containerId,
  5464. "triggerId": c.triggerId,
  5465. })
  5466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5467. }
  5468. // Do executes the "tagmanager.accounts.containers.triggers.delete" call.
  5469. func (c *AccountsContainersTriggersDeleteCall) Do(opts ...googleapi.CallOption) error {
  5470. gensupport.SetOptions(c.urlParams_, opts...)
  5471. res, err := c.doRequest("json")
  5472. if err != nil {
  5473. return err
  5474. }
  5475. defer googleapi.CloseBody(res)
  5476. if err := googleapi.CheckResponse(res); err != nil {
  5477. return err
  5478. }
  5479. return nil
  5480. // {
  5481. // "description": "Deletes a GTM Trigger.",
  5482. // "httpMethod": "DELETE",
  5483. // "id": "tagmanager.accounts.containers.triggers.delete",
  5484. // "parameterOrder": [
  5485. // "accountId",
  5486. // "containerId",
  5487. // "triggerId"
  5488. // ],
  5489. // "parameters": {
  5490. // "accountId": {
  5491. // "description": "The GTM Account ID.",
  5492. // "location": "path",
  5493. // "required": true,
  5494. // "type": "string"
  5495. // },
  5496. // "containerId": {
  5497. // "description": "The GTM Container ID.",
  5498. // "location": "path",
  5499. // "required": true,
  5500. // "type": "string"
  5501. // },
  5502. // "triggerId": {
  5503. // "description": "The GTM Trigger ID.",
  5504. // "location": "path",
  5505. // "required": true,
  5506. // "type": "string"
  5507. // }
  5508. // },
  5509. // "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}",
  5510. // "scopes": [
  5511. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5512. // ]
  5513. // }
  5514. }
  5515. // method id "tagmanager.accounts.containers.triggers.get":
  5516. type AccountsContainersTriggersGetCall struct {
  5517. s *Service
  5518. accountId string
  5519. containerId string
  5520. triggerId string
  5521. urlParams_ gensupport.URLParams
  5522. ifNoneMatch_ string
  5523. ctx_ context.Context
  5524. header_ http.Header
  5525. }
  5526. // Get: Gets a GTM Trigger.
  5527. func (r *AccountsContainersTriggersService) Get(accountId string, containerId string, triggerId string) *AccountsContainersTriggersGetCall {
  5528. c := &AccountsContainersTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5529. c.accountId = accountId
  5530. c.containerId = containerId
  5531. c.triggerId = triggerId
  5532. return c
  5533. }
  5534. // Fields allows partial responses to be retrieved. See
  5535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5536. // for more information.
  5537. func (c *AccountsContainersTriggersGetCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersGetCall {
  5538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5539. return c
  5540. }
  5541. // IfNoneMatch sets the optional parameter which makes the operation
  5542. // fail if the object's ETag matches the given value. This is useful for
  5543. // getting updates only after the object has changed since the last
  5544. // request. Use googleapi.IsNotModified to check whether the response
  5545. // error from Do is the result of In-None-Match.
  5546. func (c *AccountsContainersTriggersGetCall) IfNoneMatch(entityTag string) *AccountsContainersTriggersGetCall {
  5547. c.ifNoneMatch_ = entityTag
  5548. return c
  5549. }
  5550. // Context sets the context to be used in this call's Do method. Any
  5551. // pending HTTP request will be aborted if the provided context is
  5552. // canceled.
  5553. func (c *AccountsContainersTriggersGetCall) Context(ctx context.Context) *AccountsContainersTriggersGetCall {
  5554. c.ctx_ = ctx
  5555. return c
  5556. }
  5557. // Header returns an http.Header that can be modified by the caller to
  5558. // add HTTP headers to the request.
  5559. func (c *AccountsContainersTriggersGetCall) Header() http.Header {
  5560. if c.header_ == nil {
  5561. c.header_ = make(http.Header)
  5562. }
  5563. return c.header_
  5564. }
  5565. func (c *AccountsContainersTriggersGetCall) doRequest(alt string) (*http.Response, error) {
  5566. reqHeaders := make(http.Header)
  5567. for k, v := range c.header_ {
  5568. reqHeaders[k] = v
  5569. }
  5570. reqHeaders.Set("User-Agent", c.s.userAgent())
  5571. if c.ifNoneMatch_ != "" {
  5572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5573. }
  5574. var body io.Reader = nil
  5575. c.urlParams_.Set("alt", alt)
  5576. c.urlParams_.Set("prettyPrint", "false")
  5577. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}")
  5578. urls += "?" + c.urlParams_.Encode()
  5579. req, err := http.NewRequest("GET", urls, body)
  5580. if err != nil {
  5581. return nil, err
  5582. }
  5583. req.Header = reqHeaders
  5584. googleapi.Expand(req.URL, map[string]string{
  5585. "accountId": c.accountId,
  5586. "containerId": c.containerId,
  5587. "triggerId": c.triggerId,
  5588. })
  5589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5590. }
  5591. // Do executes the "tagmanager.accounts.containers.triggers.get" call.
  5592. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  5593. // code is an error. Response headers are in either
  5594. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  5595. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5596. // check whether the returned error was because http.StatusNotModified
  5597. // was returned.
  5598. func (c *AccountsContainersTriggersGetCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  5599. gensupport.SetOptions(c.urlParams_, opts...)
  5600. res, err := c.doRequest("json")
  5601. if res != nil && res.StatusCode == http.StatusNotModified {
  5602. if res.Body != nil {
  5603. res.Body.Close()
  5604. }
  5605. return nil, &googleapi.Error{
  5606. Code: res.StatusCode,
  5607. Header: res.Header,
  5608. }
  5609. }
  5610. if err != nil {
  5611. return nil, err
  5612. }
  5613. defer googleapi.CloseBody(res)
  5614. if err := googleapi.CheckResponse(res); err != nil {
  5615. return nil, err
  5616. }
  5617. ret := &Trigger{
  5618. ServerResponse: googleapi.ServerResponse{
  5619. Header: res.Header,
  5620. HTTPStatusCode: res.StatusCode,
  5621. },
  5622. }
  5623. target := &ret
  5624. if err := gensupport.DecodeResponse(target, res); err != nil {
  5625. return nil, err
  5626. }
  5627. return ret, nil
  5628. // {
  5629. // "description": "Gets a GTM Trigger.",
  5630. // "httpMethod": "GET",
  5631. // "id": "tagmanager.accounts.containers.triggers.get",
  5632. // "parameterOrder": [
  5633. // "accountId",
  5634. // "containerId",
  5635. // "triggerId"
  5636. // ],
  5637. // "parameters": {
  5638. // "accountId": {
  5639. // "description": "The GTM Account ID.",
  5640. // "location": "path",
  5641. // "required": true,
  5642. // "type": "string"
  5643. // },
  5644. // "containerId": {
  5645. // "description": "The GTM Container ID.",
  5646. // "location": "path",
  5647. // "required": true,
  5648. // "type": "string"
  5649. // },
  5650. // "triggerId": {
  5651. // "description": "The GTM Trigger ID.",
  5652. // "location": "path",
  5653. // "required": true,
  5654. // "type": "string"
  5655. // }
  5656. // },
  5657. // "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}",
  5658. // "response": {
  5659. // "$ref": "Trigger"
  5660. // },
  5661. // "scopes": [
  5662. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  5663. // "https://www.googleapis.com/auth/tagmanager.readonly"
  5664. // ]
  5665. // }
  5666. }
  5667. // method id "tagmanager.accounts.containers.triggers.list":
  5668. type AccountsContainersTriggersListCall struct {
  5669. s *Service
  5670. accountId string
  5671. containerId string
  5672. urlParams_ gensupport.URLParams
  5673. ifNoneMatch_ string
  5674. ctx_ context.Context
  5675. header_ http.Header
  5676. }
  5677. // List: Lists all GTM Triggers of a Container.
  5678. func (r *AccountsContainersTriggersService) List(accountId string, containerId string) *AccountsContainersTriggersListCall {
  5679. c := &AccountsContainersTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5680. c.accountId = accountId
  5681. c.containerId = containerId
  5682. return c
  5683. }
  5684. // Fields allows partial responses to be retrieved. See
  5685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5686. // for more information.
  5687. func (c *AccountsContainersTriggersListCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersListCall {
  5688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5689. return c
  5690. }
  5691. // IfNoneMatch sets the optional parameter which makes the operation
  5692. // fail if the object's ETag matches the given value. This is useful for
  5693. // getting updates only after the object has changed since the last
  5694. // request. Use googleapi.IsNotModified to check whether the response
  5695. // error from Do is the result of In-None-Match.
  5696. func (c *AccountsContainersTriggersListCall) IfNoneMatch(entityTag string) *AccountsContainersTriggersListCall {
  5697. c.ifNoneMatch_ = entityTag
  5698. return c
  5699. }
  5700. // Context sets the context to be used in this call's Do method. Any
  5701. // pending HTTP request will be aborted if the provided context is
  5702. // canceled.
  5703. func (c *AccountsContainersTriggersListCall) Context(ctx context.Context) *AccountsContainersTriggersListCall {
  5704. c.ctx_ = ctx
  5705. return c
  5706. }
  5707. // Header returns an http.Header that can be modified by the caller to
  5708. // add HTTP headers to the request.
  5709. func (c *AccountsContainersTriggersListCall) Header() http.Header {
  5710. if c.header_ == nil {
  5711. c.header_ = make(http.Header)
  5712. }
  5713. return c.header_
  5714. }
  5715. func (c *AccountsContainersTriggersListCall) doRequest(alt string) (*http.Response, error) {
  5716. reqHeaders := make(http.Header)
  5717. for k, v := range c.header_ {
  5718. reqHeaders[k] = v
  5719. }
  5720. reqHeaders.Set("User-Agent", c.s.userAgent())
  5721. if c.ifNoneMatch_ != "" {
  5722. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5723. }
  5724. var body io.Reader = nil
  5725. c.urlParams_.Set("alt", alt)
  5726. c.urlParams_.Set("prettyPrint", "false")
  5727. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers")
  5728. urls += "?" + c.urlParams_.Encode()
  5729. req, err := http.NewRequest("GET", urls, body)
  5730. if err != nil {
  5731. return nil, err
  5732. }
  5733. req.Header = reqHeaders
  5734. googleapi.Expand(req.URL, map[string]string{
  5735. "accountId": c.accountId,
  5736. "containerId": c.containerId,
  5737. })
  5738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5739. }
  5740. // Do executes the "tagmanager.accounts.containers.triggers.list" call.
  5741. // Exactly one of *ListTriggersResponse or error will be non-nil. Any
  5742. // non-2xx status code is an error. Response headers are in either
  5743. // *ListTriggersResponse.ServerResponse.Header or (if a response was
  5744. // returned at all) in error.(*googleapi.Error).Header. Use
  5745. // googleapi.IsNotModified to check whether the returned error was
  5746. // because http.StatusNotModified was returned.
  5747. func (c *AccountsContainersTriggersListCall) Do(opts ...googleapi.CallOption) (*ListTriggersResponse, error) {
  5748. gensupport.SetOptions(c.urlParams_, opts...)
  5749. res, err := c.doRequest("json")
  5750. if res != nil && res.StatusCode == http.StatusNotModified {
  5751. if res.Body != nil {
  5752. res.Body.Close()
  5753. }
  5754. return nil, &googleapi.Error{
  5755. Code: res.StatusCode,
  5756. Header: res.Header,
  5757. }
  5758. }
  5759. if err != nil {
  5760. return nil, err
  5761. }
  5762. defer googleapi.CloseBody(res)
  5763. if err := googleapi.CheckResponse(res); err != nil {
  5764. return nil, err
  5765. }
  5766. ret := &ListTriggersResponse{
  5767. ServerResponse: googleapi.ServerResponse{
  5768. Header: res.Header,
  5769. HTTPStatusCode: res.StatusCode,
  5770. },
  5771. }
  5772. target := &ret
  5773. if err := gensupport.DecodeResponse(target, res); err != nil {
  5774. return nil, err
  5775. }
  5776. return ret, nil
  5777. // {
  5778. // "description": "Lists all GTM Triggers of a Container.",
  5779. // "httpMethod": "GET",
  5780. // "id": "tagmanager.accounts.containers.triggers.list",
  5781. // "parameterOrder": [
  5782. // "accountId",
  5783. // "containerId"
  5784. // ],
  5785. // "parameters": {
  5786. // "accountId": {
  5787. // "description": "The GTM Account ID.",
  5788. // "location": "path",
  5789. // "required": true,
  5790. // "type": "string"
  5791. // },
  5792. // "containerId": {
  5793. // "description": "The GTM Container ID.",
  5794. // "location": "path",
  5795. // "required": true,
  5796. // "type": "string"
  5797. // }
  5798. // },
  5799. // "path": "accounts/{accountId}/containers/{containerId}/triggers",
  5800. // "response": {
  5801. // "$ref": "ListTriggersResponse"
  5802. // },
  5803. // "scopes": [
  5804. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  5805. // "https://www.googleapis.com/auth/tagmanager.readonly"
  5806. // ]
  5807. // }
  5808. }
  5809. // method id "tagmanager.accounts.containers.triggers.update":
  5810. type AccountsContainersTriggersUpdateCall struct {
  5811. s *Service
  5812. accountId string
  5813. containerId string
  5814. triggerId string
  5815. trigger *Trigger
  5816. urlParams_ gensupport.URLParams
  5817. ctx_ context.Context
  5818. header_ http.Header
  5819. }
  5820. // Update: Updates a GTM Trigger.
  5821. func (r *AccountsContainersTriggersService) Update(accountId string, containerId string, triggerId string, trigger *Trigger) *AccountsContainersTriggersUpdateCall {
  5822. c := &AccountsContainersTriggersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5823. c.accountId = accountId
  5824. c.containerId = containerId
  5825. c.triggerId = triggerId
  5826. c.trigger = trigger
  5827. return c
  5828. }
  5829. // Fingerprint sets the optional parameter "fingerprint": When provided,
  5830. // this fingerprint must match the fingerprint of the trigger in
  5831. // storage.
  5832. func (c *AccountsContainersTriggersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersTriggersUpdateCall {
  5833. c.urlParams_.Set("fingerprint", fingerprint)
  5834. return c
  5835. }
  5836. // Fields allows partial responses to be retrieved. See
  5837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5838. // for more information.
  5839. func (c *AccountsContainersTriggersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersTriggersUpdateCall {
  5840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5841. return c
  5842. }
  5843. // Context sets the context to be used in this call's Do method. Any
  5844. // pending HTTP request will be aborted if the provided context is
  5845. // canceled.
  5846. func (c *AccountsContainersTriggersUpdateCall) Context(ctx context.Context) *AccountsContainersTriggersUpdateCall {
  5847. c.ctx_ = ctx
  5848. return c
  5849. }
  5850. // Header returns an http.Header that can be modified by the caller to
  5851. // add HTTP headers to the request.
  5852. func (c *AccountsContainersTriggersUpdateCall) Header() http.Header {
  5853. if c.header_ == nil {
  5854. c.header_ = make(http.Header)
  5855. }
  5856. return c.header_
  5857. }
  5858. func (c *AccountsContainersTriggersUpdateCall) doRequest(alt string) (*http.Response, error) {
  5859. reqHeaders := make(http.Header)
  5860. for k, v := range c.header_ {
  5861. reqHeaders[k] = v
  5862. }
  5863. reqHeaders.Set("User-Agent", c.s.userAgent())
  5864. var body io.Reader = nil
  5865. body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  5866. if err != nil {
  5867. return nil, err
  5868. }
  5869. reqHeaders.Set("Content-Type", "application/json")
  5870. c.urlParams_.Set("alt", alt)
  5871. c.urlParams_.Set("prettyPrint", "false")
  5872. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}")
  5873. urls += "?" + c.urlParams_.Encode()
  5874. req, err := http.NewRequest("PUT", urls, body)
  5875. if err != nil {
  5876. return nil, err
  5877. }
  5878. req.Header = reqHeaders
  5879. googleapi.Expand(req.URL, map[string]string{
  5880. "accountId": c.accountId,
  5881. "containerId": c.containerId,
  5882. "triggerId": c.triggerId,
  5883. })
  5884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5885. }
  5886. // Do executes the "tagmanager.accounts.containers.triggers.update" call.
  5887. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  5888. // code is an error. Response headers are in either
  5889. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  5890. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5891. // check whether the returned error was because http.StatusNotModified
  5892. // was returned.
  5893. func (c *AccountsContainersTriggersUpdateCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  5894. gensupport.SetOptions(c.urlParams_, opts...)
  5895. res, err := c.doRequest("json")
  5896. if res != nil && res.StatusCode == http.StatusNotModified {
  5897. if res.Body != nil {
  5898. res.Body.Close()
  5899. }
  5900. return nil, &googleapi.Error{
  5901. Code: res.StatusCode,
  5902. Header: res.Header,
  5903. }
  5904. }
  5905. if err != nil {
  5906. return nil, err
  5907. }
  5908. defer googleapi.CloseBody(res)
  5909. if err := googleapi.CheckResponse(res); err != nil {
  5910. return nil, err
  5911. }
  5912. ret := &Trigger{
  5913. ServerResponse: googleapi.ServerResponse{
  5914. Header: res.Header,
  5915. HTTPStatusCode: res.StatusCode,
  5916. },
  5917. }
  5918. target := &ret
  5919. if err := gensupport.DecodeResponse(target, res); err != nil {
  5920. return nil, err
  5921. }
  5922. return ret, nil
  5923. // {
  5924. // "description": "Updates a GTM Trigger.",
  5925. // "httpMethod": "PUT",
  5926. // "id": "tagmanager.accounts.containers.triggers.update",
  5927. // "parameterOrder": [
  5928. // "accountId",
  5929. // "containerId",
  5930. // "triggerId"
  5931. // ],
  5932. // "parameters": {
  5933. // "accountId": {
  5934. // "description": "The GTM Account ID.",
  5935. // "location": "path",
  5936. // "required": true,
  5937. // "type": "string"
  5938. // },
  5939. // "containerId": {
  5940. // "description": "The GTM Container ID.",
  5941. // "location": "path",
  5942. // "required": true,
  5943. // "type": "string"
  5944. // },
  5945. // "fingerprint": {
  5946. // "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.",
  5947. // "location": "query",
  5948. // "type": "string"
  5949. // },
  5950. // "triggerId": {
  5951. // "description": "The GTM Trigger ID.",
  5952. // "location": "path",
  5953. // "required": true,
  5954. // "type": "string"
  5955. // }
  5956. // },
  5957. // "path": "accounts/{accountId}/containers/{containerId}/triggers/{triggerId}",
  5958. // "request": {
  5959. // "$ref": "Trigger"
  5960. // },
  5961. // "response": {
  5962. // "$ref": "Trigger"
  5963. // },
  5964. // "scopes": [
  5965. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5966. // ]
  5967. // }
  5968. }
  5969. // method id "tagmanager.accounts.containers.variables.create":
  5970. type AccountsContainersVariablesCreateCall struct {
  5971. s *Service
  5972. accountId string
  5973. containerId string
  5974. variable *Variable
  5975. urlParams_ gensupport.URLParams
  5976. ctx_ context.Context
  5977. header_ http.Header
  5978. }
  5979. // Create: Creates a GTM Variable.
  5980. func (r *AccountsContainersVariablesService) Create(accountId string, containerId string, variable *Variable) *AccountsContainersVariablesCreateCall {
  5981. c := &AccountsContainersVariablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5982. c.accountId = accountId
  5983. c.containerId = containerId
  5984. c.variable = variable
  5985. return c
  5986. }
  5987. // Fields allows partial responses to be retrieved. See
  5988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5989. // for more information.
  5990. func (c *AccountsContainersVariablesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesCreateCall {
  5991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5992. return c
  5993. }
  5994. // Context sets the context to be used in this call's Do method. Any
  5995. // pending HTTP request will be aborted if the provided context is
  5996. // canceled.
  5997. func (c *AccountsContainersVariablesCreateCall) Context(ctx context.Context) *AccountsContainersVariablesCreateCall {
  5998. c.ctx_ = ctx
  5999. return c
  6000. }
  6001. // Header returns an http.Header that can be modified by the caller to
  6002. // add HTTP headers to the request.
  6003. func (c *AccountsContainersVariablesCreateCall) Header() http.Header {
  6004. if c.header_ == nil {
  6005. c.header_ = make(http.Header)
  6006. }
  6007. return c.header_
  6008. }
  6009. func (c *AccountsContainersVariablesCreateCall) doRequest(alt string) (*http.Response, error) {
  6010. reqHeaders := make(http.Header)
  6011. for k, v := range c.header_ {
  6012. reqHeaders[k] = v
  6013. }
  6014. reqHeaders.Set("User-Agent", c.s.userAgent())
  6015. var body io.Reader = nil
  6016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  6017. if err != nil {
  6018. return nil, err
  6019. }
  6020. reqHeaders.Set("Content-Type", "application/json")
  6021. c.urlParams_.Set("alt", alt)
  6022. c.urlParams_.Set("prettyPrint", "false")
  6023. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables")
  6024. urls += "?" + c.urlParams_.Encode()
  6025. req, err := http.NewRequest("POST", urls, body)
  6026. if err != nil {
  6027. return nil, err
  6028. }
  6029. req.Header = reqHeaders
  6030. googleapi.Expand(req.URL, map[string]string{
  6031. "accountId": c.accountId,
  6032. "containerId": c.containerId,
  6033. })
  6034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6035. }
  6036. // Do executes the "tagmanager.accounts.containers.variables.create" call.
  6037. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  6038. // code is an error. Response headers are in either
  6039. // *Variable.ServerResponse.Header or (if a response was returned at
  6040. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6041. // to check whether the returned error was because
  6042. // http.StatusNotModified was returned.
  6043. func (c *AccountsContainersVariablesCreateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  6044. gensupport.SetOptions(c.urlParams_, opts...)
  6045. res, err := c.doRequest("json")
  6046. if res != nil && res.StatusCode == http.StatusNotModified {
  6047. if res.Body != nil {
  6048. res.Body.Close()
  6049. }
  6050. return nil, &googleapi.Error{
  6051. Code: res.StatusCode,
  6052. Header: res.Header,
  6053. }
  6054. }
  6055. if err != nil {
  6056. return nil, err
  6057. }
  6058. defer googleapi.CloseBody(res)
  6059. if err := googleapi.CheckResponse(res); err != nil {
  6060. return nil, err
  6061. }
  6062. ret := &Variable{
  6063. ServerResponse: googleapi.ServerResponse{
  6064. Header: res.Header,
  6065. HTTPStatusCode: res.StatusCode,
  6066. },
  6067. }
  6068. target := &ret
  6069. if err := gensupport.DecodeResponse(target, res); err != nil {
  6070. return nil, err
  6071. }
  6072. return ret, nil
  6073. // {
  6074. // "description": "Creates a GTM Variable.",
  6075. // "httpMethod": "POST",
  6076. // "id": "tagmanager.accounts.containers.variables.create",
  6077. // "parameterOrder": [
  6078. // "accountId",
  6079. // "containerId"
  6080. // ],
  6081. // "parameters": {
  6082. // "accountId": {
  6083. // "description": "The GTM Account ID.",
  6084. // "location": "path",
  6085. // "required": true,
  6086. // "type": "string"
  6087. // },
  6088. // "containerId": {
  6089. // "description": "The GTM Container ID.",
  6090. // "location": "path",
  6091. // "required": true,
  6092. // "type": "string"
  6093. // }
  6094. // },
  6095. // "path": "accounts/{accountId}/containers/{containerId}/variables",
  6096. // "request": {
  6097. // "$ref": "Variable"
  6098. // },
  6099. // "response": {
  6100. // "$ref": "Variable"
  6101. // },
  6102. // "scopes": [
  6103. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6104. // ]
  6105. // }
  6106. }
  6107. // method id "tagmanager.accounts.containers.variables.delete":
  6108. type AccountsContainersVariablesDeleteCall struct {
  6109. s *Service
  6110. accountId string
  6111. containerId string
  6112. variableId string
  6113. urlParams_ gensupport.URLParams
  6114. ctx_ context.Context
  6115. header_ http.Header
  6116. }
  6117. // Delete: Deletes a GTM Variable.
  6118. func (r *AccountsContainersVariablesService) Delete(accountId string, containerId string, variableId string) *AccountsContainersVariablesDeleteCall {
  6119. c := &AccountsContainersVariablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6120. c.accountId = accountId
  6121. c.containerId = containerId
  6122. c.variableId = variableId
  6123. return c
  6124. }
  6125. // Fields allows partial responses to be retrieved. See
  6126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6127. // for more information.
  6128. func (c *AccountsContainersVariablesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesDeleteCall {
  6129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6130. return c
  6131. }
  6132. // Context sets the context to be used in this call's Do method. Any
  6133. // pending HTTP request will be aborted if the provided context is
  6134. // canceled.
  6135. func (c *AccountsContainersVariablesDeleteCall) Context(ctx context.Context) *AccountsContainersVariablesDeleteCall {
  6136. c.ctx_ = ctx
  6137. return c
  6138. }
  6139. // Header returns an http.Header that can be modified by the caller to
  6140. // add HTTP headers to the request.
  6141. func (c *AccountsContainersVariablesDeleteCall) Header() http.Header {
  6142. if c.header_ == nil {
  6143. c.header_ = make(http.Header)
  6144. }
  6145. return c.header_
  6146. }
  6147. func (c *AccountsContainersVariablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  6148. reqHeaders := make(http.Header)
  6149. for k, v := range c.header_ {
  6150. reqHeaders[k] = v
  6151. }
  6152. reqHeaders.Set("User-Agent", c.s.userAgent())
  6153. var body io.Reader = nil
  6154. c.urlParams_.Set("alt", alt)
  6155. c.urlParams_.Set("prettyPrint", "false")
  6156. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables/{variableId}")
  6157. urls += "?" + c.urlParams_.Encode()
  6158. req, err := http.NewRequest("DELETE", urls, body)
  6159. if err != nil {
  6160. return nil, err
  6161. }
  6162. req.Header = reqHeaders
  6163. googleapi.Expand(req.URL, map[string]string{
  6164. "accountId": c.accountId,
  6165. "containerId": c.containerId,
  6166. "variableId": c.variableId,
  6167. })
  6168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6169. }
  6170. // Do executes the "tagmanager.accounts.containers.variables.delete" call.
  6171. func (c *AccountsContainersVariablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  6172. gensupport.SetOptions(c.urlParams_, opts...)
  6173. res, err := c.doRequest("json")
  6174. if err != nil {
  6175. return err
  6176. }
  6177. defer googleapi.CloseBody(res)
  6178. if err := googleapi.CheckResponse(res); err != nil {
  6179. return err
  6180. }
  6181. return nil
  6182. // {
  6183. // "description": "Deletes a GTM Variable.",
  6184. // "httpMethod": "DELETE",
  6185. // "id": "tagmanager.accounts.containers.variables.delete",
  6186. // "parameterOrder": [
  6187. // "accountId",
  6188. // "containerId",
  6189. // "variableId"
  6190. // ],
  6191. // "parameters": {
  6192. // "accountId": {
  6193. // "description": "The GTM Account ID.",
  6194. // "location": "path",
  6195. // "required": true,
  6196. // "type": "string"
  6197. // },
  6198. // "containerId": {
  6199. // "description": "The GTM Container ID.",
  6200. // "location": "path",
  6201. // "required": true,
  6202. // "type": "string"
  6203. // },
  6204. // "variableId": {
  6205. // "description": "The GTM Variable ID.",
  6206. // "location": "path",
  6207. // "required": true,
  6208. // "type": "string"
  6209. // }
  6210. // },
  6211. // "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}",
  6212. // "scopes": [
  6213. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6214. // ]
  6215. // }
  6216. }
  6217. // method id "tagmanager.accounts.containers.variables.get":
  6218. type AccountsContainersVariablesGetCall struct {
  6219. s *Service
  6220. accountId string
  6221. containerId string
  6222. variableId string
  6223. urlParams_ gensupport.URLParams
  6224. ifNoneMatch_ string
  6225. ctx_ context.Context
  6226. header_ http.Header
  6227. }
  6228. // Get: Gets a GTM Variable.
  6229. func (r *AccountsContainersVariablesService) Get(accountId string, containerId string, variableId string) *AccountsContainersVariablesGetCall {
  6230. c := &AccountsContainersVariablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6231. c.accountId = accountId
  6232. c.containerId = containerId
  6233. c.variableId = variableId
  6234. return c
  6235. }
  6236. // Fields allows partial responses to be retrieved. See
  6237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6238. // for more information.
  6239. func (c *AccountsContainersVariablesGetCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesGetCall {
  6240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6241. return c
  6242. }
  6243. // IfNoneMatch sets the optional parameter which makes the operation
  6244. // fail if the object's ETag matches the given value. This is useful for
  6245. // getting updates only after the object has changed since the last
  6246. // request. Use googleapi.IsNotModified to check whether the response
  6247. // error from Do is the result of In-None-Match.
  6248. func (c *AccountsContainersVariablesGetCall) IfNoneMatch(entityTag string) *AccountsContainersVariablesGetCall {
  6249. c.ifNoneMatch_ = entityTag
  6250. return c
  6251. }
  6252. // Context sets the context to be used in this call's Do method. Any
  6253. // pending HTTP request will be aborted if the provided context is
  6254. // canceled.
  6255. func (c *AccountsContainersVariablesGetCall) Context(ctx context.Context) *AccountsContainersVariablesGetCall {
  6256. c.ctx_ = ctx
  6257. return c
  6258. }
  6259. // Header returns an http.Header that can be modified by the caller to
  6260. // add HTTP headers to the request.
  6261. func (c *AccountsContainersVariablesGetCall) Header() http.Header {
  6262. if c.header_ == nil {
  6263. c.header_ = make(http.Header)
  6264. }
  6265. return c.header_
  6266. }
  6267. func (c *AccountsContainersVariablesGetCall) doRequest(alt string) (*http.Response, error) {
  6268. reqHeaders := make(http.Header)
  6269. for k, v := range c.header_ {
  6270. reqHeaders[k] = v
  6271. }
  6272. reqHeaders.Set("User-Agent", c.s.userAgent())
  6273. if c.ifNoneMatch_ != "" {
  6274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6275. }
  6276. var body io.Reader = nil
  6277. c.urlParams_.Set("alt", alt)
  6278. c.urlParams_.Set("prettyPrint", "false")
  6279. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables/{variableId}")
  6280. urls += "?" + c.urlParams_.Encode()
  6281. req, err := http.NewRequest("GET", urls, body)
  6282. if err != nil {
  6283. return nil, err
  6284. }
  6285. req.Header = reqHeaders
  6286. googleapi.Expand(req.URL, map[string]string{
  6287. "accountId": c.accountId,
  6288. "containerId": c.containerId,
  6289. "variableId": c.variableId,
  6290. })
  6291. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6292. }
  6293. // Do executes the "tagmanager.accounts.containers.variables.get" call.
  6294. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  6295. // code is an error. Response headers are in either
  6296. // *Variable.ServerResponse.Header or (if a response was returned at
  6297. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6298. // to check whether the returned error was because
  6299. // http.StatusNotModified was returned.
  6300. func (c *AccountsContainersVariablesGetCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  6301. gensupport.SetOptions(c.urlParams_, opts...)
  6302. res, err := c.doRequest("json")
  6303. if res != nil && res.StatusCode == http.StatusNotModified {
  6304. if res.Body != nil {
  6305. res.Body.Close()
  6306. }
  6307. return nil, &googleapi.Error{
  6308. Code: res.StatusCode,
  6309. Header: res.Header,
  6310. }
  6311. }
  6312. if err != nil {
  6313. return nil, err
  6314. }
  6315. defer googleapi.CloseBody(res)
  6316. if err := googleapi.CheckResponse(res); err != nil {
  6317. return nil, err
  6318. }
  6319. ret := &Variable{
  6320. ServerResponse: googleapi.ServerResponse{
  6321. Header: res.Header,
  6322. HTTPStatusCode: res.StatusCode,
  6323. },
  6324. }
  6325. target := &ret
  6326. if err := gensupport.DecodeResponse(target, res); err != nil {
  6327. return nil, err
  6328. }
  6329. return ret, nil
  6330. // {
  6331. // "description": "Gets a GTM Variable.",
  6332. // "httpMethod": "GET",
  6333. // "id": "tagmanager.accounts.containers.variables.get",
  6334. // "parameterOrder": [
  6335. // "accountId",
  6336. // "containerId",
  6337. // "variableId"
  6338. // ],
  6339. // "parameters": {
  6340. // "accountId": {
  6341. // "description": "The GTM Account ID.",
  6342. // "location": "path",
  6343. // "required": true,
  6344. // "type": "string"
  6345. // },
  6346. // "containerId": {
  6347. // "description": "The GTM Container ID.",
  6348. // "location": "path",
  6349. // "required": true,
  6350. // "type": "string"
  6351. // },
  6352. // "variableId": {
  6353. // "description": "The GTM Variable ID.",
  6354. // "location": "path",
  6355. // "required": true,
  6356. // "type": "string"
  6357. // }
  6358. // },
  6359. // "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}",
  6360. // "response": {
  6361. // "$ref": "Variable"
  6362. // },
  6363. // "scopes": [
  6364. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6365. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6366. // ]
  6367. // }
  6368. }
  6369. // method id "tagmanager.accounts.containers.variables.list":
  6370. type AccountsContainersVariablesListCall struct {
  6371. s *Service
  6372. accountId string
  6373. containerId string
  6374. urlParams_ gensupport.URLParams
  6375. ifNoneMatch_ string
  6376. ctx_ context.Context
  6377. header_ http.Header
  6378. }
  6379. // List: Lists all GTM Variables of a Container.
  6380. func (r *AccountsContainersVariablesService) List(accountId string, containerId string) *AccountsContainersVariablesListCall {
  6381. c := &AccountsContainersVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6382. c.accountId = accountId
  6383. c.containerId = containerId
  6384. return c
  6385. }
  6386. // Fields allows partial responses to be retrieved. See
  6387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6388. // for more information.
  6389. func (c *AccountsContainersVariablesListCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesListCall {
  6390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6391. return c
  6392. }
  6393. // IfNoneMatch sets the optional parameter which makes the operation
  6394. // fail if the object's ETag matches the given value. This is useful for
  6395. // getting updates only after the object has changed since the last
  6396. // request. Use googleapi.IsNotModified to check whether the response
  6397. // error from Do is the result of In-None-Match.
  6398. func (c *AccountsContainersVariablesListCall) IfNoneMatch(entityTag string) *AccountsContainersVariablesListCall {
  6399. c.ifNoneMatch_ = entityTag
  6400. return c
  6401. }
  6402. // Context sets the context to be used in this call's Do method. Any
  6403. // pending HTTP request will be aborted if the provided context is
  6404. // canceled.
  6405. func (c *AccountsContainersVariablesListCall) Context(ctx context.Context) *AccountsContainersVariablesListCall {
  6406. c.ctx_ = ctx
  6407. return c
  6408. }
  6409. // Header returns an http.Header that can be modified by the caller to
  6410. // add HTTP headers to the request.
  6411. func (c *AccountsContainersVariablesListCall) Header() http.Header {
  6412. if c.header_ == nil {
  6413. c.header_ = make(http.Header)
  6414. }
  6415. return c.header_
  6416. }
  6417. func (c *AccountsContainersVariablesListCall) doRequest(alt string) (*http.Response, error) {
  6418. reqHeaders := make(http.Header)
  6419. for k, v := range c.header_ {
  6420. reqHeaders[k] = v
  6421. }
  6422. reqHeaders.Set("User-Agent", c.s.userAgent())
  6423. if c.ifNoneMatch_ != "" {
  6424. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6425. }
  6426. var body io.Reader = nil
  6427. c.urlParams_.Set("alt", alt)
  6428. c.urlParams_.Set("prettyPrint", "false")
  6429. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables")
  6430. urls += "?" + c.urlParams_.Encode()
  6431. req, err := http.NewRequest("GET", urls, body)
  6432. if err != nil {
  6433. return nil, err
  6434. }
  6435. req.Header = reqHeaders
  6436. googleapi.Expand(req.URL, map[string]string{
  6437. "accountId": c.accountId,
  6438. "containerId": c.containerId,
  6439. })
  6440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6441. }
  6442. // Do executes the "tagmanager.accounts.containers.variables.list" call.
  6443. // Exactly one of *ListVariablesResponse or error will be non-nil. Any
  6444. // non-2xx status code is an error. Response headers are in either
  6445. // *ListVariablesResponse.ServerResponse.Header or (if a response was
  6446. // returned at all) in error.(*googleapi.Error).Header. Use
  6447. // googleapi.IsNotModified to check whether the returned error was
  6448. // because http.StatusNotModified was returned.
  6449. func (c *AccountsContainersVariablesListCall) Do(opts ...googleapi.CallOption) (*ListVariablesResponse, error) {
  6450. gensupport.SetOptions(c.urlParams_, opts...)
  6451. res, err := c.doRequest("json")
  6452. if res != nil && res.StatusCode == http.StatusNotModified {
  6453. if res.Body != nil {
  6454. res.Body.Close()
  6455. }
  6456. return nil, &googleapi.Error{
  6457. Code: res.StatusCode,
  6458. Header: res.Header,
  6459. }
  6460. }
  6461. if err != nil {
  6462. return nil, err
  6463. }
  6464. defer googleapi.CloseBody(res)
  6465. if err := googleapi.CheckResponse(res); err != nil {
  6466. return nil, err
  6467. }
  6468. ret := &ListVariablesResponse{
  6469. ServerResponse: googleapi.ServerResponse{
  6470. Header: res.Header,
  6471. HTTPStatusCode: res.StatusCode,
  6472. },
  6473. }
  6474. target := &ret
  6475. if err := gensupport.DecodeResponse(target, res); err != nil {
  6476. return nil, err
  6477. }
  6478. return ret, nil
  6479. // {
  6480. // "description": "Lists all GTM Variables of a Container.",
  6481. // "httpMethod": "GET",
  6482. // "id": "tagmanager.accounts.containers.variables.list",
  6483. // "parameterOrder": [
  6484. // "accountId",
  6485. // "containerId"
  6486. // ],
  6487. // "parameters": {
  6488. // "accountId": {
  6489. // "description": "The GTM Account ID.",
  6490. // "location": "path",
  6491. // "required": true,
  6492. // "type": "string"
  6493. // },
  6494. // "containerId": {
  6495. // "description": "The GTM Container ID.",
  6496. // "location": "path",
  6497. // "required": true,
  6498. // "type": "string"
  6499. // }
  6500. // },
  6501. // "path": "accounts/{accountId}/containers/{containerId}/variables",
  6502. // "response": {
  6503. // "$ref": "ListVariablesResponse"
  6504. // },
  6505. // "scopes": [
  6506. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6507. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6508. // ]
  6509. // }
  6510. }
  6511. // method id "tagmanager.accounts.containers.variables.update":
  6512. type AccountsContainersVariablesUpdateCall struct {
  6513. s *Service
  6514. accountId string
  6515. containerId string
  6516. variableId string
  6517. variable *Variable
  6518. urlParams_ gensupport.URLParams
  6519. ctx_ context.Context
  6520. header_ http.Header
  6521. }
  6522. // Update: Updates a GTM Variable.
  6523. func (r *AccountsContainersVariablesService) Update(accountId string, containerId string, variableId string, variable *Variable) *AccountsContainersVariablesUpdateCall {
  6524. c := &AccountsContainersVariablesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6525. c.accountId = accountId
  6526. c.containerId = containerId
  6527. c.variableId = variableId
  6528. c.variable = variable
  6529. return c
  6530. }
  6531. // Fingerprint sets the optional parameter "fingerprint": When provided,
  6532. // this fingerprint must match the fingerprint of the variable in
  6533. // storage.
  6534. func (c *AccountsContainersVariablesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersVariablesUpdateCall {
  6535. c.urlParams_.Set("fingerprint", fingerprint)
  6536. return c
  6537. }
  6538. // Fields allows partial responses to be retrieved. See
  6539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6540. // for more information.
  6541. func (c *AccountsContainersVariablesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersVariablesUpdateCall {
  6542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6543. return c
  6544. }
  6545. // Context sets the context to be used in this call's Do method. Any
  6546. // pending HTTP request will be aborted if the provided context is
  6547. // canceled.
  6548. func (c *AccountsContainersVariablesUpdateCall) Context(ctx context.Context) *AccountsContainersVariablesUpdateCall {
  6549. c.ctx_ = ctx
  6550. return c
  6551. }
  6552. // Header returns an http.Header that can be modified by the caller to
  6553. // add HTTP headers to the request.
  6554. func (c *AccountsContainersVariablesUpdateCall) Header() http.Header {
  6555. if c.header_ == nil {
  6556. c.header_ = make(http.Header)
  6557. }
  6558. return c.header_
  6559. }
  6560. func (c *AccountsContainersVariablesUpdateCall) doRequest(alt string) (*http.Response, error) {
  6561. reqHeaders := make(http.Header)
  6562. for k, v := range c.header_ {
  6563. reqHeaders[k] = v
  6564. }
  6565. reqHeaders.Set("User-Agent", c.s.userAgent())
  6566. var body io.Reader = nil
  6567. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  6568. if err != nil {
  6569. return nil, err
  6570. }
  6571. reqHeaders.Set("Content-Type", "application/json")
  6572. c.urlParams_.Set("alt", alt)
  6573. c.urlParams_.Set("prettyPrint", "false")
  6574. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/variables/{variableId}")
  6575. urls += "?" + c.urlParams_.Encode()
  6576. req, err := http.NewRequest("PUT", urls, body)
  6577. if err != nil {
  6578. return nil, err
  6579. }
  6580. req.Header = reqHeaders
  6581. googleapi.Expand(req.URL, map[string]string{
  6582. "accountId": c.accountId,
  6583. "containerId": c.containerId,
  6584. "variableId": c.variableId,
  6585. })
  6586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6587. }
  6588. // Do executes the "tagmanager.accounts.containers.variables.update" call.
  6589. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  6590. // code is an error. Response headers are in either
  6591. // *Variable.ServerResponse.Header or (if a response was returned at
  6592. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6593. // to check whether the returned error was because
  6594. // http.StatusNotModified was returned.
  6595. func (c *AccountsContainersVariablesUpdateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  6596. gensupport.SetOptions(c.urlParams_, opts...)
  6597. res, err := c.doRequest("json")
  6598. if res != nil && res.StatusCode == http.StatusNotModified {
  6599. if res.Body != nil {
  6600. res.Body.Close()
  6601. }
  6602. return nil, &googleapi.Error{
  6603. Code: res.StatusCode,
  6604. Header: res.Header,
  6605. }
  6606. }
  6607. if err != nil {
  6608. return nil, err
  6609. }
  6610. defer googleapi.CloseBody(res)
  6611. if err := googleapi.CheckResponse(res); err != nil {
  6612. return nil, err
  6613. }
  6614. ret := &Variable{
  6615. ServerResponse: googleapi.ServerResponse{
  6616. Header: res.Header,
  6617. HTTPStatusCode: res.StatusCode,
  6618. },
  6619. }
  6620. target := &ret
  6621. if err := gensupport.DecodeResponse(target, res); err != nil {
  6622. return nil, err
  6623. }
  6624. return ret, nil
  6625. // {
  6626. // "description": "Updates a GTM Variable.",
  6627. // "httpMethod": "PUT",
  6628. // "id": "tagmanager.accounts.containers.variables.update",
  6629. // "parameterOrder": [
  6630. // "accountId",
  6631. // "containerId",
  6632. // "variableId"
  6633. // ],
  6634. // "parameters": {
  6635. // "accountId": {
  6636. // "description": "The GTM Account ID.",
  6637. // "location": "path",
  6638. // "required": true,
  6639. // "type": "string"
  6640. // },
  6641. // "containerId": {
  6642. // "description": "The GTM Container ID.",
  6643. // "location": "path",
  6644. // "required": true,
  6645. // "type": "string"
  6646. // },
  6647. // "fingerprint": {
  6648. // "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.",
  6649. // "location": "query",
  6650. // "type": "string"
  6651. // },
  6652. // "variableId": {
  6653. // "description": "The GTM Variable ID.",
  6654. // "location": "path",
  6655. // "required": true,
  6656. // "type": "string"
  6657. // }
  6658. // },
  6659. // "path": "accounts/{accountId}/containers/{containerId}/variables/{variableId}",
  6660. // "request": {
  6661. // "$ref": "Variable"
  6662. // },
  6663. // "response": {
  6664. // "$ref": "Variable"
  6665. // },
  6666. // "scopes": [
  6667. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6668. // ]
  6669. // }
  6670. }
  6671. // method id "tagmanager.accounts.containers.versions.create":
  6672. type AccountsContainersVersionsCreateCall struct {
  6673. s *Service
  6674. accountId string
  6675. containerId string
  6676. createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions
  6677. urlParams_ gensupport.URLParams
  6678. ctx_ context.Context
  6679. header_ http.Header
  6680. }
  6681. // Create: Creates a Container Version.
  6682. func (r *AccountsContainersVersionsService) Create(accountId string, containerId string, createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions) *AccountsContainersVersionsCreateCall {
  6683. c := &AccountsContainersVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6684. c.accountId = accountId
  6685. c.containerId = containerId
  6686. c.createcontainerversionrequestversionoptions = createcontainerversionrequestversionoptions
  6687. return c
  6688. }
  6689. // Fields allows partial responses to be retrieved. See
  6690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6691. // for more information.
  6692. func (c *AccountsContainersVersionsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsCreateCall {
  6693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6694. return c
  6695. }
  6696. // Context sets the context to be used in this call's Do method. Any
  6697. // pending HTTP request will be aborted if the provided context is
  6698. // canceled.
  6699. func (c *AccountsContainersVersionsCreateCall) Context(ctx context.Context) *AccountsContainersVersionsCreateCall {
  6700. c.ctx_ = ctx
  6701. return c
  6702. }
  6703. // Header returns an http.Header that can be modified by the caller to
  6704. // add HTTP headers to the request.
  6705. func (c *AccountsContainersVersionsCreateCall) Header() http.Header {
  6706. if c.header_ == nil {
  6707. c.header_ = make(http.Header)
  6708. }
  6709. return c.header_
  6710. }
  6711. func (c *AccountsContainersVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
  6712. reqHeaders := make(http.Header)
  6713. for k, v := range c.header_ {
  6714. reqHeaders[k] = v
  6715. }
  6716. reqHeaders.Set("User-Agent", c.s.userAgent())
  6717. var body io.Reader = nil
  6718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontainerversionrequestversionoptions)
  6719. if err != nil {
  6720. return nil, err
  6721. }
  6722. reqHeaders.Set("Content-Type", "application/json")
  6723. c.urlParams_.Set("alt", alt)
  6724. c.urlParams_.Set("prettyPrint", "false")
  6725. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions")
  6726. urls += "?" + c.urlParams_.Encode()
  6727. req, err := http.NewRequest("POST", urls, body)
  6728. if err != nil {
  6729. return nil, err
  6730. }
  6731. req.Header = reqHeaders
  6732. googleapi.Expand(req.URL, map[string]string{
  6733. "accountId": c.accountId,
  6734. "containerId": c.containerId,
  6735. })
  6736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6737. }
  6738. // Do executes the "tagmanager.accounts.containers.versions.create" call.
  6739. // Exactly one of *CreateContainerVersionResponse or error will be
  6740. // non-nil. Any non-2xx status code is an error. Response headers are in
  6741. // either *CreateContainerVersionResponse.ServerResponse.Header or (if a
  6742. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6743. // googleapi.IsNotModified to check whether the returned error was
  6744. // because http.StatusNotModified was returned.
  6745. func (c *AccountsContainersVersionsCreateCall) Do(opts ...googleapi.CallOption) (*CreateContainerVersionResponse, error) {
  6746. gensupport.SetOptions(c.urlParams_, opts...)
  6747. res, err := c.doRequest("json")
  6748. if res != nil && res.StatusCode == http.StatusNotModified {
  6749. if res.Body != nil {
  6750. res.Body.Close()
  6751. }
  6752. return nil, &googleapi.Error{
  6753. Code: res.StatusCode,
  6754. Header: res.Header,
  6755. }
  6756. }
  6757. if err != nil {
  6758. return nil, err
  6759. }
  6760. defer googleapi.CloseBody(res)
  6761. if err := googleapi.CheckResponse(res); err != nil {
  6762. return nil, err
  6763. }
  6764. ret := &CreateContainerVersionResponse{
  6765. ServerResponse: googleapi.ServerResponse{
  6766. Header: res.Header,
  6767. HTTPStatusCode: res.StatusCode,
  6768. },
  6769. }
  6770. target := &ret
  6771. if err := gensupport.DecodeResponse(target, res); err != nil {
  6772. return nil, err
  6773. }
  6774. return ret, nil
  6775. // {
  6776. // "description": "Creates a Container Version.",
  6777. // "httpMethod": "POST",
  6778. // "id": "tagmanager.accounts.containers.versions.create",
  6779. // "parameterOrder": [
  6780. // "accountId",
  6781. // "containerId"
  6782. // ],
  6783. // "parameters": {
  6784. // "accountId": {
  6785. // "description": "The GTM Account ID.",
  6786. // "location": "path",
  6787. // "required": true,
  6788. // "type": "string"
  6789. // },
  6790. // "containerId": {
  6791. // "description": "The GTM Container ID.",
  6792. // "location": "path",
  6793. // "required": true,
  6794. // "type": "string"
  6795. // }
  6796. // },
  6797. // "path": "accounts/{accountId}/containers/{containerId}/versions",
  6798. // "request": {
  6799. // "$ref": "CreateContainerVersionRequestVersionOptions"
  6800. // },
  6801. // "response": {
  6802. // "$ref": "CreateContainerVersionResponse"
  6803. // },
  6804. // "scopes": [
  6805. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  6806. // ]
  6807. // }
  6808. }
  6809. // method id "tagmanager.accounts.containers.versions.delete":
  6810. type AccountsContainersVersionsDeleteCall struct {
  6811. s *Service
  6812. accountId string
  6813. containerId string
  6814. containerVersionId string
  6815. urlParams_ gensupport.URLParams
  6816. ctx_ context.Context
  6817. header_ http.Header
  6818. }
  6819. // Delete: Deletes a Container Version.
  6820. func (r *AccountsContainersVersionsService) Delete(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsDeleteCall {
  6821. c := &AccountsContainersVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6822. c.accountId = accountId
  6823. c.containerId = containerId
  6824. c.containerVersionId = containerVersionId
  6825. return c
  6826. }
  6827. // Fields allows partial responses to be retrieved. See
  6828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6829. // for more information.
  6830. func (c *AccountsContainersVersionsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsDeleteCall {
  6831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6832. return c
  6833. }
  6834. // Context sets the context to be used in this call's Do method. Any
  6835. // pending HTTP request will be aborted if the provided context is
  6836. // canceled.
  6837. func (c *AccountsContainersVersionsDeleteCall) Context(ctx context.Context) *AccountsContainersVersionsDeleteCall {
  6838. c.ctx_ = ctx
  6839. return c
  6840. }
  6841. // Header returns an http.Header that can be modified by the caller to
  6842. // add HTTP headers to the request.
  6843. func (c *AccountsContainersVersionsDeleteCall) Header() http.Header {
  6844. if c.header_ == nil {
  6845. c.header_ = make(http.Header)
  6846. }
  6847. return c.header_
  6848. }
  6849. func (c *AccountsContainersVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6850. reqHeaders := make(http.Header)
  6851. for k, v := range c.header_ {
  6852. reqHeaders[k] = v
  6853. }
  6854. reqHeaders.Set("User-Agent", c.s.userAgent())
  6855. var body io.Reader = nil
  6856. c.urlParams_.Set("alt", alt)
  6857. c.urlParams_.Set("prettyPrint", "false")
  6858. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}")
  6859. urls += "?" + c.urlParams_.Encode()
  6860. req, err := http.NewRequest("DELETE", urls, body)
  6861. if err != nil {
  6862. return nil, err
  6863. }
  6864. req.Header = reqHeaders
  6865. googleapi.Expand(req.URL, map[string]string{
  6866. "accountId": c.accountId,
  6867. "containerId": c.containerId,
  6868. "containerVersionId": c.containerVersionId,
  6869. })
  6870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6871. }
  6872. // Do executes the "tagmanager.accounts.containers.versions.delete" call.
  6873. func (c *AccountsContainersVersionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6874. gensupport.SetOptions(c.urlParams_, opts...)
  6875. res, err := c.doRequest("json")
  6876. if err != nil {
  6877. return err
  6878. }
  6879. defer googleapi.CloseBody(res)
  6880. if err := googleapi.CheckResponse(res); err != nil {
  6881. return err
  6882. }
  6883. return nil
  6884. // {
  6885. // "description": "Deletes a Container Version.",
  6886. // "httpMethod": "DELETE",
  6887. // "id": "tagmanager.accounts.containers.versions.delete",
  6888. // "parameterOrder": [
  6889. // "accountId",
  6890. // "containerId",
  6891. // "containerVersionId"
  6892. // ],
  6893. // "parameters": {
  6894. // "accountId": {
  6895. // "description": "The GTM Account ID.",
  6896. // "location": "path",
  6897. // "required": true,
  6898. // "type": "string"
  6899. // },
  6900. // "containerId": {
  6901. // "description": "The GTM Container ID.",
  6902. // "location": "path",
  6903. // "required": true,
  6904. // "type": "string"
  6905. // },
  6906. // "containerVersionId": {
  6907. // "description": "The GTM Container Version ID.",
  6908. // "location": "path",
  6909. // "required": true,
  6910. // "type": "string"
  6911. // }
  6912. // },
  6913. // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}",
  6914. // "scopes": [
  6915. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  6916. // ]
  6917. // }
  6918. }
  6919. // method id "tagmanager.accounts.containers.versions.get":
  6920. type AccountsContainersVersionsGetCall struct {
  6921. s *Service
  6922. accountId string
  6923. containerId string
  6924. containerVersionId string
  6925. urlParams_ gensupport.URLParams
  6926. ifNoneMatch_ string
  6927. ctx_ context.Context
  6928. header_ http.Header
  6929. }
  6930. // Get: Gets a Container Version.
  6931. func (r *AccountsContainersVersionsService) Get(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsGetCall {
  6932. c := &AccountsContainersVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6933. c.accountId = accountId
  6934. c.containerId = containerId
  6935. c.containerVersionId = containerVersionId
  6936. return c
  6937. }
  6938. // Fields allows partial responses to be retrieved. See
  6939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6940. // for more information.
  6941. func (c *AccountsContainersVersionsGetCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsGetCall {
  6942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6943. return c
  6944. }
  6945. // IfNoneMatch sets the optional parameter which makes the operation
  6946. // fail if the object's ETag matches the given value. This is useful for
  6947. // getting updates only after the object has changed since the last
  6948. // request. Use googleapi.IsNotModified to check whether the response
  6949. // error from Do is the result of In-None-Match.
  6950. func (c *AccountsContainersVersionsGetCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsGetCall {
  6951. c.ifNoneMatch_ = entityTag
  6952. return c
  6953. }
  6954. // Context sets the context to be used in this call's Do method. Any
  6955. // pending HTTP request will be aborted if the provided context is
  6956. // canceled.
  6957. func (c *AccountsContainersVersionsGetCall) Context(ctx context.Context) *AccountsContainersVersionsGetCall {
  6958. c.ctx_ = ctx
  6959. return c
  6960. }
  6961. // Header returns an http.Header that can be modified by the caller to
  6962. // add HTTP headers to the request.
  6963. func (c *AccountsContainersVersionsGetCall) Header() http.Header {
  6964. if c.header_ == nil {
  6965. c.header_ = make(http.Header)
  6966. }
  6967. return c.header_
  6968. }
  6969. func (c *AccountsContainersVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  6970. reqHeaders := make(http.Header)
  6971. for k, v := range c.header_ {
  6972. reqHeaders[k] = v
  6973. }
  6974. reqHeaders.Set("User-Agent", c.s.userAgent())
  6975. if c.ifNoneMatch_ != "" {
  6976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6977. }
  6978. var body io.Reader = nil
  6979. c.urlParams_.Set("alt", alt)
  6980. c.urlParams_.Set("prettyPrint", "false")
  6981. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}")
  6982. urls += "?" + c.urlParams_.Encode()
  6983. req, err := http.NewRequest("GET", urls, body)
  6984. if err != nil {
  6985. return nil, err
  6986. }
  6987. req.Header = reqHeaders
  6988. googleapi.Expand(req.URL, map[string]string{
  6989. "accountId": c.accountId,
  6990. "containerId": c.containerId,
  6991. "containerVersionId": c.containerVersionId,
  6992. })
  6993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6994. }
  6995. // Do executes the "tagmanager.accounts.containers.versions.get" call.
  6996. // Exactly one of *ContainerVersion or error will be non-nil. Any
  6997. // non-2xx status code is an error. Response headers are in either
  6998. // *ContainerVersion.ServerResponse.Header or (if a response was
  6999. // returned at all) in error.(*googleapi.Error).Header. Use
  7000. // googleapi.IsNotModified to check whether the returned error was
  7001. // because http.StatusNotModified was returned.
  7002. func (c *AccountsContainersVersionsGetCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  7003. gensupport.SetOptions(c.urlParams_, opts...)
  7004. res, err := c.doRequest("json")
  7005. if res != nil && res.StatusCode == http.StatusNotModified {
  7006. if res.Body != nil {
  7007. res.Body.Close()
  7008. }
  7009. return nil, &googleapi.Error{
  7010. Code: res.StatusCode,
  7011. Header: res.Header,
  7012. }
  7013. }
  7014. if err != nil {
  7015. return nil, err
  7016. }
  7017. defer googleapi.CloseBody(res)
  7018. if err := googleapi.CheckResponse(res); err != nil {
  7019. return nil, err
  7020. }
  7021. ret := &ContainerVersion{
  7022. ServerResponse: googleapi.ServerResponse{
  7023. Header: res.Header,
  7024. HTTPStatusCode: res.StatusCode,
  7025. },
  7026. }
  7027. target := &ret
  7028. if err := gensupport.DecodeResponse(target, res); err != nil {
  7029. return nil, err
  7030. }
  7031. return ret, nil
  7032. // {
  7033. // "description": "Gets a Container Version.",
  7034. // "httpMethod": "GET",
  7035. // "id": "tagmanager.accounts.containers.versions.get",
  7036. // "parameterOrder": [
  7037. // "accountId",
  7038. // "containerId",
  7039. // "containerVersionId"
  7040. // ],
  7041. // "parameters": {
  7042. // "accountId": {
  7043. // "description": "The GTM Account ID.",
  7044. // "location": "path",
  7045. // "required": true,
  7046. // "type": "string"
  7047. // },
  7048. // "containerId": {
  7049. // "description": "The GTM Container ID.",
  7050. // "location": "path",
  7051. // "required": true,
  7052. // "type": "string"
  7053. // },
  7054. // "containerVersionId": {
  7055. // "description": "The GTM Container Version ID. Specify published to retrieve the currently published version.",
  7056. // "location": "path",
  7057. // "required": true,
  7058. // "type": "string"
  7059. // }
  7060. // },
  7061. // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}",
  7062. // "response": {
  7063. // "$ref": "ContainerVersion"
  7064. // },
  7065. // "scopes": [
  7066. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  7067. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  7068. // "https://www.googleapis.com/auth/tagmanager.readonly"
  7069. // ]
  7070. // }
  7071. }
  7072. // method id "tagmanager.accounts.containers.versions.list":
  7073. type AccountsContainersVersionsListCall struct {
  7074. s *Service
  7075. accountId string
  7076. containerId string
  7077. urlParams_ gensupport.URLParams
  7078. ifNoneMatch_ string
  7079. ctx_ context.Context
  7080. header_ http.Header
  7081. }
  7082. // List: Lists all Container Versions of a GTM Container.
  7083. func (r *AccountsContainersVersionsService) List(accountId string, containerId string) *AccountsContainersVersionsListCall {
  7084. c := &AccountsContainersVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7085. c.accountId = accountId
  7086. c.containerId = containerId
  7087. return c
  7088. }
  7089. // Headers sets the optional parameter "headers": Retrieve headers only
  7090. // when true.
  7091. func (c *AccountsContainersVersionsListCall) Headers(headers bool) *AccountsContainersVersionsListCall {
  7092. c.urlParams_.Set("headers", fmt.Sprint(headers))
  7093. return c
  7094. }
  7095. // IncludeDeleted sets the optional parameter "includeDeleted": Also
  7096. // retrieve deleted (archived) versions when true.
  7097. func (c *AccountsContainersVersionsListCall) IncludeDeleted(includeDeleted bool) *AccountsContainersVersionsListCall {
  7098. c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  7099. return c
  7100. }
  7101. // Fields allows partial responses to be retrieved. See
  7102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7103. // for more information.
  7104. func (c *AccountsContainersVersionsListCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsListCall {
  7105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7106. return c
  7107. }
  7108. // IfNoneMatch sets the optional parameter which makes the operation
  7109. // fail if the object's ETag matches the given value. This is useful for
  7110. // getting updates only after the object has changed since the last
  7111. // request. Use googleapi.IsNotModified to check whether the response
  7112. // error from Do is the result of In-None-Match.
  7113. func (c *AccountsContainersVersionsListCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsListCall {
  7114. c.ifNoneMatch_ = entityTag
  7115. return c
  7116. }
  7117. // Context sets the context to be used in this call's Do method. Any
  7118. // pending HTTP request will be aborted if the provided context is
  7119. // canceled.
  7120. func (c *AccountsContainersVersionsListCall) Context(ctx context.Context) *AccountsContainersVersionsListCall {
  7121. c.ctx_ = ctx
  7122. return c
  7123. }
  7124. // Header returns an http.Header that can be modified by the caller to
  7125. // add HTTP headers to the request.
  7126. func (c *AccountsContainersVersionsListCall) Header() http.Header {
  7127. if c.header_ == nil {
  7128. c.header_ = make(http.Header)
  7129. }
  7130. return c.header_
  7131. }
  7132. func (c *AccountsContainersVersionsListCall) doRequest(alt string) (*http.Response, error) {
  7133. reqHeaders := make(http.Header)
  7134. for k, v := range c.header_ {
  7135. reqHeaders[k] = v
  7136. }
  7137. reqHeaders.Set("User-Agent", c.s.userAgent())
  7138. if c.ifNoneMatch_ != "" {
  7139. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7140. }
  7141. var body io.Reader = nil
  7142. c.urlParams_.Set("alt", alt)
  7143. c.urlParams_.Set("prettyPrint", "false")
  7144. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions")
  7145. urls += "?" + c.urlParams_.Encode()
  7146. req, err := http.NewRequest("GET", urls, body)
  7147. if err != nil {
  7148. return nil, err
  7149. }
  7150. req.Header = reqHeaders
  7151. googleapi.Expand(req.URL, map[string]string{
  7152. "accountId": c.accountId,
  7153. "containerId": c.containerId,
  7154. })
  7155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7156. }
  7157. // Do executes the "tagmanager.accounts.containers.versions.list" call.
  7158. // Exactly one of *ListContainerVersionsResponse or error will be
  7159. // non-nil. Any non-2xx status code is an error. Response headers are in
  7160. // either *ListContainerVersionsResponse.ServerResponse.Header or (if a
  7161. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7162. // googleapi.IsNotModified to check whether the returned error was
  7163. // because http.StatusNotModified was returned.
  7164. func (c *AccountsContainersVersionsListCall) Do(opts ...googleapi.CallOption) (*ListContainerVersionsResponse, error) {
  7165. gensupport.SetOptions(c.urlParams_, opts...)
  7166. res, err := c.doRequest("json")
  7167. if res != nil && res.StatusCode == http.StatusNotModified {
  7168. if res.Body != nil {
  7169. res.Body.Close()
  7170. }
  7171. return nil, &googleapi.Error{
  7172. Code: res.StatusCode,
  7173. Header: res.Header,
  7174. }
  7175. }
  7176. if err != nil {
  7177. return nil, err
  7178. }
  7179. defer googleapi.CloseBody(res)
  7180. if err := googleapi.CheckResponse(res); err != nil {
  7181. return nil, err
  7182. }
  7183. ret := &ListContainerVersionsResponse{
  7184. ServerResponse: googleapi.ServerResponse{
  7185. Header: res.Header,
  7186. HTTPStatusCode: res.StatusCode,
  7187. },
  7188. }
  7189. target := &ret
  7190. if err := gensupport.DecodeResponse(target, res); err != nil {
  7191. return nil, err
  7192. }
  7193. return ret, nil
  7194. // {
  7195. // "description": "Lists all Container Versions of a GTM Container.",
  7196. // "httpMethod": "GET",
  7197. // "id": "tagmanager.accounts.containers.versions.list",
  7198. // "parameterOrder": [
  7199. // "accountId",
  7200. // "containerId"
  7201. // ],
  7202. // "parameters": {
  7203. // "accountId": {
  7204. // "description": "The GTM Account ID.",
  7205. // "location": "path",
  7206. // "required": true,
  7207. // "type": "string"
  7208. // },
  7209. // "containerId": {
  7210. // "description": "The GTM Container ID.",
  7211. // "location": "path",
  7212. // "required": true,
  7213. // "type": "string"
  7214. // },
  7215. // "headers": {
  7216. // "default": "false",
  7217. // "description": "Retrieve headers only when true.",
  7218. // "location": "query",
  7219. // "type": "boolean"
  7220. // },
  7221. // "includeDeleted": {
  7222. // "default": "false",
  7223. // "description": "Also retrieve deleted (archived) versions when true.",
  7224. // "location": "query",
  7225. // "type": "boolean"
  7226. // }
  7227. // },
  7228. // "path": "accounts/{accountId}/containers/{containerId}/versions",
  7229. // "response": {
  7230. // "$ref": "ListContainerVersionsResponse"
  7231. // },
  7232. // "scopes": [
  7233. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  7234. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  7235. // "https://www.googleapis.com/auth/tagmanager.readonly"
  7236. // ]
  7237. // }
  7238. }
  7239. // method id "tagmanager.accounts.containers.versions.publish":
  7240. type AccountsContainersVersionsPublishCall struct {
  7241. s *Service
  7242. accountId string
  7243. containerId string
  7244. containerVersionId string
  7245. urlParams_ gensupport.URLParams
  7246. ctx_ context.Context
  7247. header_ http.Header
  7248. }
  7249. // Publish: Publishes a Container Version.
  7250. func (r *AccountsContainersVersionsService) Publish(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsPublishCall {
  7251. c := &AccountsContainersVersionsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7252. c.accountId = accountId
  7253. c.containerId = containerId
  7254. c.containerVersionId = containerVersionId
  7255. return c
  7256. }
  7257. // Fingerprint sets the optional parameter "fingerprint": When provided,
  7258. // this fingerprint must match the fingerprint of the container version
  7259. // in storage.
  7260. func (c *AccountsContainersVersionsPublishCall) Fingerprint(fingerprint string) *AccountsContainersVersionsPublishCall {
  7261. c.urlParams_.Set("fingerprint", fingerprint)
  7262. return c
  7263. }
  7264. // Fields allows partial responses to be retrieved. See
  7265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7266. // for more information.
  7267. func (c *AccountsContainersVersionsPublishCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsPublishCall {
  7268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7269. return c
  7270. }
  7271. // Context sets the context to be used in this call's Do method. Any
  7272. // pending HTTP request will be aborted if the provided context is
  7273. // canceled.
  7274. func (c *AccountsContainersVersionsPublishCall) Context(ctx context.Context) *AccountsContainersVersionsPublishCall {
  7275. c.ctx_ = ctx
  7276. return c
  7277. }
  7278. // Header returns an http.Header that can be modified by the caller to
  7279. // add HTTP headers to the request.
  7280. func (c *AccountsContainersVersionsPublishCall) Header() http.Header {
  7281. if c.header_ == nil {
  7282. c.header_ = make(http.Header)
  7283. }
  7284. return c.header_
  7285. }
  7286. func (c *AccountsContainersVersionsPublishCall) doRequest(alt string) (*http.Response, error) {
  7287. reqHeaders := make(http.Header)
  7288. for k, v := range c.header_ {
  7289. reqHeaders[k] = v
  7290. }
  7291. reqHeaders.Set("User-Agent", c.s.userAgent())
  7292. var body io.Reader = nil
  7293. c.urlParams_.Set("alt", alt)
  7294. c.urlParams_.Set("prettyPrint", "false")
  7295. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish")
  7296. urls += "?" + c.urlParams_.Encode()
  7297. req, err := http.NewRequest("POST", urls, body)
  7298. if err != nil {
  7299. return nil, err
  7300. }
  7301. req.Header = reqHeaders
  7302. googleapi.Expand(req.URL, map[string]string{
  7303. "accountId": c.accountId,
  7304. "containerId": c.containerId,
  7305. "containerVersionId": c.containerVersionId,
  7306. })
  7307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7308. }
  7309. // Do executes the "tagmanager.accounts.containers.versions.publish" call.
  7310. // Exactly one of *PublishContainerVersionResponse or error will be
  7311. // non-nil. Any non-2xx status code is an error. Response headers are in
  7312. // either *PublishContainerVersionResponse.ServerResponse.Header or (if
  7313. // a response was returned at all) in error.(*googleapi.Error).Header.
  7314. // Use googleapi.IsNotModified to check whether the returned error was
  7315. // because http.StatusNotModified was returned.
  7316. func (c *AccountsContainersVersionsPublishCall) Do(opts ...googleapi.CallOption) (*PublishContainerVersionResponse, error) {
  7317. gensupport.SetOptions(c.urlParams_, opts...)
  7318. res, err := c.doRequest("json")
  7319. if res != nil && res.StatusCode == http.StatusNotModified {
  7320. if res.Body != nil {
  7321. res.Body.Close()
  7322. }
  7323. return nil, &googleapi.Error{
  7324. Code: res.StatusCode,
  7325. Header: res.Header,
  7326. }
  7327. }
  7328. if err != nil {
  7329. return nil, err
  7330. }
  7331. defer googleapi.CloseBody(res)
  7332. if err := googleapi.CheckResponse(res); err != nil {
  7333. return nil, err
  7334. }
  7335. ret := &PublishContainerVersionResponse{
  7336. ServerResponse: googleapi.ServerResponse{
  7337. Header: res.Header,
  7338. HTTPStatusCode: res.StatusCode,
  7339. },
  7340. }
  7341. target := &ret
  7342. if err := gensupport.DecodeResponse(target, res); err != nil {
  7343. return nil, err
  7344. }
  7345. return ret, nil
  7346. // {
  7347. // "description": "Publishes a Container Version.",
  7348. // "httpMethod": "POST",
  7349. // "id": "tagmanager.accounts.containers.versions.publish",
  7350. // "parameterOrder": [
  7351. // "accountId",
  7352. // "containerId",
  7353. // "containerVersionId"
  7354. // ],
  7355. // "parameters": {
  7356. // "accountId": {
  7357. // "description": "The GTM Account ID.",
  7358. // "location": "path",
  7359. // "required": true,
  7360. // "type": "string"
  7361. // },
  7362. // "containerId": {
  7363. // "description": "The GTM Container ID.",
  7364. // "location": "path",
  7365. // "required": true,
  7366. // "type": "string"
  7367. // },
  7368. // "containerVersionId": {
  7369. // "description": "The GTM Container Version ID.",
  7370. // "location": "path",
  7371. // "required": true,
  7372. // "type": "string"
  7373. // },
  7374. // "fingerprint": {
  7375. // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.",
  7376. // "location": "query",
  7377. // "type": "string"
  7378. // }
  7379. // },
  7380. // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish",
  7381. // "response": {
  7382. // "$ref": "PublishContainerVersionResponse"
  7383. // },
  7384. // "scopes": [
  7385. // "https://www.googleapis.com/auth/tagmanager.publish"
  7386. // ]
  7387. // }
  7388. }
  7389. // method id "tagmanager.accounts.containers.versions.restore":
  7390. type AccountsContainersVersionsRestoreCall struct {
  7391. s *Service
  7392. accountId string
  7393. containerId string
  7394. containerVersionId string
  7395. urlParams_ gensupport.URLParams
  7396. ctx_ context.Context
  7397. header_ http.Header
  7398. }
  7399. // Restore: Restores a Container Version. This will overwrite the
  7400. // container's current configuration (including its variables, triggers
  7401. // and tags). The operation will not have any effect on the version that
  7402. // is being served (i.e. the published version).
  7403. func (r *AccountsContainersVersionsService) Restore(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsRestoreCall {
  7404. c := &AccountsContainersVersionsRestoreCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7405. c.accountId = accountId
  7406. c.containerId = containerId
  7407. c.containerVersionId = containerVersionId
  7408. return c
  7409. }
  7410. // Fields allows partial responses to be retrieved. See
  7411. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7412. // for more information.
  7413. func (c *AccountsContainersVersionsRestoreCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsRestoreCall {
  7414. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7415. return c
  7416. }
  7417. // Context sets the context to be used in this call's Do method. Any
  7418. // pending HTTP request will be aborted if the provided context is
  7419. // canceled.
  7420. func (c *AccountsContainersVersionsRestoreCall) Context(ctx context.Context) *AccountsContainersVersionsRestoreCall {
  7421. c.ctx_ = ctx
  7422. return c
  7423. }
  7424. // Header returns an http.Header that can be modified by the caller to
  7425. // add HTTP headers to the request.
  7426. func (c *AccountsContainersVersionsRestoreCall) Header() http.Header {
  7427. if c.header_ == nil {
  7428. c.header_ = make(http.Header)
  7429. }
  7430. return c.header_
  7431. }
  7432. func (c *AccountsContainersVersionsRestoreCall) doRequest(alt string) (*http.Response, error) {
  7433. reqHeaders := make(http.Header)
  7434. for k, v := range c.header_ {
  7435. reqHeaders[k] = v
  7436. }
  7437. reqHeaders.Set("User-Agent", c.s.userAgent())
  7438. var body io.Reader = nil
  7439. c.urlParams_.Set("alt", alt)
  7440. c.urlParams_.Set("prettyPrint", "false")
  7441. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore")
  7442. urls += "?" + c.urlParams_.Encode()
  7443. req, err := http.NewRequest("POST", urls, body)
  7444. if err != nil {
  7445. return nil, err
  7446. }
  7447. req.Header = reqHeaders
  7448. googleapi.Expand(req.URL, map[string]string{
  7449. "accountId": c.accountId,
  7450. "containerId": c.containerId,
  7451. "containerVersionId": c.containerVersionId,
  7452. })
  7453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7454. }
  7455. // Do executes the "tagmanager.accounts.containers.versions.restore" call.
  7456. // Exactly one of *ContainerVersion or error will be non-nil. Any
  7457. // non-2xx status code is an error. Response headers are in either
  7458. // *ContainerVersion.ServerResponse.Header or (if a response was
  7459. // returned at all) in error.(*googleapi.Error).Header. Use
  7460. // googleapi.IsNotModified to check whether the returned error was
  7461. // because http.StatusNotModified was returned.
  7462. func (c *AccountsContainersVersionsRestoreCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  7463. gensupport.SetOptions(c.urlParams_, opts...)
  7464. res, err := c.doRequest("json")
  7465. if res != nil && res.StatusCode == http.StatusNotModified {
  7466. if res.Body != nil {
  7467. res.Body.Close()
  7468. }
  7469. return nil, &googleapi.Error{
  7470. Code: res.StatusCode,
  7471. Header: res.Header,
  7472. }
  7473. }
  7474. if err != nil {
  7475. return nil, err
  7476. }
  7477. defer googleapi.CloseBody(res)
  7478. if err := googleapi.CheckResponse(res); err != nil {
  7479. return nil, err
  7480. }
  7481. ret := &ContainerVersion{
  7482. ServerResponse: googleapi.ServerResponse{
  7483. Header: res.Header,
  7484. HTTPStatusCode: res.StatusCode,
  7485. },
  7486. }
  7487. target := &ret
  7488. if err := gensupport.DecodeResponse(target, res); err != nil {
  7489. return nil, err
  7490. }
  7491. return ret, nil
  7492. // {
  7493. // "description": "Restores a Container Version. This will overwrite the container's current configuration (including its variables, triggers and tags). The operation will not have any effect on the version that is being served (i.e. the published version).",
  7494. // "httpMethod": "POST",
  7495. // "id": "tagmanager.accounts.containers.versions.restore",
  7496. // "parameterOrder": [
  7497. // "accountId",
  7498. // "containerId",
  7499. // "containerVersionId"
  7500. // ],
  7501. // "parameters": {
  7502. // "accountId": {
  7503. // "description": "The GTM Account ID.",
  7504. // "location": "path",
  7505. // "required": true,
  7506. // "type": "string"
  7507. // },
  7508. // "containerId": {
  7509. // "description": "The GTM Container ID.",
  7510. // "location": "path",
  7511. // "required": true,
  7512. // "type": "string"
  7513. // },
  7514. // "containerVersionId": {
  7515. // "description": "The GTM Container Version ID.",
  7516. // "location": "path",
  7517. // "required": true,
  7518. // "type": "string"
  7519. // }
  7520. // },
  7521. // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore",
  7522. // "response": {
  7523. // "$ref": "ContainerVersion"
  7524. // },
  7525. // "scopes": [
  7526. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  7527. // ]
  7528. // }
  7529. }
  7530. // method id "tagmanager.accounts.containers.versions.undelete":
  7531. type AccountsContainersVersionsUndeleteCall struct {
  7532. s *Service
  7533. accountId string
  7534. containerId string
  7535. containerVersionId string
  7536. urlParams_ gensupport.URLParams
  7537. ctx_ context.Context
  7538. header_ http.Header
  7539. }
  7540. // Undelete: Undeletes a Container Version.
  7541. func (r *AccountsContainersVersionsService) Undelete(accountId string, containerId string, containerVersionId string) *AccountsContainersVersionsUndeleteCall {
  7542. c := &AccountsContainersVersionsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7543. c.accountId = accountId
  7544. c.containerId = containerId
  7545. c.containerVersionId = containerVersionId
  7546. return c
  7547. }
  7548. // Fields allows partial responses to be retrieved. See
  7549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7550. // for more information.
  7551. func (c *AccountsContainersVersionsUndeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUndeleteCall {
  7552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7553. return c
  7554. }
  7555. // Context sets the context to be used in this call's Do method. Any
  7556. // pending HTTP request will be aborted if the provided context is
  7557. // canceled.
  7558. func (c *AccountsContainersVersionsUndeleteCall) Context(ctx context.Context) *AccountsContainersVersionsUndeleteCall {
  7559. c.ctx_ = ctx
  7560. return c
  7561. }
  7562. // Header returns an http.Header that can be modified by the caller to
  7563. // add HTTP headers to the request.
  7564. func (c *AccountsContainersVersionsUndeleteCall) Header() http.Header {
  7565. if c.header_ == nil {
  7566. c.header_ = make(http.Header)
  7567. }
  7568. return c.header_
  7569. }
  7570. func (c *AccountsContainersVersionsUndeleteCall) doRequest(alt string) (*http.Response, error) {
  7571. reqHeaders := make(http.Header)
  7572. for k, v := range c.header_ {
  7573. reqHeaders[k] = v
  7574. }
  7575. reqHeaders.Set("User-Agent", c.s.userAgent())
  7576. var body io.Reader = nil
  7577. c.urlParams_.Set("alt", alt)
  7578. c.urlParams_.Set("prettyPrint", "false")
  7579. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete")
  7580. urls += "?" + c.urlParams_.Encode()
  7581. req, err := http.NewRequest("POST", urls, body)
  7582. if err != nil {
  7583. return nil, err
  7584. }
  7585. req.Header = reqHeaders
  7586. googleapi.Expand(req.URL, map[string]string{
  7587. "accountId": c.accountId,
  7588. "containerId": c.containerId,
  7589. "containerVersionId": c.containerVersionId,
  7590. })
  7591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7592. }
  7593. // Do executes the "tagmanager.accounts.containers.versions.undelete" call.
  7594. // Exactly one of *ContainerVersion or error will be non-nil. Any
  7595. // non-2xx status code is an error. Response headers are in either
  7596. // *ContainerVersion.ServerResponse.Header or (if a response was
  7597. // returned at all) in error.(*googleapi.Error).Header. Use
  7598. // googleapi.IsNotModified to check whether the returned error was
  7599. // because http.StatusNotModified was returned.
  7600. func (c *AccountsContainersVersionsUndeleteCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  7601. gensupport.SetOptions(c.urlParams_, opts...)
  7602. res, err := c.doRequest("json")
  7603. if res != nil && res.StatusCode == http.StatusNotModified {
  7604. if res.Body != nil {
  7605. res.Body.Close()
  7606. }
  7607. return nil, &googleapi.Error{
  7608. Code: res.StatusCode,
  7609. Header: res.Header,
  7610. }
  7611. }
  7612. if err != nil {
  7613. return nil, err
  7614. }
  7615. defer googleapi.CloseBody(res)
  7616. if err := googleapi.CheckResponse(res); err != nil {
  7617. return nil, err
  7618. }
  7619. ret := &ContainerVersion{
  7620. ServerResponse: googleapi.ServerResponse{
  7621. Header: res.Header,
  7622. HTTPStatusCode: res.StatusCode,
  7623. },
  7624. }
  7625. target := &ret
  7626. if err := gensupport.DecodeResponse(target, res); err != nil {
  7627. return nil, err
  7628. }
  7629. return ret, nil
  7630. // {
  7631. // "description": "Undeletes a Container Version.",
  7632. // "httpMethod": "POST",
  7633. // "id": "tagmanager.accounts.containers.versions.undelete",
  7634. // "parameterOrder": [
  7635. // "accountId",
  7636. // "containerId",
  7637. // "containerVersionId"
  7638. // ],
  7639. // "parameters": {
  7640. // "accountId": {
  7641. // "description": "The GTM Account ID.",
  7642. // "location": "path",
  7643. // "required": true,
  7644. // "type": "string"
  7645. // },
  7646. // "containerId": {
  7647. // "description": "The GTM Container ID.",
  7648. // "location": "path",
  7649. // "required": true,
  7650. // "type": "string"
  7651. // },
  7652. // "containerVersionId": {
  7653. // "description": "The GTM Container Version ID.",
  7654. // "location": "path",
  7655. // "required": true,
  7656. // "type": "string"
  7657. // }
  7658. // },
  7659. // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete",
  7660. // "response": {
  7661. // "$ref": "ContainerVersion"
  7662. // },
  7663. // "scopes": [
  7664. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  7665. // ]
  7666. // }
  7667. }
  7668. // method id "tagmanager.accounts.containers.versions.update":
  7669. type AccountsContainersVersionsUpdateCall struct {
  7670. s *Service
  7671. accountId string
  7672. containerId string
  7673. containerVersionId string
  7674. containerversion *ContainerVersion
  7675. urlParams_ gensupport.URLParams
  7676. ctx_ context.Context
  7677. header_ http.Header
  7678. }
  7679. // Update: Updates a Container Version.
  7680. func (r *AccountsContainersVersionsService) Update(accountId string, containerId string, containerVersionId string, containerversion *ContainerVersion) *AccountsContainersVersionsUpdateCall {
  7681. c := &AccountsContainersVersionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7682. c.accountId = accountId
  7683. c.containerId = containerId
  7684. c.containerVersionId = containerVersionId
  7685. c.containerversion = containerversion
  7686. return c
  7687. }
  7688. // Fingerprint sets the optional parameter "fingerprint": When provided,
  7689. // this fingerprint must match the fingerprint of the container version
  7690. // in storage.
  7691. func (c *AccountsContainersVersionsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersVersionsUpdateCall {
  7692. c.urlParams_.Set("fingerprint", fingerprint)
  7693. return c
  7694. }
  7695. // Fields allows partial responses to be retrieved. See
  7696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7697. // for more information.
  7698. func (c *AccountsContainersVersionsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUpdateCall {
  7699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7700. return c
  7701. }
  7702. // Context sets the context to be used in this call's Do method. Any
  7703. // pending HTTP request will be aborted if the provided context is
  7704. // canceled.
  7705. func (c *AccountsContainersVersionsUpdateCall) Context(ctx context.Context) *AccountsContainersVersionsUpdateCall {
  7706. c.ctx_ = ctx
  7707. return c
  7708. }
  7709. // Header returns an http.Header that can be modified by the caller to
  7710. // add HTTP headers to the request.
  7711. func (c *AccountsContainersVersionsUpdateCall) Header() http.Header {
  7712. if c.header_ == nil {
  7713. c.header_ = make(http.Header)
  7714. }
  7715. return c.header_
  7716. }
  7717. func (c *AccountsContainersVersionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7718. reqHeaders := make(http.Header)
  7719. for k, v := range c.header_ {
  7720. reqHeaders[k] = v
  7721. }
  7722. reqHeaders.Set("User-Agent", c.s.userAgent())
  7723. var body io.Reader = nil
  7724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerversion)
  7725. if err != nil {
  7726. return nil, err
  7727. }
  7728. reqHeaders.Set("Content-Type", "application/json")
  7729. c.urlParams_.Set("alt", alt)
  7730. c.urlParams_.Set("prettyPrint", "false")
  7731. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}")
  7732. urls += "?" + c.urlParams_.Encode()
  7733. req, err := http.NewRequest("PUT", urls, body)
  7734. if err != nil {
  7735. return nil, err
  7736. }
  7737. req.Header = reqHeaders
  7738. googleapi.Expand(req.URL, map[string]string{
  7739. "accountId": c.accountId,
  7740. "containerId": c.containerId,
  7741. "containerVersionId": c.containerVersionId,
  7742. })
  7743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7744. }
  7745. // Do executes the "tagmanager.accounts.containers.versions.update" call.
  7746. // Exactly one of *ContainerVersion or error will be non-nil. Any
  7747. // non-2xx status code is an error. Response headers are in either
  7748. // *ContainerVersion.ServerResponse.Header or (if a response was
  7749. // returned at all) in error.(*googleapi.Error).Header. Use
  7750. // googleapi.IsNotModified to check whether the returned error was
  7751. // because http.StatusNotModified was returned.
  7752. func (c *AccountsContainersVersionsUpdateCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  7753. gensupport.SetOptions(c.urlParams_, opts...)
  7754. res, err := c.doRequest("json")
  7755. if res != nil && res.StatusCode == http.StatusNotModified {
  7756. if res.Body != nil {
  7757. res.Body.Close()
  7758. }
  7759. return nil, &googleapi.Error{
  7760. Code: res.StatusCode,
  7761. Header: res.Header,
  7762. }
  7763. }
  7764. if err != nil {
  7765. return nil, err
  7766. }
  7767. defer googleapi.CloseBody(res)
  7768. if err := googleapi.CheckResponse(res); err != nil {
  7769. return nil, err
  7770. }
  7771. ret := &ContainerVersion{
  7772. ServerResponse: googleapi.ServerResponse{
  7773. Header: res.Header,
  7774. HTTPStatusCode: res.StatusCode,
  7775. },
  7776. }
  7777. target := &ret
  7778. if err := gensupport.DecodeResponse(target, res); err != nil {
  7779. return nil, err
  7780. }
  7781. return ret, nil
  7782. // {
  7783. // "description": "Updates a Container Version.",
  7784. // "httpMethod": "PUT",
  7785. // "id": "tagmanager.accounts.containers.versions.update",
  7786. // "parameterOrder": [
  7787. // "accountId",
  7788. // "containerId",
  7789. // "containerVersionId"
  7790. // ],
  7791. // "parameters": {
  7792. // "accountId": {
  7793. // "description": "The GTM Account ID.",
  7794. // "location": "path",
  7795. // "required": true,
  7796. // "type": "string"
  7797. // },
  7798. // "containerId": {
  7799. // "description": "The GTM Container ID.",
  7800. // "location": "path",
  7801. // "required": true,
  7802. // "type": "string"
  7803. // },
  7804. // "containerVersionId": {
  7805. // "description": "The GTM Container Version ID.",
  7806. // "location": "path",
  7807. // "required": true,
  7808. // "type": "string"
  7809. // },
  7810. // "fingerprint": {
  7811. // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.",
  7812. // "location": "query",
  7813. // "type": "string"
  7814. // }
  7815. // },
  7816. // "path": "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}",
  7817. // "request": {
  7818. // "$ref": "ContainerVersion"
  7819. // },
  7820. // "response": {
  7821. // "$ref": "ContainerVersion"
  7822. // },
  7823. // "scopes": [
  7824. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  7825. // ]
  7826. // }
  7827. }
  7828. // method id "tagmanager.accounts.permissions.create":
  7829. type AccountsPermissionsCreateCall struct {
  7830. s *Service
  7831. accountId string
  7832. useraccess *UserAccess
  7833. urlParams_ gensupport.URLParams
  7834. ctx_ context.Context
  7835. header_ http.Header
  7836. }
  7837. // Create: Creates a user's Account & Container Permissions.
  7838. func (r *AccountsPermissionsService) Create(accountId string, useraccess *UserAccess) *AccountsPermissionsCreateCall {
  7839. c := &AccountsPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7840. c.accountId = accountId
  7841. c.useraccess = useraccess
  7842. return c
  7843. }
  7844. // Fields allows partial responses to be retrieved. See
  7845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7846. // for more information.
  7847. func (c *AccountsPermissionsCreateCall) Fields(s ...googleapi.Field) *AccountsPermissionsCreateCall {
  7848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7849. return c
  7850. }
  7851. // Context sets the context to be used in this call's Do method. Any
  7852. // pending HTTP request will be aborted if the provided context is
  7853. // canceled.
  7854. func (c *AccountsPermissionsCreateCall) Context(ctx context.Context) *AccountsPermissionsCreateCall {
  7855. c.ctx_ = ctx
  7856. return c
  7857. }
  7858. // Header returns an http.Header that can be modified by the caller to
  7859. // add HTTP headers to the request.
  7860. func (c *AccountsPermissionsCreateCall) Header() http.Header {
  7861. if c.header_ == nil {
  7862. c.header_ = make(http.Header)
  7863. }
  7864. return c.header_
  7865. }
  7866. func (c *AccountsPermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
  7867. reqHeaders := make(http.Header)
  7868. for k, v := range c.header_ {
  7869. reqHeaders[k] = v
  7870. }
  7871. reqHeaders.Set("User-Agent", c.s.userAgent())
  7872. var body io.Reader = nil
  7873. body, err := googleapi.WithoutDataWrapper.JSONReader(c.useraccess)
  7874. if err != nil {
  7875. return nil, err
  7876. }
  7877. reqHeaders.Set("Content-Type", "application/json")
  7878. c.urlParams_.Set("alt", alt)
  7879. c.urlParams_.Set("prettyPrint", "false")
  7880. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions")
  7881. urls += "?" + c.urlParams_.Encode()
  7882. req, err := http.NewRequest("POST", urls, body)
  7883. if err != nil {
  7884. return nil, err
  7885. }
  7886. req.Header = reqHeaders
  7887. googleapi.Expand(req.URL, map[string]string{
  7888. "accountId": c.accountId,
  7889. })
  7890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7891. }
  7892. // Do executes the "tagmanager.accounts.permissions.create" call.
  7893. // Exactly one of *UserAccess or error will be non-nil. Any non-2xx
  7894. // status code is an error. Response headers are in either
  7895. // *UserAccess.ServerResponse.Header or (if a response was returned at
  7896. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7897. // to check whether the returned error was because
  7898. // http.StatusNotModified was returned.
  7899. func (c *AccountsPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*UserAccess, error) {
  7900. gensupport.SetOptions(c.urlParams_, opts...)
  7901. res, err := c.doRequest("json")
  7902. if res != nil && res.StatusCode == http.StatusNotModified {
  7903. if res.Body != nil {
  7904. res.Body.Close()
  7905. }
  7906. return nil, &googleapi.Error{
  7907. Code: res.StatusCode,
  7908. Header: res.Header,
  7909. }
  7910. }
  7911. if err != nil {
  7912. return nil, err
  7913. }
  7914. defer googleapi.CloseBody(res)
  7915. if err := googleapi.CheckResponse(res); err != nil {
  7916. return nil, err
  7917. }
  7918. ret := &UserAccess{
  7919. ServerResponse: googleapi.ServerResponse{
  7920. Header: res.Header,
  7921. HTTPStatusCode: res.StatusCode,
  7922. },
  7923. }
  7924. target := &ret
  7925. if err := gensupport.DecodeResponse(target, res); err != nil {
  7926. return nil, err
  7927. }
  7928. return ret, nil
  7929. // {
  7930. // "description": "Creates a user's Account \u0026 Container Permissions.",
  7931. // "httpMethod": "POST",
  7932. // "id": "tagmanager.accounts.permissions.create",
  7933. // "parameterOrder": [
  7934. // "accountId"
  7935. // ],
  7936. // "parameters": {
  7937. // "accountId": {
  7938. // "description": "The GTM Account ID.",
  7939. // "location": "path",
  7940. // "required": true,
  7941. // "type": "string"
  7942. // }
  7943. // },
  7944. // "path": "accounts/{accountId}/permissions",
  7945. // "request": {
  7946. // "$ref": "UserAccess"
  7947. // },
  7948. // "response": {
  7949. // "$ref": "UserAccess"
  7950. // },
  7951. // "scopes": [
  7952. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  7953. // ]
  7954. // }
  7955. }
  7956. // method id "tagmanager.accounts.permissions.delete":
  7957. type AccountsPermissionsDeleteCall struct {
  7958. s *Service
  7959. accountId string
  7960. permissionId string
  7961. urlParams_ gensupport.URLParams
  7962. ctx_ context.Context
  7963. header_ http.Header
  7964. }
  7965. // Delete: Removes a user from the account, revoking access to it and
  7966. // all of its containers.
  7967. func (r *AccountsPermissionsService) Delete(accountId string, permissionId string) *AccountsPermissionsDeleteCall {
  7968. c := &AccountsPermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7969. c.accountId = accountId
  7970. c.permissionId = permissionId
  7971. return c
  7972. }
  7973. // Fields allows partial responses to be retrieved. See
  7974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7975. // for more information.
  7976. func (c *AccountsPermissionsDeleteCall) Fields(s ...googleapi.Field) *AccountsPermissionsDeleteCall {
  7977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7978. return c
  7979. }
  7980. // Context sets the context to be used in this call's Do method. Any
  7981. // pending HTTP request will be aborted if the provided context is
  7982. // canceled.
  7983. func (c *AccountsPermissionsDeleteCall) Context(ctx context.Context) *AccountsPermissionsDeleteCall {
  7984. c.ctx_ = ctx
  7985. return c
  7986. }
  7987. // Header returns an http.Header that can be modified by the caller to
  7988. // add HTTP headers to the request.
  7989. func (c *AccountsPermissionsDeleteCall) Header() http.Header {
  7990. if c.header_ == nil {
  7991. c.header_ = make(http.Header)
  7992. }
  7993. return c.header_
  7994. }
  7995. func (c *AccountsPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7996. reqHeaders := make(http.Header)
  7997. for k, v := range c.header_ {
  7998. reqHeaders[k] = v
  7999. }
  8000. reqHeaders.Set("User-Agent", c.s.userAgent())
  8001. var body io.Reader = nil
  8002. c.urlParams_.Set("alt", alt)
  8003. c.urlParams_.Set("prettyPrint", "false")
  8004. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions/{permissionId}")
  8005. urls += "?" + c.urlParams_.Encode()
  8006. req, err := http.NewRequest("DELETE", urls, body)
  8007. if err != nil {
  8008. return nil, err
  8009. }
  8010. req.Header = reqHeaders
  8011. googleapi.Expand(req.URL, map[string]string{
  8012. "accountId": c.accountId,
  8013. "permissionId": c.permissionId,
  8014. })
  8015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8016. }
  8017. // Do executes the "tagmanager.accounts.permissions.delete" call.
  8018. func (c *AccountsPermissionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8019. gensupport.SetOptions(c.urlParams_, opts...)
  8020. res, err := c.doRequest("json")
  8021. if err != nil {
  8022. return err
  8023. }
  8024. defer googleapi.CloseBody(res)
  8025. if err := googleapi.CheckResponse(res); err != nil {
  8026. return err
  8027. }
  8028. return nil
  8029. // {
  8030. // "description": "Removes a user from the account, revoking access to it and all of its containers.",
  8031. // "httpMethod": "DELETE",
  8032. // "id": "tagmanager.accounts.permissions.delete",
  8033. // "parameterOrder": [
  8034. // "accountId",
  8035. // "permissionId"
  8036. // ],
  8037. // "parameters": {
  8038. // "accountId": {
  8039. // "description": "The GTM Account ID.",
  8040. // "location": "path",
  8041. // "required": true,
  8042. // "type": "string"
  8043. // },
  8044. // "permissionId": {
  8045. // "description": "The GTM User ID.",
  8046. // "location": "path",
  8047. // "required": true,
  8048. // "type": "string"
  8049. // }
  8050. // },
  8051. // "path": "accounts/{accountId}/permissions/{permissionId}",
  8052. // "scopes": [
  8053. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  8054. // ]
  8055. // }
  8056. }
  8057. // method id "tagmanager.accounts.permissions.get":
  8058. type AccountsPermissionsGetCall struct {
  8059. s *Service
  8060. accountId string
  8061. permissionId string
  8062. urlParams_ gensupport.URLParams
  8063. ifNoneMatch_ string
  8064. ctx_ context.Context
  8065. header_ http.Header
  8066. }
  8067. // Get: Gets a user's Account & Container Permissions.
  8068. func (r *AccountsPermissionsService) Get(accountId string, permissionId string) *AccountsPermissionsGetCall {
  8069. c := &AccountsPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8070. c.accountId = accountId
  8071. c.permissionId = permissionId
  8072. return c
  8073. }
  8074. // Fields allows partial responses to be retrieved. See
  8075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8076. // for more information.
  8077. func (c *AccountsPermissionsGetCall) Fields(s ...googleapi.Field) *AccountsPermissionsGetCall {
  8078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8079. return c
  8080. }
  8081. // IfNoneMatch sets the optional parameter which makes the operation
  8082. // fail if the object's ETag matches the given value. This is useful for
  8083. // getting updates only after the object has changed since the last
  8084. // request. Use googleapi.IsNotModified to check whether the response
  8085. // error from Do is the result of In-None-Match.
  8086. func (c *AccountsPermissionsGetCall) IfNoneMatch(entityTag string) *AccountsPermissionsGetCall {
  8087. c.ifNoneMatch_ = entityTag
  8088. return c
  8089. }
  8090. // Context sets the context to be used in this call's Do method. Any
  8091. // pending HTTP request will be aborted if the provided context is
  8092. // canceled.
  8093. func (c *AccountsPermissionsGetCall) Context(ctx context.Context) *AccountsPermissionsGetCall {
  8094. c.ctx_ = ctx
  8095. return c
  8096. }
  8097. // Header returns an http.Header that can be modified by the caller to
  8098. // add HTTP headers to the request.
  8099. func (c *AccountsPermissionsGetCall) Header() http.Header {
  8100. if c.header_ == nil {
  8101. c.header_ = make(http.Header)
  8102. }
  8103. return c.header_
  8104. }
  8105. func (c *AccountsPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  8106. reqHeaders := make(http.Header)
  8107. for k, v := range c.header_ {
  8108. reqHeaders[k] = v
  8109. }
  8110. reqHeaders.Set("User-Agent", c.s.userAgent())
  8111. if c.ifNoneMatch_ != "" {
  8112. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8113. }
  8114. var body io.Reader = nil
  8115. c.urlParams_.Set("alt", alt)
  8116. c.urlParams_.Set("prettyPrint", "false")
  8117. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions/{permissionId}")
  8118. urls += "?" + c.urlParams_.Encode()
  8119. req, err := http.NewRequest("GET", urls, body)
  8120. if err != nil {
  8121. return nil, err
  8122. }
  8123. req.Header = reqHeaders
  8124. googleapi.Expand(req.URL, map[string]string{
  8125. "accountId": c.accountId,
  8126. "permissionId": c.permissionId,
  8127. })
  8128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8129. }
  8130. // Do executes the "tagmanager.accounts.permissions.get" call.
  8131. // Exactly one of *UserAccess or error will be non-nil. Any non-2xx
  8132. // status code is an error. Response headers are in either
  8133. // *UserAccess.ServerResponse.Header or (if a response was returned at
  8134. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8135. // to check whether the returned error was because
  8136. // http.StatusNotModified was returned.
  8137. func (c *AccountsPermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserAccess, error) {
  8138. gensupport.SetOptions(c.urlParams_, opts...)
  8139. res, err := c.doRequest("json")
  8140. if res != nil && res.StatusCode == http.StatusNotModified {
  8141. if res.Body != nil {
  8142. res.Body.Close()
  8143. }
  8144. return nil, &googleapi.Error{
  8145. Code: res.StatusCode,
  8146. Header: res.Header,
  8147. }
  8148. }
  8149. if err != nil {
  8150. return nil, err
  8151. }
  8152. defer googleapi.CloseBody(res)
  8153. if err := googleapi.CheckResponse(res); err != nil {
  8154. return nil, err
  8155. }
  8156. ret := &UserAccess{
  8157. ServerResponse: googleapi.ServerResponse{
  8158. Header: res.Header,
  8159. HTTPStatusCode: res.StatusCode,
  8160. },
  8161. }
  8162. target := &ret
  8163. if err := gensupport.DecodeResponse(target, res); err != nil {
  8164. return nil, err
  8165. }
  8166. return ret, nil
  8167. // {
  8168. // "description": "Gets a user's Account \u0026 Container Permissions.",
  8169. // "httpMethod": "GET",
  8170. // "id": "tagmanager.accounts.permissions.get",
  8171. // "parameterOrder": [
  8172. // "accountId",
  8173. // "permissionId"
  8174. // ],
  8175. // "parameters": {
  8176. // "accountId": {
  8177. // "description": "The GTM Account ID.",
  8178. // "location": "path",
  8179. // "required": true,
  8180. // "type": "string"
  8181. // },
  8182. // "permissionId": {
  8183. // "description": "The GTM User ID.",
  8184. // "location": "path",
  8185. // "required": true,
  8186. // "type": "string"
  8187. // }
  8188. // },
  8189. // "path": "accounts/{accountId}/permissions/{permissionId}",
  8190. // "response": {
  8191. // "$ref": "UserAccess"
  8192. // },
  8193. // "scopes": [
  8194. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  8195. // ]
  8196. // }
  8197. }
  8198. // method id "tagmanager.accounts.permissions.list":
  8199. type AccountsPermissionsListCall struct {
  8200. s *Service
  8201. accountId string
  8202. urlParams_ gensupport.URLParams
  8203. ifNoneMatch_ string
  8204. ctx_ context.Context
  8205. header_ http.Header
  8206. }
  8207. // List: List all users that have access to the account along with
  8208. // Account and Container Permissions granted to each of them.
  8209. func (r *AccountsPermissionsService) List(accountId string) *AccountsPermissionsListCall {
  8210. c := &AccountsPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8211. c.accountId = accountId
  8212. return c
  8213. }
  8214. // Fields allows partial responses to be retrieved. See
  8215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8216. // for more information.
  8217. func (c *AccountsPermissionsListCall) Fields(s ...googleapi.Field) *AccountsPermissionsListCall {
  8218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8219. return c
  8220. }
  8221. // IfNoneMatch sets the optional parameter which makes the operation
  8222. // fail if the object's ETag matches the given value. This is useful for
  8223. // getting updates only after the object has changed since the last
  8224. // request. Use googleapi.IsNotModified to check whether the response
  8225. // error from Do is the result of In-None-Match.
  8226. func (c *AccountsPermissionsListCall) IfNoneMatch(entityTag string) *AccountsPermissionsListCall {
  8227. c.ifNoneMatch_ = entityTag
  8228. return c
  8229. }
  8230. // Context sets the context to be used in this call's Do method. Any
  8231. // pending HTTP request will be aborted if the provided context is
  8232. // canceled.
  8233. func (c *AccountsPermissionsListCall) Context(ctx context.Context) *AccountsPermissionsListCall {
  8234. c.ctx_ = ctx
  8235. return c
  8236. }
  8237. // Header returns an http.Header that can be modified by the caller to
  8238. // add HTTP headers to the request.
  8239. func (c *AccountsPermissionsListCall) Header() http.Header {
  8240. if c.header_ == nil {
  8241. c.header_ = make(http.Header)
  8242. }
  8243. return c.header_
  8244. }
  8245. func (c *AccountsPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  8246. reqHeaders := make(http.Header)
  8247. for k, v := range c.header_ {
  8248. reqHeaders[k] = v
  8249. }
  8250. reqHeaders.Set("User-Agent", c.s.userAgent())
  8251. if c.ifNoneMatch_ != "" {
  8252. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8253. }
  8254. var body io.Reader = nil
  8255. c.urlParams_.Set("alt", alt)
  8256. c.urlParams_.Set("prettyPrint", "false")
  8257. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions")
  8258. urls += "?" + c.urlParams_.Encode()
  8259. req, err := http.NewRequest("GET", urls, body)
  8260. if err != nil {
  8261. return nil, err
  8262. }
  8263. req.Header = reqHeaders
  8264. googleapi.Expand(req.URL, map[string]string{
  8265. "accountId": c.accountId,
  8266. })
  8267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8268. }
  8269. // Do executes the "tagmanager.accounts.permissions.list" call.
  8270. // Exactly one of *ListAccountUsersResponse or error will be non-nil.
  8271. // Any non-2xx status code is an error. Response headers are in either
  8272. // *ListAccountUsersResponse.ServerResponse.Header or (if a response was
  8273. // returned at all) in error.(*googleapi.Error).Header. Use
  8274. // googleapi.IsNotModified to check whether the returned error was
  8275. // because http.StatusNotModified was returned.
  8276. func (c *AccountsPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListAccountUsersResponse, error) {
  8277. gensupport.SetOptions(c.urlParams_, opts...)
  8278. res, err := c.doRequest("json")
  8279. if res != nil && res.StatusCode == http.StatusNotModified {
  8280. if res.Body != nil {
  8281. res.Body.Close()
  8282. }
  8283. return nil, &googleapi.Error{
  8284. Code: res.StatusCode,
  8285. Header: res.Header,
  8286. }
  8287. }
  8288. if err != nil {
  8289. return nil, err
  8290. }
  8291. defer googleapi.CloseBody(res)
  8292. if err := googleapi.CheckResponse(res); err != nil {
  8293. return nil, err
  8294. }
  8295. ret := &ListAccountUsersResponse{
  8296. ServerResponse: googleapi.ServerResponse{
  8297. Header: res.Header,
  8298. HTTPStatusCode: res.StatusCode,
  8299. },
  8300. }
  8301. target := &ret
  8302. if err := gensupport.DecodeResponse(target, res); err != nil {
  8303. return nil, err
  8304. }
  8305. return ret, nil
  8306. // {
  8307. // "description": "List all users that have access to the account along with Account and Container Permissions granted to each of them.",
  8308. // "httpMethod": "GET",
  8309. // "id": "tagmanager.accounts.permissions.list",
  8310. // "parameterOrder": [
  8311. // "accountId"
  8312. // ],
  8313. // "parameters": {
  8314. // "accountId": {
  8315. // "description": "The GTM Account ID. @required tagmanager.accounts.permissions.list",
  8316. // "location": "path",
  8317. // "required": true,
  8318. // "type": "string"
  8319. // }
  8320. // },
  8321. // "path": "accounts/{accountId}/permissions",
  8322. // "response": {
  8323. // "$ref": "ListAccountUsersResponse"
  8324. // },
  8325. // "scopes": [
  8326. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  8327. // ]
  8328. // }
  8329. }
  8330. // method id "tagmanager.accounts.permissions.update":
  8331. type AccountsPermissionsUpdateCall struct {
  8332. s *Service
  8333. accountId string
  8334. permissionId string
  8335. useraccess *UserAccess
  8336. urlParams_ gensupport.URLParams
  8337. ctx_ context.Context
  8338. header_ http.Header
  8339. }
  8340. // Update: Updates a user's Account & Container Permissions.
  8341. func (r *AccountsPermissionsService) Update(accountId string, permissionId string, useraccess *UserAccess) *AccountsPermissionsUpdateCall {
  8342. c := &AccountsPermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8343. c.accountId = accountId
  8344. c.permissionId = permissionId
  8345. c.useraccess = useraccess
  8346. return c
  8347. }
  8348. // Fields allows partial responses to be retrieved. See
  8349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8350. // for more information.
  8351. func (c *AccountsPermissionsUpdateCall) Fields(s ...googleapi.Field) *AccountsPermissionsUpdateCall {
  8352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8353. return c
  8354. }
  8355. // Context sets the context to be used in this call's Do method. Any
  8356. // pending HTTP request will be aborted if the provided context is
  8357. // canceled.
  8358. func (c *AccountsPermissionsUpdateCall) Context(ctx context.Context) *AccountsPermissionsUpdateCall {
  8359. c.ctx_ = ctx
  8360. return c
  8361. }
  8362. // Header returns an http.Header that can be modified by the caller to
  8363. // add HTTP headers to the request.
  8364. func (c *AccountsPermissionsUpdateCall) Header() http.Header {
  8365. if c.header_ == nil {
  8366. c.header_ = make(http.Header)
  8367. }
  8368. return c.header_
  8369. }
  8370. func (c *AccountsPermissionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8371. reqHeaders := make(http.Header)
  8372. for k, v := range c.header_ {
  8373. reqHeaders[k] = v
  8374. }
  8375. reqHeaders.Set("User-Agent", c.s.userAgent())
  8376. var body io.Reader = nil
  8377. body, err := googleapi.WithoutDataWrapper.JSONReader(c.useraccess)
  8378. if err != nil {
  8379. return nil, err
  8380. }
  8381. reqHeaders.Set("Content-Type", "application/json")
  8382. c.urlParams_.Set("alt", alt)
  8383. c.urlParams_.Set("prettyPrint", "false")
  8384. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/permissions/{permissionId}")
  8385. urls += "?" + c.urlParams_.Encode()
  8386. req, err := http.NewRequest("PUT", urls, body)
  8387. if err != nil {
  8388. return nil, err
  8389. }
  8390. req.Header = reqHeaders
  8391. googleapi.Expand(req.URL, map[string]string{
  8392. "accountId": c.accountId,
  8393. "permissionId": c.permissionId,
  8394. })
  8395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8396. }
  8397. // Do executes the "tagmanager.accounts.permissions.update" call.
  8398. // Exactly one of *UserAccess or error will be non-nil. Any non-2xx
  8399. // status code is an error. Response headers are in either
  8400. // *UserAccess.ServerResponse.Header or (if a response was returned at
  8401. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8402. // to check whether the returned error was because
  8403. // http.StatusNotModified was returned.
  8404. func (c *AccountsPermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*UserAccess, error) {
  8405. gensupport.SetOptions(c.urlParams_, opts...)
  8406. res, err := c.doRequest("json")
  8407. if res != nil && res.StatusCode == http.StatusNotModified {
  8408. if res.Body != nil {
  8409. res.Body.Close()
  8410. }
  8411. return nil, &googleapi.Error{
  8412. Code: res.StatusCode,
  8413. Header: res.Header,
  8414. }
  8415. }
  8416. if err != nil {
  8417. return nil, err
  8418. }
  8419. defer googleapi.CloseBody(res)
  8420. if err := googleapi.CheckResponse(res); err != nil {
  8421. return nil, err
  8422. }
  8423. ret := &UserAccess{
  8424. ServerResponse: googleapi.ServerResponse{
  8425. Header: res.Header,
  8426. HTTPStatusCode: res.StatusCode,
  8427. },
  8428. }
  8429. target := &ret
  8430. if err := gensupport.DecodeResponse(target, res); err != nil {
  8431. return nil, err
  8432. }
  8433. return ret, nil
  8434. // {
  8435. // "description": "Updates a user's Account \u0026 Container Permissions.",
  8436. // "httpMethod": "PUT",
  8437. // "id": "tagmanager.accounts.permissions.update",
  8438. // "parameterOrder": [
  8439. // "accountId",
  8440. // "permissionId"
  8441. // ],
  8442. // "parameters": {
  8443. // "accountId": {
  8444. // "description": "The GTM Account ID.",
  8445. // "location": "path",
  8446. // "required": true,
  8447. // "type": "string"
  8448. // },
  8449. // "permissionId": {
  8450. // "description": "The GTM User ID.",
  8451. // "location": "path",
  8452. // "required": true,
  8453. // "type": "string"
  8454. // }
  8455. // },
  8456. // "path": "accounts/{accountId}/permissions/{permissionId}",
  8457. // "request": {
  8458. // "$ref": "UserAccess"
  8459. // },
  8460. // "response": {
  8461. // "$ref": "UserAccess"
  8462. // },
  8463. // "scopes": [
  8464. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  8465. // ]
  8466. // }
  8467. }