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.
 
 
 

9192 lines
301 KiB

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