選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

14037 行
468 KiB

  1. // Package tagmanager provides access to the Tag Manager API.
  2. //
  3. // See https://developers.google.com/tag-manager/api/v2/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/tagmanager/v2"
  8. // ...
  9. // tagmanagerService, err := tagmanager.New(oauthHttpClient)
  10. package tagmanager // import "google.golang.org/api/tagmanager/v2"
  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:v2"
  41. const apiName = "tagmanager"
  42. const apiVersion = "v2"
  43. const basePath = "https://www.googleapis.com/tagmanager/v2/"
  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.UserPermissions = NewAccountsUserPermissionsService(s)
  87. return rs
  88. }
  89. type AccountsService struct {
  90. s *Service
  91. Containers *AccountsContainersService
  92. UserPermissions *AccountsUserPermissionsService
  93. }
  94. func NewAccountsContainersService(s *Service) *AccountsContainersService {
  95. rs := &AccountsContainersService{s: s}
  96. rs.Environments = NewAccountsContainersEnvironmentsService(s)
  97. rs.VersionHeaders = NewAccountsContainersVersionHeadersService(s)
  98. rs.Versions = NewAccountsContainersVersionsService(s)
  99. rs.Workspaces = NewAccountsContainersWorkspacesService(s)
  100. return rs
  101. }
  102. type AccountsContainersService struct {
  103. s *Service
  104. Environments *AccountsContainersEnvironmentsService
  105. VersionHeaders *AccountsContainersVersionHeadersService
  106. Versions *AccountsContainersVersionsService
  107. Workspaces *AccountsContainersWorkspacesService
  108. }
  109. func NewAccountsContainersEnvironmentsService(s *Service) *AccountsContainersEnvironmentsService {
  110. rs := &AccountsContainersEnvironmentsService{s: s}
  111. return rs
  112. }
  113. type AccountsContainersEnvironmentsService struct {
  114. s *Service
  115. }
  116. func NewAccountsContainersVersionHeadersService(s *Service) *AccountsContainersVersionHeadersService {
  117. rs := &AccountsContainersVersionHeadersService{s: s}
  118. return rs
  119. }
  120. type AccountsContainersVersionHeadersService struct {
  121. s *Service
  122. }
  123. func NewAccountsContainersVersionsService(s *Service) *AccountsContainersVersionsService {
  124. rs := &AccountsContainersVersionsService{s: s}
  125. return rs
  126. }
  127. type AccountsContainersVersionsService struct {
  128. s *Service
  129. }
  130. func NewAccountsContainersWorkspacesService(s *Service) *AccountsContainersWorkspacesService {
  131. rs := &AccountsContainersWorkspacesService{s: s}
  132. rs.BuiltInVariables = NewAccountsContainersWorkspacesBuiltInVariablesService(s)
  133. rs.Folders = NewAccountsContainersWorkspacesFoldersService(s)
  134. rs.Proposal = NewAccountsContainersWorkspacesProposalService(s)
  135. rs.Tags = NewAccountsContainersWorkspacesTagsService(s)
  136. rs.Triggers = NewAccountsContainersWorkspacesTriggersService(s)
  137. rs.Variables = NewAccountsContainersWorkspacesVariablesService(s)
  138. return rs
  139. }
  140. type AccountsContainersWorkspacesService struct {
  141. s *Service
  142. BuiltInVariables *AccountsContainersWorkspacesBuiltInVariablesService
  143. Folders *AccountsContainersWorkspacesFoldersService
  144. Proposal *AccountsContainersWorkspacesProposalService
  145. Tags *AccountsContainersWorkspacesTagsService
  146. Triggers *AccountsContainersWorkspacesTriggersService
  147. Variables *AccountsContainersWorkspacesVariablesService
  148. }
  149. func NewAccountsContainersWorkspacesBuiltInVariablesService(s *Service) *AccountsContainersWorkspacesBuiltInVariablesService {
  150. rs := &AccountsContainersWorkspacesBuiltInVariablesService{s: s}
  151. return rs
  152. }
  153. type AccountsContainersWorkspacesBuiltInVariablesService struct {
  154. s *Service
  155. }
  156. func NewAccountsContainersWorkspacesFoldersService(s *Service) *AccountsContainersWorkspacesFoldersService {
  157. rs := &AccountsContainersWorkspacesFoldersService{s: s}
  158. return rs
  159. }
  160. type AccountsContainersWorkspacesFoldersService struct {
  161. s *Service
  162. }
  163. func NewAccountsContainersWorkspacesProposalService(s *Service) *AccountsContainersWorkspacesProposalService {
  164. rs := &AccountsContainersWorkspacesProposalService{s: s}
  165. return rs
  166. }
  167. type AccountsContainersWorkspacesProposalService struct {
  168. s *Service
  169. }
  170. func NewAccountsContainersWorkspacesTagsService(s *Service) *AccountsContainersWorkspacesTagsService {
  171. rs := &AccountsContainersWorkspacesTagsService{s: s}
  172. return rs
  173. }
  174. type AccountsContainersWorkspacesTagsService struct {
  175. s *Service
  176. }
  177. func NewAccountsContainersWorkspacesTriggersService(s *Service) *AccountsContainersWorkspacesTriggersService {
  178. rs := &AccountsContainersWorkspacesTriggersService{s: s}
  179. return rs
  180. }
  181. type AccountsContainersWorkspacesTriggersService struct {
  182. s *Service
  183. }
  184. func NewAccountsContainersWorkspacesVariablesService(s *Service) *AccountsContainersWorkspacesVariablesService {
  185. rs := &AccountsContainersWorkspacesVariablesService{s: s}
  186. return rs
  187. }
  188. type AccountsContainersWorkspacesVariablesService struct {
  189. s *Service
  190. }
  191. func NewAccountsUserPermissionsService(s *Service) *AccountsUserPermissionsService {
  192. rs := &AccountsUserPermissionsService{s: s}
  193. return rs
  194. }
  195. type AccountsUserPermissionsService struct {
  196. s *Service
  197. }
  198. // Account: Represents a Google Tag Manager Account.
  199. type Account struct {
  200. // AccountId: The Account ID uniquely identifies the GTM Account.
  201. AccountId string `json:"accountId,omitempty"`
  202. // Fingerprint: The fingerprint of the GTM Account as computed at
  203. // storage time. This value is recomputed whenever the account is
  204. // modified.
  205. Fingerprint string `json:"fingerprint,omitempty"`
  206. // Name: Account display name.
  207. Name string `json:"name,omitempty"`
  208. // Path: GTM Account's API relative path.
  209. Path string `json:"path,omitempty"`
  210. // ShareData: Whether the account shares data anonymously with Google
  211. // and others. This flag enables benchmarking by sharing your data in an
  212. // anonymous form. Google will remove all identifiable information about
  213. // your website, combine the data with hundreds of other anonymous sites
  214. // and report aggregate trends in the benchmarking service.
  215. ShareData bool `json:"shareData,omitempty"`
  216. // TagManagerUrl: Auto generated link to the tag manager UI
  217. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  218. // ServerResponse contains the HTTP response code and headers from the
  219. // server.
  220. googleapi.ServerResponse `json:"-"`
  221. // ForceSendFields is a list of field names (e.g. "AccountId") to
  222. // unconditionally include in API requests. By default, fields with
  223. // empty values are omitted from API requests. However, any non-pointer,
  224. // non-interface field appearing in ForceSendFields will be sent to the
  225. // server regardless of whether the field is empty or not. This may be
  226. // used to include empty fields in Patch requests.
  227. ForceSendFields []string `json:"-"`
  228. // NullFields is a list of field names (e.g. "AccountId") to include in
  229. // API requests with the JSON null value. By default, fields with empty
  230. // values are omitted from API requests. However, any field with an
  231. // empty value appearing in NullFields will be sent to the server as
  232. // null. It is an error if a field in this list has a non-empty value.
  233. // This may be used to include null fields in Patch requests.
  234. NullFields []string `json:"-"`
  235. }
  236. func (s *Account) MarshalJSON() ([]byte, error) {
  237. type NoMethod Account
  238. raw := NoMethod(*s)
  239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  240. }
  241. // AccountAccess: Defines the Google Tag Manager Account access
  242. // permissions.
  243. type AccountAccess struct {
  244. // Permission: Whether the user has no access, user access, or admin
  245. // access to an account.
  246. //
  247. // Possible values:
  248. // "accountPermissionUnspecified"
  249. // "admin"
  250. // "noAccess"
  251. // "user"
  252. Permission string `json:"permission,omitempty"`
  253. // ForceSendFields is a list of field names (e.g. "Permission") to
  254. // unconditionally include in API requests. By default, fields with
  255. // empty values are omitted from API requests. However, any non-pointer,
  256. // non-interface field appearing in ForceSendFields will be sent to the
  257. // server regardless of whether the field is empty or not. This may be
  258. // used to include empty fields in Patch requests.
  259. ForceSendFields []string `json:"-"`
  260. // NullFields is a list of field names (e.g. "Permission") to include in
  261. // API requests with the JSON null value. By default, fields with empty
  262. // values are omitted from API requests. However, any field with an
  263. // empty value appearing in NullFields will be sent to the server as
  264. // null. It is an error if a field in this list has a non-empty value.
  265. // This may be used to include null fields in Patch requests.
  266. NullFields []string `json:"-"`
  267. }
  268. func (s *AccountAccess) MarshalJSON() ([]byte, error) {
  269. type NoMethod AccountAccess
  270. raw := NoMethod(*s)
  271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  272. }
  273. // BuiltInVariable: Built-in variables are a special category of
  274. // variables that are pre-created and non-customizable. They provide
  275. // common functionality like accessing propeties of the gtm data layer,
  276. // monitoring clicks, or accessing elements of a page URL.
  277. type BuiltInVariable struct {
  278. // AccountId: GTM Account ID.
  279. AccountId string `json:"accountId,omitempty"`
  280. // ContainerId: GTM Container ID.
  281. ContainerId string `json:"containerId,omitempty"`
  282. // Name: Name of the built-in variable to be used to refer to the
  283. // built-in variable.
  284. Name string `json:"name,omitempty"`
  285. // Path: GTM BuiltInVariable's API relative path.
  286. Path string `json:"path,omitempty"`
  287. // Type: Type of built-in variable.
  288. //
  289. // Possible values:
  290. // "advertiserId"
  291. // "advertisingTrackingEnabled"
  292. // "ampBrowserLanguage"
  293. // "ampCanonicalHost"
  294. // "ampCanonicalPath"
  295. // "ampCanonicalUrl"
  296. // "ampClientId"
  297. // "ampClientMaxScrollX"
  298. // "ampClientMaxScrollY"
  299. // "ampClientScreenHeight"
  300. // "ampClientScreenWidth"
  301. // "ampClientScrollX"
  302. // "ampClientScrollY"
  303. // "ampClientTimestamp"
  304. // "ampClientTimezone"
  305. // "ampGtmEvent"
  306. // "ampPageDownloadTime"
  307. // "ampPageLoadTime"
  308. // "ampPageViewId"
  309. // "ampReferrer"
  310. // "ampTitle"
  311. // "ampTotalEngagedTime"
  312. // "appId"
  313. // "appName"
  314. // "appVersionCode"
  315. // "appVersionName"
  316. // "builtInVariableTypeUnspecified"
  317. // "clickClasses"
  318. // "clickElement"
  319. // "clickId"
  320. // "clickTarget"
  321. // "clickText"
  322. // "clickUrl"
  323. // "containerId"
  324. // "containerVersion"
  325. // "debugMode"
  326. // "deviceName"
  327. // "elementVisibilityFirstTime"
  328. // "elementVisibilityRatio"
  329. // "elementVisibilityRecentTime"
  330. // "elementVisibilityTime"
  331. // "environmentName"
  332. // "errorLine"
  333. // "errorMessage"
  334. // "errorUrl"
  335. // "event"
  336. // "eventName"
  337. // "firebaseEventParameterCampaign"
  338. // "firebaseEventParameterCampaignAclid"
  339. // "firebaseEventParameterCampaignAnid"
  340. // "firebaseEventParameterCampaignClickTimestamp"
  341. // "firebaseEventParameterCampaignContent"
  342. // "firebaseEventParameterCampaignCp1"
  343. // "firebaseEventParameterCampaignGclid"
  344. // "firebaseEventParameterCampaignSource"
  345. // "firebaseEventParameterCampaignTerm"
  346. // "firebaseEventParameterCurrency"
  347. // "firebaseEventParameterDynamicLinkAcceptTime"
  348. // "firebaseEventParameterDynamicLinkLinkid"
  349. // "firebaseEventParameterNotificationMessageDeviceTime"
  350. // "firebaseEventParameterNotificationMessageId"
  351. // "firebaseEventParameterNotificationMessageName"
  352. // "firebaseEventParameterNotificationMessageTime"
  353. // "firebaseEventParameterNotificationTopic"
  354. // "firebaseEventParameterPreviousAppVersion"
  355. // "firebaseEventParameterPreviousOsVersion"
  356. // "firebaseEventParameterPrice"
  357. // "firebaseEventParameterProductId"
  358. // "firebaseEventParameterQuantity"
  359. // "firebaseEventParameterValue"
  360. // "formClasses"
  361. // "formElement"
  362. // "formId"
  363. // "formTarget"
  364. // "formText"
  365. // "formUrl"
  366. // "historySource"
  367. // "htmlId"
  368. // "language"
  369. // "newHistoryFragment"
  370. // "newHistoryState"
  371. // "oldHistoryFragment"
  372. // "oldHistoryState"
  373. // "osVersion"
  374. // "pageHostname"
  375. // "pagePath"
  376. // "pageUrl"
  377. // "platform"
  378. // "randomNumber"
  379. // "referrer"
  380. // "resolution"
  381. // "scrollDepthDirection"
  382. // "scrollDepthThreshold"
  383. // "scrollDepthUnits"
  384. // "sdkVersion"
  385. // "videoCurrentTime"
  386. // "videoDuration"
  387. // "videoPercent"
  388. // "videoProvider"
  389. // "videoStatus"
  390. // "videoTitle"
  391. // "videoUrl"
  392. // "videoVisible"
  393. Type string `json:"type,omitempty"`
  394. // WorkspaceId: GTM Workspace ID.
  395. WorkspaceId string `json:"workspaceId,omitempty"`
  396. // ForceSendFields is a list of field names (e.g. "AccountId") to
  397. // unconditionally include in API requests. By default, fields with
  398. // empty values are omitted from API requests. However, any non-pointer,
  399. // non-interface field appearing in ForceSendFields will be sent to the
  400. // server regardless of whether the field is empty or not. This may be
  401. // used to include empty fields in Patch requests.
  402. ForceSendFields []string `json:"-"`
  403. // NullFields is a list of field names (e.g. "AccountId") to include in
  404. // API requests with the JSON null value. By default, fields with empty
  405. // values are omitted from API requests. However, any field with an
  406. // empty value appearing in NullFields will be sent to the server as
  407. // null. It is an error if a field in this list has a non-empty value.
  408. // This may be used to include null fields in Patch requests.
  409. NullFields []string `json:"-"`
  410. }
  411. func (s *BuiltInVariable) MarshalJSON() ([]byte, error) {
  412. type NoMethod BuiltInVariable
  413. raw := NoMethod(*s)
  414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  415. }
  416. // Condition: Represents a predicate.
  417. type Condition struct {
  418. // Parameter: A list of named parameters (key/value), depending on the
  419. // condition's type. Notes:
  420. // - For binary operators, include parameters named arg0 and arg1 for
  421. // specifying the left and right operands, respectively.
  422. // - At this time, the left operand (arg0) must be a reference to a
  423. // variable.
  424. // - For case-insensitive Regex matching, include a boolean parameter
  425. // named ignore_case that is set to true. If not specified or set to any
  426. // other value, the matching will be case sensitive.
  427. // - To negate an operator, include a boolean parameter named negate
  428. // boolean parameter that is set to true.
  429. Parameter []*Parameter `json:"parameter,omitempty"`
  430. // Type: The type of operator for this condition.
  431. //
  432. // Possible values:
  433. // "conditionTypeUnspecified"
  434. // "contains"
  435. // "cssSelector"
  436. // "endsWith"
  437. // "equals"
  438. // "greater"
  439. // "greaterOrEquals"
  440. // "less"
  441. // "lessOrEquals"
  442. // "matchRegex"
  443. // "startsWith"
  444. // "urlMatches"
  445. Type string `json:"type,omitempty"`
  446. // ForceSendFields is a list of field names (e.g. "Parameter") to
  447. // unconditionally include in API requests. By default, fields with
  448. // empty values are omitted from API requests. However, any non-pointer,
  449. // non-interface field appearing in ForceSendFields will be sent to the
  450. // server regardless of whether the field is empty or not. This may be
  451. // used to include empty fields in Patch requests.
  452. ForceSendFields []string `json:"-"`
  453. // NullFields is a list of field names (e.g. "Parameter") to include in
  454. // API requests with the JSON null value. By default, fields with empty
  455. // values are omitted from API requests. However, any field with an
  456. // empty value appearing in NullFields will be sent to the server as
  457. // null. It is an error if a field in this list has a non-empty value.
  458. // This may be used to include null fields in Patch requests.
  459. NullFields []string `json:"-"`
  460. }
  461. func (s *Condition) MarshalJSON() ([]byte, error) {
  462. type NoMethod Condition
  463. raw := NoMethod(*s)
  464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  465. }
  466. // Container: Represents a Google Tag Manager Container, which specifies
  467. // the platform tags will run on, manages workspaces, and retains
  468. // container versions.
  469. type Container struct {
  470. // AccountId: GTM Account ID.
  471. AccountId string `json:"accountId,omitempty"`
  472. // ContainerId: The Container ID uniquely identifies the GTM Container.
  473. ContainerId string `json:"containerId,omitempty"`
  474. // DomainName: List of domain names associated with the Container.
  475. DomainName []string `json:"domainName,omitempty"`
  476. // Fingerprint: The fingerprint of the GTM Container as computed at
  477. // storage time. This value is recomputed whenever the account is
  478. // modified.
  479. Fingerprint string `json:"fingerprint,omitempty"`
  480. // Name: Container display name.
  481. Name string `json:"name,omitempty"`
  482. // Notes: Container Notes.
  483. Notes string `json:"notes,omitempty"`
  484. // Path: GTM Container's API relative path.
  485. Path string `json:"path,omitempty"`
  486. // PublicId: Container Public ID.
  487. PublicId string `json:"publicId,omitempty"`
  488. // TagManagerUrl: Auto generated link to the tag manager UI
  489. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  490. // UsageContext: List of Usage Contexts for the Container. Valid values
  491. // include: web, android, or ios.
  492. //
  493. // Possible values:
  494. // "amp"
  495. // "android"
  496. // "androidSdk5"
  497. // "ios"
  498. // "iosSdk5"
  499. // "usageContextUnspecified"
  500. // "web"
  501. UsageContext []string `json:"usageContext,omitempty"`
  502. // ServerResponse contains the HTTP response code and headers from the
  503. // server.
  504. googleapi.ServerResponse `json:"-"`
  505. // ForceSendFields is a list of field names (e.g. "AccountId") to
  506. // unconditionally include in API requests. By default, fields with
  507. // empty values are omitted from API requests. However, any non-pointer,
  508. // non-interface field appearing in ForceSendFields will be sent to the
  509. // server regardless of whether the field is empty or not. This may be
  510. // used to include empty fields in Patch requests.
  511. ForceSendFields []string `json:"-"`
  512. // NullFields is a list of field names (e.g. "AccountId") to include in
  513. // API requests with the JSON null value. By default, fields with empty
  514. // values are omitted from API requests. However, any field with an
  515. // empty value appearing in NullFields will be sent to the server as
  516. // null. It is an error if a field in this list has a non-empty value.
  517. // This may be used to include null fields in Patch requests.
  518. NullFields []string `json:"-"`
  519. }
  520. func (s *Container) MarshalJSON() ([]byte, error) {
  521. type NoMethod Container
  522. raw := NoMethod(*s)
  523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  524. }
  525. // ContainerAccess: Defines the Google Tag Manager Container access
  526. // permissions.
  527. type ContainerAccess struct {
  528. // ContainerId: GTM Container ID.
  529. ContainerId string `json:"containerId,omitempty"`
  530. // Permission: List of Container permissions.
  531. //
  532. // Possible values:
  533. // "approve"
  534. // "containerPermissionUnspecified"
  535. // "edit"
  536. // "noAccess"
  537. // "publish"
  538. // "read"
  539. Permission string `json:"permission,omitempty"`
  540. // ForceSendFields is a list of field names (e.g. "ContainerId") to
  541. // unconditionally include in API requests. By default, fields with
  542. // empty values are omitted from API requests. However, any non-pointer,
  543. // non-interface field appearing in ForceSendFields will be sent to the
  544. // server regardless of whether the field is empty or not. This may be
  545. // used to include empty fields in Patch requests.
  546. ForceSendFields []string `json:"-"`
  547. // NullFields is a list of field names (e.g. "ContainerId") to include
  548. // in API requests with the JSON null value. By default, fields with
  549. // empty values are omitted from API requests. However, any field with
  550. // an empty value appearing in NullFields will be sent to the server as
  551. // null. It is an error if a field in this list has a non-empty value.
  552. // This may be used to include null fields in Patch requests.
  553. NullFields []string `json:"-"`
  554. }
  555. func (s *ContainerAccess) MarshalJSON() ([]byte, error) {
  556. type NoMethod ContainerAccess
  557. raw := NoMethod(*s)
  558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  559. }
  560. // ContainerVersion: Represents a Google Tag Manager Container Version.
  561. type ContainerVersion struct {
  562. // AccountId: GTM Account ID.
  563. AccountId string `json:"accountId,omitempty"`
  564. // BuiltInVariable: The built-in variables in the container that this
  565. // version was taken from.
  566. BuiltInVariable []*BuiltInVariable `json:"builtInVariable,omitempty"`
  567. // Container: The container that this version was taken from.
  568. Container *Container `json:"container,omitempty"`
  569. // ContainerId: GTM Container ID.
  570. ContainerId string `json:"containerId,omitempty"`
  571. // ContainerVersionId: The Container Version ID uniquely identifies the
  572. // GTM Container Version.
  573. ContainerVersionId string `json:"containerVersionId,omitempty"`
  574. // Deleted: A value of true indicates this container version has been
  575. // deleted.
  576. Deleted bool `json:"deleted,omitempty"`
  577. // Description: Container version description.
  578. Description string `json:"description,omitempty"`
  579. // Fingerprint: The fingerprint of the GTM Container Version as computed
  580. // at storage time. This value is recomputed whenever the container
  581. // version is modified.
  582. Fingerprint string `json:"fingerprint,omitempty"`
  583. // Folder: The folders in the container that this version was taken
  584. // from.
  585. Folder []*Folder `json:"folder,omitempty"`
  586. // Name: Container version display name.
  587. Name string `json:"name,omitempty"`
  588. // Path: GTM ContainerVersions's API relative path.
  589. Path string `json:"path,omitempty"`
  590. // Tag: The tags in the container that this version was taken from.
  591. Tag []*Tag `json:"tag,omitempty"`
  592. // TagManagerUrl: Auto generated link to the tag manager UI
  593. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  594. // Trigger: The triggers in the container that this version was taken
  595. // from.
  596. Trigger []*Trigger `json:"trigger,omitempty"`
  597. // Variable: The variables in the container that this version was taken
  598. // from.
  599. Variable []*Variable `json:"variable,omitempty"`
  600. // Zone: The zones in the container that this version was taken from.
  601. Zone []*Zone `json:"zone,omitempty"`
  602. // ServerResponse contains the HTTP response code and headers from the
  603. // server.
  604. googleapi.ServerResponse `json:"-"`
  605. // ForceSendFields is a list of field names (e.g. "AccountId") to
  606. // unconditionally include in API requests. By default, fields with
  607. // empty values are omitted from API requests. However, any non-pointer,
  608. // non-interface field appearing in ForceSendFields will be sent to the
  609. // server regardless of whether the field is empty or not. This may be
  610. // used to include empty fields in Patch requests.
  611. ForceSendFields []string `json:"-"`
  612. // NullFields is a list of field names (e.g. "AccountId") to include in
  613. // API requests with the JSON null value. By default, fields with empty
  614. // values are omitted from API requests. However, any field with an
  615. // empty value appearing in NullFields will be sent to the server as
  616. // null. It is an error if a field in this list has a non-empty value.
  617. // This may be used to include null fields in Patch requests.
  618. NullFields []string `json:"-"`
  619. }
  620. func (s *ContainerVersion) MarshalJSON() ([]byte, error) {
  621. type NoMethod ContainerVersion
  622. raw := NoMethod(*s)
  623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  624. }
  625. // ContainerVersionHeader: Represents a Google Tag Manager Container
  626. // Version Header.
  627. type ContainerVersionHeader struct {
  628. // AccountId: GTM Account ID.
  629. AccountId string `json:"accountId,omitempty"`
  630. // ContainerId: GTM Container ID.
  631. ContainerId string `json:"containerId,omitempty"`
  632. // ContainerVersionId: The Container Version ID uniquely identifies the
  633. // GTM Container Version.
  634. ContainerVersionId string `json:"containerVersionId,omitempty"`
  635. // Deleted: A value of true indicates this container version has been
  636. // deleted.
  637. Deleted bool `json:"deleted,omitempty"`
  638. // Name: Container version display name.
  639. Name string `json:"name,omitempty"`
  640. // NumMacros: Number of macros in the container version.
  641. NumMacros string `json:"numMacros,omitempty"`
  642. // NumRules: Number of rules in the container version.
  643. NumRules string `json:"numRules,omitempty"`
  644. // NumTags: Number of tags in the container version.
  645. NumTags string `json:"numTags,omitempty"`
  646. // NumTriggers: Number of triggers in the container version.
  647. NumTriggers string `json:"numTriggers,omitempty"`
  648. // NumVariables: Number of variables in the container version.
  649. NumVariables string `json:"numVariables,omitempty"`
  650. // NumZones: Number of zones in the container version.
  651. NumZones string `json:"numZones,omitempty"`
  652. // Path: GTM Container Versions's API relative path.
  653. Path string `json:"path,omitempty"`
  654. // ServerResponse contains the HTTP response code and headers from the
  655. // server.
  656. googleapi.ServerResponse `json:"-"`
  657. // ForceSendFields is a list of field names (e.g. "AccountId") to
  658. // unconditionally include in API requests. By default, fields with
  659. // empty values are omitted from API requests. However, any non-pointer,
  660. // non-interface field appearing in ForceSendFields will be sent to the
  661. // server regardless of whether the field is empty or not. This may be
  662. // used to include empty fields in Patch requests.
  663. ForceSendFields []string `json:"-"`
  664. // NullFields is a list of field names (e.g. "AccountId") to include in
  665. // API requests with the JSON null value. By default, fields with empty
  666. // values are omitted from API requests. However, any field with an
  667. // empty value appearing in NullFields will be sent to the server as
  668. // null. It is an error if a field in this list has a non-empty value.
  669. // This may be used to include null fields in Patch requests.
  670. NullFields []string `json:"-"`
  671. }
  672. func (s *ContainerVersionHeader) MarshalJSON() ([]byte, error) {
  673. type NoMethod ContainerVersionHeader
  674. raw := NoMethod(*s)
  675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  676. }
  677. type CreateBuiltInVariableResponse struct {
  678. // BuiltInVariable: List of created built-in variables.
  679. BuiltInVariable []*BuiltInVariable `json:"builtInVariable,omitempty"`
  680. // ServerResponse contains the HTTP response code and headers from the
  681. // server.
  682. googleapi.ServerResponse `json:"-"`
  683. // ForceSendFields is a list of field names (e.g. "BuiltInVariable") to
  684. // unconditionally include in API requests. By default, fields with
  685. // empty values are omitted from API requests. However, any non-pointer,
  686. // non-interface field appearing in ForceSendFields will be sent to the
  687. // server regardless of whether the field is empty or not. This may be
  688. // used to include empty fields in Patch requests.
  689. ForceSendFields []string `json:"-"`
  690. // NullFields is a list of field names (e.g. "BuiltInVariable") to
  691. // include in API requests with the JSON null value. By default, fields
  692. // with empty values are omitted from API requests. However, any field
  693. // with an empty value appearing in NullFields will be sent to the
  694. // server as null. It is an error if a field in this list has a
  695. // non-empty value. This may be used to include null fields in Patch
  696. // requests.
  697. NullFields []string `json:"-"`
  698. }
  699. func (s *CreateBuiltInVariableResponse) MarshalJSON() ([]byte, error) {
  700. type NoMethod CreateBuiltInVariableResponse
  701. raw := NoMethod(*s)
  702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  703. }
  704. // CreateContainerVersionRequestVersionOptions: Options for new
  705. // container versions.
  706. type CreateContainerVersionRequestVersionOptions struct {
  707. // Name: The name of the container version to be created.
  708. Name string `json:"name,omitempty"`
  709. // Notes: The notes of the container version to be created.
  710. Notes string `json:"notes,omitempty"`
  711. // ForceSendFields is a list of field names (e.g. "Name") to
  712. // unconditionally include in API requests. By default, fields with
  713. // empty values are omitted from API requests. However, any non-pointer,
  714. // non-interface field appearing in ForceSendFields will be sent to the
  715. // server regardless of whether the field is empty or not. This may be
  716. // used to include empty fields in Patch requests.
  717. ForceSendFields []string `json:"-"`
  718. // NullFields is a list of field names (e.g. "Name") to include in API
  719. // requests with the JSON null value. By default, fields with empty
  720. // values are omitted from API requests. However, any field with an
  721. // empty value appearing in NullFields will be sent to the server as
  722. // null. It is an error if a field in this list has a non-empty value.
  723. // This may be used to include null fields in Patch requests.
  724. NullFields []string `json:"-"`
  725. }
  726. func (s *CreateContainerVersionRequestVersionOptions) MarshalJSON() ([]byte, error) {
  727. type NoMethod CreateContainerVersionRequestVersionOptions
  728. raw := NoMethod(*s)
  729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  730. }
  731. // CreateContainerVersionResponse: Create container versions response.
  732. type CreateContainerVersionResponse struct {
  733. // CompilerError: Compiler errors or not.
  734. CompilerError bool `json:"compilerError,omitempty"`
  735. // ContainerVersion: The container version created.
  736. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  737. // NewWorkspacePath: Auto generated workspace path created as a result
  738. // of version creation. This field should only be populated if the
  739. // created version was not a quick preview.
  740. NewWorkspacePath string `json:"newWorkspacePath,omitempty"`
  741. // SyncStatus: Whether version creation failed when syncing the
  742. // workspace to the latest container version.
  743. SyncStatus *SyncStatus `json:"syncStatus,omitempty"`
  744. // ServerResponse contains the HTTP response code and headers from the
  745. // server.
  746. googleapi.ServerResponse `json:"-"`
  747. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  748. // unconditionally include in API requests. By default, fields with
  749. // empty values are omitted from API requests. However, any non-pointer,
  750. // non-interface field appearing in ForceSendFields will be sent to the
  751. // server regardless of whether the field is empty or not. This may be
  752. // used to include empty fields in Patch requests.
  753. ForceSendFields []string `json:"-"`
  754. // NullFields is a list of field names (e.g. "CompilerError") to include
  755. // in API requests with the JSON null value. By default, fields with
  756. // empty values are omitted from API requests. However, any field with
  757. // an empty value appearing in NullFields will be sent to the server as
  758. // null. It is an error if a field in this list has a non-empty value.
  759. // This may be used to include null fields in Patch requests.
  760. NullFields []string `json:"-"`
  761. }
  762. func (s *CreateContainerVersionResponse) MarshalJSON() ([]byte, error) {
  763. type NoMethod CreateContainerVersionResponse
  764. raw := NoMethod(*s)
  765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  766. }
  767. // CreateWorkspaceProposalRequest: Creates a workspace proposal to start
  768. // a review of a workspace.
  769. type CreateWorkspaceProposalRequest struct {
  770. // InitialComment: If present, an initial comment to associate with the
  771. // workspace proposal.
  772. InitialComment *WorkspaceProposalHistoryComment `json:"initialComment,omitempty"`
  773. // Reviewers: List of users to review the workspace proposal.
  774. Reviewers []*WorkspaceProposalUser `json:"reviewers,omitempty"`
  775. // ForceSendFields is a list of field names (e.g. "InitialComment") to
  776. // unconditionally include in API requests. By default, fields with
  777. // empty values are omitted from API requests. However, any non-pointer,
  778. // non-interface field appearing in ForceSendFields will be sent to the
  779. // server regardless of whether the field is empty or not. This may be
  780. // used to include empty fields in Patch requests.
  781. ForceSendFields []string `json:"-"`
  782. // NullFields is a list of field names (e.g. "InitialComment") to
  783. // include in API requests with the JSON null value. By default, fields
  784. // with empty values are omitted from API requests. However, any field
  785. // with an empty value appearing in NullFields will be sent to the
  786. // server as null. It is an error if a field in this list has a
  787. // non-empty value. This may be used to include null fields in Patch
  788. // requests.
  789. NullFields []string `json:"-"`
  790. }
  791. func (s *CreateWorkspaceProposalRequest) MarshalJSON() ([]byte, error) {
  792. type NoMethod CreateWorkspaceProposalRequest
  793. raw := NoMethod(*s)
  794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  795. }
  796. // Entity: A workspace entity that may represent a tag, trigger,
  797. // variable, or folder in addition to its status in the workspace.
  798. type Entity struct {
  799. // ChangeStatus: Represents how the entity has been changed in the
  800. // workspace.
  801. //
  802. // Possible values:
  803. // "added"
  804. // "changeStatusUnspecified"
  805. // "deleted"
  806. // "none"
  807. // "updated"
  808. ChangeStatus string `json:"changeStatus,omitempty"`
  809. // Folder: The Folder being represented by the entity.
  810. Folder *Folder `json:"folder,omitempty"`
  811. // Tag: The tag being represented by the entity.
  812. Tag *Tag `json:"tag,omitempty"`
  813. // Trigger: The trigger being represented by the entity.
  814. Trigger *Trigger `json:"trigger,omitempty"`
  815. // Variable: The variable being represented by the entity.
  816. Variable *Variable `json:"variable,omitempty"`
  817. // ForceSendFields is a list of field names (e.g. "ChangeStatus") to
  818. // unconditionally include in API requests. By default, fields with
  819. // empty values are omitted from API requests. However, any non-pointer,
  820. // non-interface field appearing in ForceSendFields will be sent to the
  821. // server regardless of whether the field is empty or not. This may be
  822. // used to include empty fields in Patch requests.
  823. ForceSendFields []string `json:"-"`
  824. // NullFields is a list of field names (e.g. "ChangeStatus") to include
  825. // in API requests with the JSON null value. By default, fields with
  826. // empty values are omitted from API requests. However, any field with
  827. // an empty value appearing in NullFields will be sent to the server as
  828. // null. It is an error if a field in this list has a non-empty value.
  829. // This may be used to include null fields in Patch requests.
  830. NullFields []string `json:"-"`
  831. }
  832. func (s *Entity) MarshalJSON() ([]byte, error) {
  833. type NoMethod Entity
  834. raw := NoMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  836. }
  837. // Environment: Represents a Google Tag Manager Environment. Note that a
  838. // user can create, delete and update environments of type USER, but can
  839. // only update the enable_debug and url fields of environments of other
  840. // types.
  841. type Environment struct {
  842. // AccountId: GTM Account ID.
  843. AccountId string `json:"accountId,omitempty"`
  844. // AuthorizationCode: The environment authorization code.
  845. AuthorizationCode string `json:"authorizationCode,omitempty"`
  846. // AuthorizationTimestamp: The last update time-stamp for the
  847. // authorization code.
  848. AuthorizationTimestamp *Timestamp `json:"authorizationTimestamp,omitempty"`
  849. // ContainerId: GTM Container ID.
  850. ContainerId string `json:"containerId,omitempty"`
  851. // ContainerVersionId: Represents a link to a container version.
  852. ContainerVersionId string `json:"containerVersionId,omitempty"`
  853. // Description: The environment description. Can be set or changed only
  854. // on USER type environments.
  855. Description string `json:"description,omitempty"`
  856. // EnableDebug: Whether or not to enable debug by default for the
  857. // environment.
  858. EnableDebug bool `json:"enableDebug,omitempty"`
  859. // EnvironmentId: GTM Environment ID uniquely identifies the GTM
  860. // Environment.
  861. EnvironmentId string `json:"environmentId,omitempty"`
  862. // Fingerprint: The fingerprint of the GTM environment as computed at
  863. // storage time. This value is recomputed whenever the environment is
  864. // modified.
  865. Fingerprint string `json:"fingerprint,omitempty"`
  866. // Name: The environment display name. Can be set or changed only on
  867. // USER type environments.
  868. Name string `json:"name,omitempty"`
  869. // Path: GTM Environment's API relative path.
  870. Path string `json:"path,omitempty"`
  871. // TagManagerUrl: Auto generated link to the tag manager UI
  872. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  873. // Type: The type of this environment.
  874. //
  875. // Possible values:
  876. // "latest"
  877. // "live"
  878. // "user"
  879. // "workspace"
  880. Type string `json:"type,omitempty"`
  881. // Url: Default preview page url for the environment.
  882. Url string `json:"url,omitempty"`
  883. // WorkspaceId: Represents a link to a quick preview of a workspace.
  884. WorkspaceId string `json:"workspaceId,omitempty"`
  885. // ServerResponse contains the HTTP response code and headers from the
  886. // server.
  887. googleapi.ServerResponse `json:"-"`
  888. // ForceSendFields is a list of field names (e.g. "AccountId") to
  889. // unconditionally include in API requests. By default, fields with
  890. // empty values are omitted from API requests. However, any non-pointer,
  891. // non-interface field appearing in ForceSendFields will be sent to the
  892. // server regardless of whether the field is empty or not. This may be
  893. // used to include empty fields in Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. // NullFields is a list of field names (e.g. "AccountId") to include in
  896. // API requests with the JSON null value. By default, fields with empty
  897. // values are omitted from API requests. However, any field with an
  898. // empty value appearing in NullFields will be sent to the server as
  899. // null. It is an error if a field in this list has a non-empty value.
  900. // This may be used to include null fields in Patch requests.
  901. NullFields []string `json:"-"`
  902. }
  903. func (s *Environment) MarshalJSON() ([]byte, error) {
  904. type NoMethod Environment
  905. raw := NoMethod(*s)
  906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  907. }
  908. // Folder: Represents a Google Tag Manager Folder.
  909. type Folder struct {
  910. // AccountId: GTM Account ID.
  911. AccountId string `json:"accountId,omitempty"`
  912. // ContainerId: GTM Container ID.
  913. ContainerId string `json:"containerId,omitempty"`
  914. // Fingerprint: The fingerprint of the GTM Folder as computed at storage
  915. // time. This value is recomputed whenever the folder is modified.
  916. Fingerprint string `json:"fingerprint,omitempty"`
  917. // FolderId: The Folder ID uniquely identifies the GTM Folder.
  918. FolderId string `json:"folderId,omitempty"`
  919. // Name: Folder display name.
  920. Name string `json:"name,omitempty"`
  921. // Notes: User notes on how to apply this folder in the container.
  922. Notes string `json:"notes,omitempty"`
  923. // Path: GTM Folder's API relative path.
  924. Path string `json:"path,omitempty"`
  925. // TagManagerUrl: Auto generated link to the tag manager UI
  926. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  927. // WorkspaceId: GTM Workspace ID.
  928. WorkspaceId string `json:"workspaceId,omitempty"`
  929. // ServerResponse contains the HTTP response code and headers from the
  930. // server.
  931. googleapi.ServerResponse `json:"-"`
  932. // ForceSendFields is a list of field names (e.g. "AccountId") to
  933. // unconditionally include in API requests. By default, fields with
  934. // empty values are omitted from API requests. However, any non-pointer,
  935. // non-interface field appearing in ForceSendFields will be sent to the
  936. // server regardless of whether the field is empty or not. This may be
  937. // used to include empty fields in Patch requests.
  938. ForceSendFields []string `json:"-"`
  939. // NullFields is a list of field names (e.g. "AccountId") to include in
  940. // API requests with the JSON null value. By default, fields with empty
  941. // values are omitted from API requests. However, any field with an
  942. // empty value appearing in NullFields will be sent to the server as
  943. // null. It is an error if a field in this list has a non-empty value.
  944. // This may be used to include null fields in Patch requests.
  945. NullFields []string `json:"-"`
  946. }
  947. func (s *Folder) MarshalJSON() ([]byte, error) {
  948. type NoMethod Folder
  949. raw := NoMethod(*s)
  950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  951. }
  952. // FolderEntities: Represents a Google Tag Manager Folder's contents.
  953. type FolderEntities struct {
  954. // NextPageToken: Continuation token for fetching the next page of
  955. // results.
  956. NextPageToken string `json:"nextPageToken,omitempty"`
  957. // Tag: The list of tags inside the folder.
  958. Tag []*Tag `json:"tag,omitempty"`
  959. // Trigger: The list of triggers inside the folder.
  960. Trigger []*Trigger `json:"trigger,omitempty"`
  961. // Variable: The list of variables inside the folder.
  962. Variable []*Variable `json:"variable,omitempty"`
  963. // ServerResponse contains the HTTP response code and headers from the
  964. // server.
  965. googleapi.ServerResponse `json:"-"`
  966. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  967. // unconditionally include in API requests. By default, fields with
  968. // empty values are omitted from API requests. However, any non-pointer,
  969. // non-interface field appearing in ForceSendFields will be sent to the
  970. // server regardless of whether the field is empty or not. This may be
  971. // used to include empty fields in Patch requests.
  972. ForceSendFields []string `json:"-"`
  973. // NullFields is a list of field names (e.g. "NextPageToken") to include
  974. // in API requests with the JSON null value. By default, fields with
  975. // empty values are omitted from API requests. However, any field with
  976. // an empty value appearing in NullFields will be sent to the server as
  977. // null. It is an error if a field in this list has a non-empty value.
  978. // This may be used to include null fields in Patch requests.
  979. NullFields []string `json:"-"`
  980. }
  981. func (s *FolderEntities) MarshalJSON() ([]byte, error) {
  982. type NoMethod FolderEntities
  983. raw := NoMethod(*s)
  984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  985. }
  986. // GetWorkspaceStatusResponse: The changes that have occurred in the
  987. // workspace since the base container version.
  988. type GetWorkspaceStatusResponse struct {
  989. // MergeConflict: The merge conflict after sync.
  990. MergeConflict []*MergeConflict `json:"mergeConflict,omitempty"`
  991. // WorkspaceChange: Entities that have been changed in the workspace.
  992. WorkspaceChange []*Entity `json:"workspaceChange,omitempty"`
  993. // ServerResponse contains the HTTP response code and headers from the
  994. // server.
  995. googleapi.ServerResponse `json:"-"`
  996. // ForceSendFields is a list of field names (e.g. "MergeConflict") to
  997. // unconditionally include in API requests. By default, fields with
  998. // empty values are omitted from API requests. However, any non-pointer,
  999. // non-interface field appearing in ForceSendFields will be sent to the
  1000. // server regardless of whether the field is empty or not. This may be
  1001. // used to include empty fields in Patch requests.
  1002. ForceSendFields []string `json:"-"`
  1003. // NullFields is a list of field names (e.g. "MergeConflict") to include
  1004. // in API requests with the JSON null value. By default, fields with
  1005. // empty values are omitted from API requests. However, any field with
  1006. // an empty value appearing in NullFields will be sent to the server as
  1007. // null. It is an error if a field in this list has a non-empty value.
  1008. // This may be used to include null fields in Patch requests.
  1009. NullFields []string `json:"-"`
  1010. }
  1011. func (s *GetWorkspaceStatusResponse) MarshalJSON() ([]byte, error) {
  1012. type NoMethod GetWorkspaceStatusResponse
  1013. raw := NoMethod(*s)
  1014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1015. }
  1016. // ListAccountsResponse: List Accounts Response.
  1017. type ListAccountsResponse struct {
  1018. // Account: List of GTM Accounts that a user has access to.
  1019. Account []*Account `json:"account,omitempty"`
  1020. // NextPageToken: Continuation token for fetching the next page of
  1021. // results.
  1022. NextPageToken string `json:"nextPageToken,omitempty"`
  1023. // ServerResponse contains the HTTP response code and headers from the
  1024. // server.
  1025. googleapi.ServerResponse `json:"-"`
  1026. // ForceSendFields is a list of field names (e.g. "Account") to
  1027. // unconditionally include in API requests. By default, fields with
  1028. // empty values are omitted from API requests. However, any non-pointer,
  1029. // non-interface field appearing in ForceSendFields will be sent to the
  1030. // server regardless of whether the field is empty or not. This may be
  1031. // used to include empty fields in Patch requests.
  1032. ForceSendFields []string `json:"-"`
  1033. // NullFields is a list of field names (e.g. "Account") to include in
  1034. // API requests with the JSON null value. By default, fields with empty
  1035. // values are omitted from API requests. However, any field with an
  1036. // empty value appearing in NullFields will be sent to the server as
  1037. // null. It is an error if a field in this list has a non-empty value.
  1038. // This may be used to include null fields in Patch requests.
  1039. NullFields []string `json:"-"`
  1040. }
  1041. func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
  1042. type NoMethod ListAccountsResponse
  1043. raw := NoMethod(*s)
  1044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1045. }
  1046. // ListContainerVersionsResponse: List container versions response.
  1047. type ListContainerVersionsResponse struct {
  1048. // ContainerVersionHeader: All container version headers of a GTM
  1049. // Container.
  1050. ContainerVersionHeader []*ContainerVersionHeader `json:"containerVersionHeader,omitempty"`
  1051. // NextPageToken: Continuation token for fetching the next page of
  1052. // results.
  1053. NextPageToken string `json:"nextPageToken,omitempty"`
  1054. // ServerResponse contains the HTTP response code and headers from the
  1055. // server.
  1056. googleapi.ServerResponse `json:"-"`
  1057. // ForceSendFields is a list of field names (e.g.
  1058. // "ContainerVersionHeader") to unconditionally include in API requests.
  1059. // By default, fields with empty values are omitted from API requests.
  1060. // However, any non-pointer, non-interface field appearing in
  1061. // ForceSendFields will be sent to the server regardless of whether the
  1062. // field is empty or not. This may be used to include empty fields in
  1063. // Patch requests.
  1064. ForceSendFields []string `json:"-"`
  1065. // NullFields is a list of field names (e.g. "ContainerVersionHeader")
  1066. // to include in API requests with the JSON null value. By default,
  1067. // fields with empty values are omitted from API requests. However, any
  1068. // field with an empty value appearing in NullFields will be sent to the
  1069. // server as null. It is an error if a field in this list has a
  1070. // non-empty value. This may be used to include null fields in Patch
  1071. // requests.
  1072. NullFields []string `json:"-"`
  1073. }
  1074. func (s *ListContainerVersionsResponse) MarshalJSON() ([]byte, error) {
  1075. type NoMethod ListContainerVersionsResponse
  1076. raw := NoMethod(*s)
  1077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1078. }
  1079. // ListContainersResponse: List Containers Response.
  1080. type ListContainersResponse struct {
  1081. // Container: All Containers of a GTM Account.
  1082. Container []*Container `json:"container,omitempty"`
  1083. // NextPageToken: Continuation token for fetching the next page of
  1084. // results.
  1085. NextPageToken string `json:"nextPageToken,omitempty"`
  1086. // ServerResponse contains the HTTP response code and headers from the
  1087. // server.
  1088. googleapi.ServerResponse `json:"-"`
  1089. // ForceSendFields is a list of field names (e.g. "Container") to
  1090. // unconditionally include in API requests. By default, fields with
  1091. // empty values are omitted from API requests. However, any non-pointer,
  1092. // non-interface field appearing in ForceSendFields will be sent to the
  1093. // server regardless of whether the field is empty or not. This may be
  1094. // used to include empty fields in Patch requests.
  1095. ForceSendFields []string `json:"-"`
  1096. // NullFields is a list of field names (e.g. "Container") to include in
  1097. // API requests with the JSON null value. By default, fields with empty
  1098. // values are omitted from API requests. However, any field with an
  1099. // empty value appearing in NullFields will be sent to the server as
  1100. // null. It is an error if a field in this list has a non-empty value.
  1101. // This may be used to include null fields in Patch requests.
  1102. NullFields []string `json:"-"`
  1103. }
  1104. func (s *ListContainersResponse) MarshalJSON() ([]byte, error) {
  1105. type NoMethod ListContainersResponse
  1106. raw := NoMethod(*s)
  1107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1108. }
  1109. // ListEnabledBuiltInVariablesResponse: A list of enabled built-in
  1110. // variables.
  1111. type ListEnabledBuiltInVariablesResponse struct {
  1112. // BuiltInVariable: All GTM BuiltInVariables of a GTM container.
  1113. BuiltInVariable []*BuiltInVariable `json:"builtInVariable,omitempty"`
  1114. // NextPageToken: Continuation token for fetching the next page of
  1115. // results.
  1116. NextPageToken string `json:"nextPageToken,omitempty"`
  1117. // ServerResponse contains the HTTP response code and headers from the
  1118. // server.
  1119. googleapi.ServerResponse `json:"-"`
  1120. // ForceSendFields is a list of field names (e.g. "BuiltInVariable") to
  1121. // unconditionally include in API requests. By default, fields with
  1122. // empty values are omitted from API requests. However, any non-pointer,
  1123. // non-interface field appearing in ForceSendFields will be sent to the
  1124. // server regardless of whether the field is empty or not. This may be
  1125. // used to include empty fields in Patch requests.
  1126. ForceSendFields []string `json:"-"`
  1127. // NullFields is a list of field names (e.g. "BuiltInVariable") to
  1128. // include in API requests with the JSON null value. By default, fields
  1129. // with empty values are omitted from API requests. However, any field
  1130. // with an empty value appearing in NullFields will be sent to the
  1131. // server as null. It is an error if a field in this list has a
  1132. // non-empty value. This may be used to include null fields in Patch
  1133. // requests.
  1134. NullFields []string `json:"-"`
  1135. }
  1136. func (s *ListEnabledBuiltInVariablesResponse) MarshalJSON() ([]byte, error) {
  1137. type NoMethod ListEnabledBuiltInVariablesResponse
  1138. raw := NoMethod(*s)
  1139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1140. }
  1141. // ListEnvironmentsResponse: List Environments Response.
  1142. type ListEnvironmentsResponse struct {
  1143. // Environment: All Environments of a GTM Container.
  1144. Environment []*Environment `json:"environment,omitempty"`
  1145. // NextPageToken: Continuation token for fetching the next page of
  1146. // results.
  1147. NextPageToken string `json:"nextPageToken,omitempty"`
  1148. // ServerResponse contains the HTTP response code and headers from the
  1149. // server.
  1150. googleapi.ServerResponse `json:"-"`
  1151. // ForceSendFields is a list of field names (e.g. "Environment") to
  1152. // unconditionally include in API requests. By default, fields with
  1153. // empty values are omitted from API requests. However, any non-pointer,
  1154. // non-interface field appearing in ForceSendFields will be sent to the
  1155. // server regardless of whether the field is empty or not. This may be
  1156. // used to include empty fields in Patch requests.
  1157. ForceSendFields []string `json:"-"`
  1158. // NullFields is a list of field names (e.g. "Environment") to include
  1159. // in API requests with the JSON null value. By default, fields with
  1160. // empty values are omitted from API requests. However, any field with
  1161. // an empty value appearing in NullFields will be sent to the server as
  1162. // null. It is an error if a field in this list has a non-empty value.
  1163. // This may be used to include null fields in Patch requests.
  1164. NullFields []string `json:"-"`
  1165. }
  1166. func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
  1167. type NoMethod ListEnvironmentsResponse
  1168. raw := NoMethod(*s)
  1169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1170. }
  1171. // ListFoldersResponse: List Folders Response.
  1172. type ListFoldersResponse struct {
  1173. // Folder: All GTM Folders of a GTM Container.
  1174. Folder []*Folder `json:"folder,omitempty"`
  1175. // NextPageToken: Continuation token for fetching the next page of
  1176. // results.
  1177. NextPageToken string `json:"nextPageToken,omitempty"`
  1178. // ServerResponse contains the HTTP response code and headers from the
  1179. // server.
  1180. googleapi.ServerResponse `json:"-"`
  1181. // ForceSendFields is a list of field names (e.g. "Folder") to
  1182. // unconditionally include in API requests. By default, fields with
  1183. // empty values are omitted from API requests. However, any non-pointer,
  1184. // non-interface field appearing in ForceSendFields will be sent to the
  1185. // server regardless of whether the field is empty or not. This may be
  1186. // used to include empty fields in Patch requests.
  1187. ForceSendFields []string `json:"-"`
  1188. // NullFields is a list of field names (e.g. "Folder") to include in API
  1189. // requests with the JSON null value. By default, fields with empty
  1190. // values are omitted from API requests. However, any field with an
  1191. // empty value appearing in NullFields will be sent to the server as
  1192. // null. It is an error if a field in this list has a non-empty value.
  1193. // This may be used to include null fields in Patch requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *ListFoldersResponse) MarshalJSON() ([]byte, error) {
  1197. type NoMethod ListFoldersResponse
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // ListTagsResponse: List Tags Response.
  1202. type ListTagsResponse struct {
  1203. // NextPageToken: Continuation token for fetching the next page of
  1204. // results.
  1205. NextPageToken string `json:"nextPageToken,omitempty"`
  1206. // Tag: All GTM Tags of a GTM Container.
  1207. Tag []*Tag `json:"tag,omitempty"`
  1208. // ServerResponse contains the HTTP response code and headers from the
  1209. // server.
  1210. googleapi.ServerResponse `json:"-"`
  1211. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1212. // unconditionally include in API requests. By default, fields with
  1213. // empty values are omitted from API requests. However, any non-pointer,
  1214. // non-interface field appearing in ForceSendFields will be sent to the
  1215. // server regardless of whether the field is empty or not. This may be
  1216. // used to include empty fields in Patch requests.
  1217. ForceSendFields []string `json:"-"`
  1218. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1219. // in API requests with the JSON null value. By default, fields with
  1220. // empty values are omitted from API requests. However, any field with
  1221. // an empty value appearing in NullFields will be sent to the server as
  1222. // null. It is an error if a field in this list has a non-empty value.
  1223. // This may be used to include null fields in Patch requests.
  1224. NullFields []string `json:"-"`
  1225. }
  1226. func (s *ListTagsResponse) MarshalJSON() ([]byte, error) {
  1227. type NoMethod ListTagsResponse
  1228. raw := NoMethod(*s)
  1229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1230. }
  1231. // ListTriggersResponse: List triggers response.
  1232. type ListTriggersResponse struct {
  1233. // NextPageToken: Continuation token for fetching the next page of
  1234. // results.
  1235. NextPageToken string `json:"nextPageToken,omitempty"`
  1236. // Trigger: All GTM Triggers of a GTM Container.
  1237. Trigger []*Trigger `json:"trigger,omitempty"`
  1238. // ServerResponse contains the HTTP response code and headers from the
  1239. // server.
  1240. googleapi.ServerResponse `json:"-"`
  1241. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1242. // unconditionally include in API requests. By default, fields with
  1243. // empty values are omitted from API requests. However, any non-pointer,
  1244. // non-interface field appearing in ForceSendFields will be sent to the
  1245. // server regardless of whether the field is empty or not. This may be
  1246. // used to include empty fields in Patch requests.
  1247. ForceSendFields []string `json:"-"`
  1248. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1249. // in API requests with the JSON null value. By default, fields with
  1250. // empty values are omitted from API requests. However, any field with
  1251. // an empty value appearing in NullFields will be sent to the server as
  1252. // null. It is an error if a field in this list has a non-empty value.
  1253. // This may be used to include null fields in Patch requests.
  1254. NullFields []string `json:"-"`
  1255. }
  1256. func (s *ListTriggersResponse) MarshalJSON() ([]byte, error) {
  1257. type NoMethod ListTriggersResponse
  1258. raw := NoMethod(*s)
  1259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1260. }
  1261. // ListUserPermissionsResponse: List user permissions response.
  1262. type ListUserPermissionsResponse struct {
  1263. // NextPageToken: Continuation token for fetching the next page of
  1264. // results.
  1265. NextPageToken string `json:"nextPageToken,omitempty"`
  1266. // UserPermission: All GTM UserPermissions of a GTM Account.
  1267. UserPermission []*UserPermission `json:"userPermission,omitempty"`
  1268. // ServerResponse contains the HTTP response code and headers from the
  1269. // server.
  1270. googleapi.ServerResponse `json:"-"`
  1271. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1272. // unconditionally include in API requests. By default, fields with
  1273. // empty values are omitted from API requests. However, any non-pointer,
  1274. // non-interface field appearing in ForceSendFields will be sent to the
  1275. // server regardless of whether the field is empty or not. This may be
  1276. // used to include empty fields in Patch requests.
  1277. ForceSendFields []string `json:"-"`
  1278. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1279. // in API requests with the JSON null value. By default, fields with
  1280. // empty values are omitted from API requests. However, any field with
  1281. // an empty value appearing in NullFields will be sent to the server as
  1282. // null. It is an error if a field in this list has a non-empty value.
  1283. // This may be used to include null fields in Patch requests.
  1284. NullFields []string `json:"-"`
  1285. }
  1286. func (s *ListUserPermissionsResponse) MarshalJSON() ([]byte, error) {
  1287. type NoMethod ListUserPermissionsResponse
  1288. raw := NoMethod(*s)
  1289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1290. }
  1291. // ListVariablesResponse: List Variables Response.
  1292. type ListVariablesResponse struct {
  1293. // NextPageToken: Continuation token for fetching the next page of
  1294. // results.
  1295. NextPageToken string `json:"nextPageToken,omitempty"`
  1296. // Variable: All GTM Variables of a GTM Container.
  1297. Variable []*Variable `json:"variable,omitempty"`
  1298. // ServerResponse contains the HTTP response code and headers from the
  1299. // server.
  1300. googleapi.ServerResponse `json:"-"`
  1301. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1302. // unconditionally include in API requests. By default, fields with
  1303. // empty values are omitted from API requests. However, any non-pointer,
  1304. // non-interface field appearing in ForceSendFields will be sent to the
  1305. // server regardless of whether the field is empty or not. This may be
  1306. // used to include empty fields in Patch requests.
  1307. ForceSendFields []string `json:"-"`
  1308. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1309. // in API requests with the JSON null value. By default, fields with
  1310. // empty values are omitted from API requests. However, any field with
  1311. // an empty value appearing in NullFields will be sent to the server as
  1312. // null. It is an error if a field in this list has a non-empty value.
  1313. // This may be used to include null fields in Patch requests.
  1314. NullFields []string `json:"-"`
  1315. }
  1316. func (s *ListVariablesResponse) MarshalJSON() ([]byte, error) {
  1317. type NoMethod ListVariablesResponse
  1318. raw := NoMethod(*s)
  1319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1320. }
  1321. // ListWorkspacesResponse: A list of workspaces in a container.
  1322. type ListWorkspacesResponse struct {
  1323. // NextPageToken: Continuation token for fetching the next page of
  1324. // results.
  1325. NextPageToken string `json:"nextPageToken,omitempty"`
  1326. // Workspace: All Workspaces of a GTM Container.
  1327. Workspace []*Workspace `json:"workspace,omitempty"`
  1328. // ServerResponse contains the HTTP response code and headers from the
  1329. // server.
  1330. googleapi.ServerResponse `json:"-"`
  1331. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1332. // unconditionally include in API requests. By default, fields with
  1333. // empty values are omitted from API requests. However, any non-pointer,
  1334. // non-interface field appearing in ForceSendFields will be sent to the
  1335. // server regardless of whether the field is empty or not. This may be
  1336. // used to include empty fields in Patch requests.
  1337. ForceSendFields []string `json:"-"`
  1338. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1339. // in API requests with the JSON null value. By default, fields with
  1340. // empty values are omitted from API requests. However, any field with
  1341. // an empty value appearing in NullFields will be sent to the server as
  1342. // null. It is an error if a field in this list has a non-empty value.
  1343. // This may be used to include null fields in Patch requests.
  1344. NullFields []string `json:"-"`
  1345. }
  1346. func (s *ListWorkspacesResponse) MarshalJSON() ([]byte, error) {
  1347. type NoMethod ListWorkspacesResponse
  1348. raw := NoMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1350. }
  1351. // MergeConflict: Represents a merge conflict.
  1352. type MergeConflict struct {
  1353. // EntityInBaseVersion: The base version entity (since the latest sync
  1354. // operation) that has conflicting changes compared to the workspace. If
  1355. // this field is missing, it means the workspace entity is deleted from
  1356. // the base version.
  1357. EntityInBaseVersion *Entity `json:"entityInBaseVersion,omitempty"`
  1358. // EntityInWorkspace: The workspace entity that has conflicting changes
  1359. // compared to the base version. If an entity is deleted in a workspace,
  1360. // it will still appear with a deleted change status.
  1361. EntityInWorkspace *Entity `json:"entityInWorkspace,omitempty"`
  1362. // ForceSendFields is a list of field names (e.g. "EntityInBaseVersion")
  1363. // to unconditionally include in API requests. By default, fields with
  1364. // empty values are omitted from API requests. However, any non-pointer,
  1365. // non-interface field appearing in ForceSendFields will be sent to the
  1366. // server regardless of whether the field is empty or not. This may be
  1367. // used to include empty fields in Patch requests.
  1368. ForceSendFields []string `json:"-"`
  1369. // NullFields is a list of field names (e.g. "EntityInBaseVersion") to
  1370. // include in API requests with the JSON null value. By default, fields
  1371. // with empty values are omitted from API requests. However, any field
  1372. // with an empty value appearing in NullFields will be sent to the
  1373. // server as null. It is an error if a field in this list has a
  1374. // non-empty value. This may be used to include null fields in Patch
  1375. // requests.
  1376. NullFields []string `json:"-"`
  1377. }
  1378. func (s *MergeConflict) MarshalJSON() ([]byte, error) {
  1379. type NoMethod MergeConflict
  1380. raw := NoMethod(*s)
  1381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1382. }
  1383. // Parameter: Represents a Google Tag Manager Parameter.
  1384. type Parameter struct {
  1385. // Key: The named key that uniquely identifies a parameter. Required for
  1386. // top-level parameters, as well as map values. Ignored for list values.
  1387. Key string `json:"key,omitempty"`
  1388. // List: This list parameter's parameters (keys will be ignored).
  1389. List []*Parameter `json:"list,omitempty"`
  1390. // Map: This map parameter's parameters (must have keys; keys must be
  1391. // unique).
  1392. Map []*Parameter `json:"map,omitempty"`
  1393. // Type: The parameter type. Valid values are:
  1394. // - boolean: The value represents a boolean, represented as 'true' or
  1395. // 'false'
  1396. // - integer: The value represents a 64-bit signed integer value, in
  1397. // base 10
  1398. // - list: A list of parameters should be specified
  1399. // - map: A map of parameters should be specified
  1400. // - template: The value represents any text; this can include variable
  1401. // references (even variable references that might return non-string
  1402. // types)
  1403. //
  1404. // Possible values:
  1405. // "boolean"
  1406. // "integer"
  1407. // "list"
  1408. // "map"
  1409. // "template"
  1410. // "typeUnspecified"
  1411. Type string `json:"type,omitempty"`
  1412. // Value: A parameter's value (may contain variable references such as
  1413. // "{{myVariable}}") as appropriate to the specified type.
  1414. Value string `json:"value,omitempty"`
  1415. // ForceSendFields is a list of field names (e.g. "Key") to
  1416. // unconditionally include in API requests. By default, fields with
  1417. // empty values are omitted from API requests. However, any non-pointer,
  1418. // non-interface field appearing in ForceSendFields will be sent to the
  1419. // server regardless of whether the field is empty or not. This may be
  1420. // used to include empty fields in Patch requests.
  1421. ForceSendFields []string `json:"-"`
  1422. // NullFields is a list of field names (e.g. "Key") to include in API
  1423. // requests with the JSON null value. By default, fields with empty
  1424. // values are omitted from API requests. However, any field with an
  1425. // empty value appearing in NullFields will be sent to the server as
  1426. // null. It is an error if a field in this list has a non-empty value.
  1427. // This may be used to include null fields in Patch requests.
  1428. NullFields []string `json:"-"`
  1429. }
  1430. func (s *Parameter) MarshalJSON() ([]byte, error) {
  1431. type NoMethod Parameter
  1432. raw := NoMethod(*s)
  1433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1434. }
  1435. // PublishContainerVersionResponse: Publish container version response.
  1436. type PublishContainerVersionResponse struct {
  1437. // CompilerError: Compiler errors or not.
  1438. CompilerError bool `json:"compilerError,omitempty"`
  1439. // ContainerVersion: The container version created.
  1440. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  1441. // ServerResponse contains the HTTP response code and headers from the
  1442. // server.
  1443. googleapi.ServerResponse `json:"-"`
  1444. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  1445. // unconditionally include in API requests. By default, fields with
  1446. // empty values are omitted from API requests. However, any non-pointer,
  1447. // non-interface field appearing in ForceSendFields will be sent to the
  1448. // server regardless of whether the field is empty or not. This may be
  1449. // used to include empty fields in Patch requests.
  1450. ForceSendFields []string `json:"-"`
  1451. // NullFields is a list of field names (e.g. "CompilerError") to include
  1452. // in API requests with the JSON null value. By default, fields with
  1453. // empty values are omitted from API requests. However, any field with
  1454. // an empty value appearing in NullFields will be sent to the server as
  1455. // null. It is an error if a field in this list has a non-empty value.
  1456. // This may be used to include null fields in Patch requests.
  1457. NullFields []string `json:"-"`
  1458. }
  1459. func (s *PublishContainerVersionResponse) MarshalJSON() ([]byte, error) {
  1460. type NoMethod PublishContainerVersionResponse
  1461. raw := NoMethod(*s)
  1462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1463. }
  1464. // QuickPreviewResponse: Response to quick previewing a workspace.
  1465. type QuickPreviewResponse struct {
  1466. // CompilerError: Were there compiler errors or not.
  1467. CompilerError bool `json:"compilerError,omitempty"`
  1468. // ContainerVersion: The quick previewed container version.
  1469. ContainerVersion *ContainerVersion `json:"containerVersion,omitempty"`
  1470. // SyncStatus: Whether quick previewing failed when syncing the
  1471. // workspace to the latest container version.
  1472. SyncStatus *SyncStatus `json:"syncStatus,omitempty"`
  1473. // ServerResponse contains the HTTP response code and headers from the
  1474. // server.
  1475. googleapi.ServerResponse `json:"-"`
  1476. // ForceSendFields is a list of field names (e.g. "CompilerError") to
  1477. // unconditionally include in API requests. By default, fields with
  1478. // empty values are omitted from API requests. However, any non-pointer,
  1479. // non-interface field appearing in ForceSendFields will be sent to the
  1480. // server regardless of whether the field is empty or not. This may be
  1481. // used to include empty fields in Patch requests.
  1482. ForceSendFields []string `json:"-"`
  1483. // NullFields is a list of field names (e.g. "CompilerError") to include
  1484. // in API requests with the JSON null value. By default, fields with
  1485. // empty values are omitted from API requests. However, any field with
  1486. // an empty value appearing in NullFields will be sent to the server as
  1487. // null. It is an error if a field in this list has a non-empty value.
  1488. // This may be used to include null fields in Patch requests.
  1489. NullFields []string `json:"-"`
  1490. }
  1491. func (s *QuickPreviewResponse) MarshalJSON() ([]byte, error) {
  1492. type NoMethod QuickPreviewResponse
  1493. raw := NoMethod(*s)
  1494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1495. }
  1496. // RevertBuiltInVariableResponse: The result of reverting a built-in
  1497. // variable in a workspace.
  1498. type RevertBuiltInVariableResponse struct {
  1499. // Enabled: Whether the built-in variable is enabled after reversion.
  1500. Enabled bool `json:"enabled,omitempty"`
  1501. // ServerResponse contains the HTTP response code and headers from the
  1502. // server.
  1503. googleapi.ServerResponse `json:"-"`
  1504. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1505. // unconditionally include in API requests. By default, fields with
  1506. // empty values are omitted from API requests. However, any non-pointer,
  1507. // non-interface field appearing in ForceSendFields will be sent to the
  1508. // server regardless of whether the field is empty or not. This may be
  1509. // used to include empty fields in Patch requests.
  1510. ForceSendFields []string `json:"-"`
  1511. // NullFields is a list of field names (e.g. "Enabled") to include in
  1512. // API requests with the JSON null value. By default, fields with empty
  1513. // values are omitted from API requests. However, any field with an
  1514. // empty value appearing in NullFields will be sent to the server as
  1515. // null. It is an error if a field in this list has a non-empty value.
  1516. // This may be used to include null fields in Patch requests.
  1517. NullFields []string `json:"-"`
  1518. }
  1519. func (s *RevertBuiltInVariableResponse) MarshalJSON() ([]byte, error) {
  1520. type NoMethod RevertBuiltInVariableResponse
  1521. raw := NoMethod(*s)
  1522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1523. }
  1524. // RevertFolderResponse: The result of reverting folder changes in a
  1525. // workspace.
  1526. type RevertFolderResponse struct {
  1527. // Folder: Folder as it appears in the latest container version since
  1528. // the last workspace synchronization operation. If no folder is
  1529. // present, that means the folder was deleted in the latest container
  1530. // version.
  1531. Folder *Folder `json:"folder,omitempty"`
  1532. // ServerResponse contains the HTTP response code and headers from the
  1533. // server.
  1534. googleapi.ServerResponse `json:"-"`
  1535. // ForceSendFields is a list of field names (e.g. "Folder") to
  1536. // unconditionally include in API requests. By default, fields with
  1537. // empty values are omitted from API requests. However, any non-pointer,
  1538. // non-interface field appearing in ForceSendFields will be sent to the
  1539. // server regardless of whether the field is empty or not. This may be
  1540. // used to include empty fields in Patch requests.
  1541. ForceSendFields []string `json:"-"`
  1542. // NullFields is a list of field names (e.g. "Folder") to include in API
  1543. // requests with the JSON null value. By default, fields with empty
  1544. // values are omitted from API requests. However, any field with an
  1545. // empty value appearing in NullFields will be sent to the server as
  1546. // null. It is an error if a field in this list has a non-empty value.
  1547. // This may be used to include null fields in Patch requests.
  1548. NullFields []string `json:"-"`
  1549. }
  1550. func (s *RevertFolderResponse) MarshalJSON() ([]byte, error) {
  1551. type NoMethod RevertFolderResponse
  1552. raw := NoMethod(*s)
  1553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1554. }
  1555. // RevertTagResponse: The result of reverting a tag in a workspace.
  1556. type RevertTagResponse struct {
  1557. // Tag: Tag as it appears in the latest container version since the last
  1558. // workspace synchronization operation. If no tag is present, that means
  1559. // the tag was deleted in the latest container version.
  1560. Tag *Tag `json:"tag,omitempty"`
  1561. // ServerResponse contains the HTTP response code and headers from the
  1562. // server.
  1563. googleapi.ServerResponse `json:"-"`
  1564. // ForceSendFields is a list of field names (e.g. "Tag") to
  1565. // unconditionally include in API requests. By default, fields with
  1566. // empty values are omitted from API requests. However, any non-pointer,
  1567. // non-interface field appearing in ForceSendFields will be sent to the
  1568. // server regardless of whether the field is empty or not. This may be
  1569. // used to include empty fields in Patch requests.
  1570. ForceSendFields []string `json:"-"`
  1571. // NullFields is a list of field names (e.g. "Tag") to include in API
  1572. // requests with the JSON null value. By default, fields with empty
  1573. // values are omitted from API requests. However, any field with an
  1574. // empty value appearing in NullFields will be sent to the server as
  1575. // null. It is an error if a field in this list has a non-empty value.
  1576. // This may be used to include null fields in Patch requests.
  1577. NullFields []string `json:"-"`
  1578. }
  1579. func (s *RevertTagResponse) MarshalJSON() ([]byte, error) {
  1580. type NoMethod RevertTagResponse
  1581. raw := NoMethod(*s)
  1582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1583. }
  1584. // RevertTriggerResponse: The result of reverting a trigger in a
  1585. // workspace.
  1586. type RevertTriggerResponse struct {
  1587. // Trigger: Trigger as it appears in the latest container version since
  1588. // the last workspace synchronization operation. If no trigger is
  1589. // present, that means the trigger was deleted in the latest container
  1590. // version.
  1591. Trigger *Trigger `json:"trigger,omitempty"`
  1592. // ServerResponse contains the HTTP response code and headers from the
  1593. // server.
  1594. googleapi.ServerResponse `json:"-"`
  1595. // ForceSendFields is a list of field names (e.g. "Trigger") to
  1596. // unconditionally include in API requests. By default, fields with
  1597. // empty values are omitted from API requests. However, any non-pointer,
  1598. // non-interface field appearing in ForceSendFields will be sent to the
  1599. // server regardless of whether the field is empty or not. This may be
  1600. // used to include empty fields in Patch requests.
  1601. ForceSendFields []string `json:"-"`
  1602. // NullFields is a list of field names (e.g. "Trigger") to include in
  1603. // API requests with the JSON null value. By default, fields with empty
  1604. // values are omitted from API requests. However, any field with an
  1605. // empty value appearing in NullFields will be sent to the server as
  1606. // null. It is an error if a field in this list has a non-empty value.
  1607. // This may be used to include null fields in Patch requests.
  1608. NullFields []string `json:"-"`
  1609. }
  1610. func (s *RevertTriggerResponse) MarshalJSON() ([]byte, error) {
  1611. type NoMethod RevertTriggerResponse
  1612. raw := NoMethod(*s)
  1613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1614. }
  1615. // RevertVariableResponse: The result of reverting a variable in a
  1616. // workspace.
  1617. type RevertVariableResponse struct {
  1618. // Variable: Variable as it appears in the latest container version
  1619. // since the last workspace synchronization operation. If no variable is
  1620. // present, that means the variable was deleted in the latest container
  1621. // version.
  1622. Variable *Variable `json:"variable,omitempty"`
  1623. // ServerResponse contains the HTTP response code and headers from the
  1624. // server.
  1625. googleapi.ServerResponse `json:"-"`
  1626. // ForceSendFields is a list of field names (e.g. "Variable") to
  1627. // unconditionally include in API requests. By default, fields with
  1628. // empty values are omitted from API requests. However, any non-pointer,
  1629. // non-interface field appearing in ForceSendFields will be sent to the
  1630. // server regardless of whether the field is empty or not. This may be
  1631. // used to include empty fields in Patch requests.
  1632. ForceSendFields []string `json:"-"`
  1633. // NullFields is a list of field names (e.g. "Variable") to include in
  1634. // API requests with the JSON null value. By default, fields with empty
  1635. // values are omitted from API requests. However, any field with an
  1636. // empty value appearing in NullFields will be sent to the server as
  1637. // null. It is an error if a field in this list has a non-empty value.
  1638. // This may be used to include null fields in Patch requests.
  1639. NullFields []string `json:"-"`
  1640. }
  1641. func (s *RevertVariableResponse) MarshalJSON() ([]byte, error) {
  1642. type NoMethod RevertVariableResponse
  1643. raw := NoMethod(*s)
  1644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1645. }
  1646. // SetupTag: Represents a reference to atag that fires before another
  1647. // tag in order to set up dependencies.
  1648. type SetupTag struct {
  1649. // StopOnSetupFailure: If true, fire the main tag if and only if the
  1650. // setup tag fires successfully. If false, fire the main tag regardless
  1651. // of setup tag firing status.
  1652. StopOnSetupFailure bool `json:"stopOnSetupFailure,omitempty"`
  1653. // TagName: The name of the setup tag.
  1654. TagName string `json:"tagName,omitempty"`
  1655. // ForceSendFields is a list of field names (e.g. "StopOnSetupFailure")
  1656. // to unconditionally include in API requests. By default, fields with
  1657. // empty values are omitted from API requests. However, any non-pointer,
  1658. // non-interface field appearing in ForceSendFields will be sent to the
  1659. // server regardless of whether the field is empty or not. This may be
  1660. // used to include empty fields in Patch requests.
  1661. ForceSendFields []string `json:"-"`
  1662. // NullFields is a list of field names (e.g. "StopOnSetupFailure") to
  1663. // include in API requests with the JSON null value. By default, fields
  1664. // with empty values are omitted from API requests. However, any field
  1665. // with an empty value appearing in NullFields will be sent to the
  1666. // server as null. It is an error if a field in this list has a
  1667. // non-empty value. This may be used to include null fields in Patch
  1668. // requests.
  1669. NullFields []string `json:"-"`
  1670. }
  1671. func (s *SetupTag) MarshalJSON() ([]byte, error) {
  1672. type NoMethod SetupTag
  1673. raw := NoMethod(*s)
  1674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1675. }
  1676. // SyncStatus: The status of a workspace after synchronization.
  1677. type SyncStatus struct {
  1678. // MergeConflict: Synchornization operation detected a merge conflict.
  1679. MergeConflict bool `json:"mergeConflict,omitempty"`
  1680. // SyncError: An error occurred during the synchronization operation.
  1681. SyncError bool `json:"syncError,omitempty"`
  1682. // ForceSendFields is a list of field names (e.g. "MergeConflict") to
  1683. // unconditionally include in API requests. By default, fields with
  1684. // empty values are omitted from API requests. However, any non-pointer,
  1685. // non-interface field appearing in ForceSendFields will be sent to the
  1686. // server regardless of whether the field is empty or not. This may be
  1687. // used to include empty fields in Patch requests.
  1688. ForceSendFields []string `json:"-"`
  1689. // NullFields is a list of field names (e.g. "MergeConflict") to include
  1690. // in API requests with the JSON null value. By default, fields with
  1691. // empty values are omitted from API requests. However, any field with
  1692. // an empty value appearing in NullFields will be sent to the server as
  1693. // null. It is an error if a field in this list has a non-empty value.
  1694. // This may be used to include null fields in Patch requests.
  1695. NullFields []string `json:"-"`
  1696. }
  1697. func (s *SyncStatus) MarshalJSON() ([]byte, error) {
  1698. type NoMethod SyncStatus
  1699. raw := NoMethod(*s)
  1700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1701. }
  1702. // SyncWorkspaceResponse: A response after synchronizing the workspace
  1703. // to the latest container version.
  1704. type SyncWorkspaceResponse struct {
  1705. // MergeConflict: The merge conflict after sync. If this field is not
  1706. // empty, the sync is still treated as successful. But a version cannot
  1707. // be created until all conflicts are resolved.
  1708. MergeConflict []*MergeConflict `json:"mergeConflict,omitempty"`
  1709. // SyncStatus: Indicates whether synchronization caused a merge conflict
  1710. // or sync error.
  1711. SyncStatus *SyncStatus `json:"syncStatus,omitempty"`
  1712. // ServerResponse contains the HTTP response code and headers from the
  1713. // server.
  1714. googleapi.ServerResponse `json:"-"`
  1715. // ForceSendFields is a list of field names (e.g. "MergeConflict") to
  1716. // unconditionally include in API requests. By default, fields with
  1717. // empty values are omitted from API requests. However, any non-pointer,
  1718. // non-interface field appearing in ForceSendFields will be sent to the
  1719. // server regardless of whether the field is empty or not. This may be
  1720. // used to include empty fields in Patch requests.
  1721. ForceSendFields []string `json:"-"`
  1722. // NullFields is a list of field names (e.g. "MergeConflict") to include
  1723. // in API requests with the JSON null value. By default, fields with
  1724. // empty values are omitted from API requests. However, any field with
  1725. // an empty value appearing in NullFields will be sent to the server as
  1726. // null. It is an error if a field in this list has a non-empty value.
  1727. // This may be used to include null fields in Patch requests.
  1728. NullFields []string `json:"-"`
  1729. }
  1730. func (s *SyncWorkspaceResponse) MarshalJSON() ([]byte, error) {
  1731. type NoMethod SyncWorkspaceResponse
  1732. raw := NoMethod(*s)
  1733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1734. }
  1735. // Tag: Represents a Google Tag Manager Tag.
  1736. type Tag struct {
  1737. // AccountId: GTM Account ID.
  1738. AccountId string `json:"accountId,omitempty"`
  1739. // BlockingRuleId: Blocking rule IDs. If any of the listed rules
  1740. // evaluate to true, the tag will not fire.
  1741. BlockingRuleId []string `json:"blockingRuleId,omitempty"`
  1742. // BlockingTriggerId: Blocking trigger IDs. If any of the listed
  1743. // triggers evaluate to true, the tag will not fire.
  1744. BlockingTriggerId []string `json:"blockingTriggerId,omitempty"`
  1745. // ContainerId: GTM Container ID.
  1746. ContainerId string `json:"containerId,omitempty"`
  1747. // Fingerprint: The fingerprint of the GTM Tag as computed at storage
  1748. // time. This value is recomputed whenever the tag is modified.
  1749. Fingerprint string `json:"fingerprint,omitempty"`
  1750. // FiringRuleId: Firing rule IDs. A tag will fire when any of the listed
  1751. // rules are true and all of its blockingRuleIds (if any specified) are
  1752. // false.
  1753. FiringRuleId []string `json:"firingRuleId,omitempty"`
  1754. // FiringTriggerId: Firing trigger IDs. A tag will fire when any of the
  1755. // listed triggers are true and all of its blockingTriggerIds (if any
  1756. // specified) are false.
  1757. FiringTriggerId []string `json:"firingTriggerId,omitempty"`
  1758. // LiveOnly: If set to true, this tag will only fire in the live
  1759. // environment (e.g. not in preview or debug mode).
  1760. LiveOnly bool `json:"liveOnly,omitempty"`
  1761. // Name: Tag display name.
  1762. Name string `json:"name,omitempty"`
  1763. // Notes: User notes on how to apply this tag in the container.
  1764. Notes string `json:"notes,omitempty"`
  1765. // Parameter: The tag's parameters.
  1766. Parameter []*Parameter `json:"parameter,omitempty"`
  1767. // ParentFolderId: Parent folder id.
  1768. ParentFolderId string `json:"parentFolderId,omitempty"`
  1769. // Path: GTM Tag's API relative path.
  1770. Path string `json:"path,omitempty"`
  1771. // Paused: Indicates whether the tag is paused, which prevents the tag
  1772. // from firing.
  1773. Paused bool `json:"paused,omitempty"`
  1774. // Priority: User defined numeric priority of the tag. Tags are fired
  1775. // asynchronously in order of priority. Tags with higher numeric value
  1776. // fire first. A tag's priority can be a positive or negative value. The
  1777. // default value is 0.
  1778. Priority *Parameter `json:"priority,omitempty"`
  1779. // ScheduleEndMs: The end timestamp in milliseconds to schedule a tag.
  1780. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  1781. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  1782. // tag.
  1783. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  1784. // SetupTag: The list of setup tags. Currently we only allow one.
  1785. SetupTag []*SetupTag `json:"setupTag,omitempty"`
  1786. // TagFiringOption: Option to fire this tag.
  1787. //
  1788. // Possible values:
  1789. // "oncePerEvent"
  1790. // "oncePerLoad"
  1791. // "tagFiringOptionUnspecified"
  1792. // "unlimited"
  1793. TagFiringOption string `json:"tagFiringOption,omitempty"`
  1794. // TagId: The Tag ID uniquely identifies the GTM Tag.
  1795. TagId string `json:"tagId,omitempty"`
  1796. // TagManagerUrl: Auto generated link to the tag manager UI
  1797. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  1798. // TeardownTag: The list of teardown tags. Currently we only allow one.
  1799. TeardownTag []*TeardownTag `json:"teardownTag,omitempty"`
  1800. // Type: GTM Tag Type.
  1801. Type string `json:"type,omitempty"`
  1802. // WorkspaceId: GTM Workspace ID.
  1803. WorkspaceId string `json:"workspaceId,omitempty"`
  1804. // ServerResponse contains the HTTP response code and headers from the
  1805. // server.
  1806. googleapi.ServerResponse `json:"-"`
  1807. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1808. // unconditionally include in API requests. By default, fields with
  1809. // empty values are omitted from API requests. However, any non-pointer,
  1810. // non-interface field appearing in ForceSendFields will be sent to the
  1811. // server regardless of whether the field is empty or not. This may be
  1812. // used to include empty fields in Patch requests.
  1813. ForceSendFields []string `json:"-"`
  1814. // NullFields is a list of field names (e.g. "AccountId") to include in
  1815. // API requests with the JSON null value. By default, fields with empty
  1816. // values are omitted from API requests. However, any field with an
  1817. // empty value appearing in NullFields will be sent to the server as
  1818. // null. It is an error if a field in this list has a non-empty value.
  1819. // This may be used to include null fields in Patch requests.
  1820. NullFields []string `json:"-"`
  1821. }
  1822. func (s *Tag) MarshalJSON() ([]byte, error) {
  1823. type NoMethod Tag
  1824. raw := NoMethod(*s)
  1825. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1826. }
  1827. // TeardownTag: Represents a tag that fires after another tag in order
  1828. // to tear down dependencies.
  1829. type TeardownTag struct {
  1830. // StopTeardownOnFailure: If true, fire the teardown tag if and only if
  1831. // the main tag fires successfully. If false, fire the teardown tag
  1832. // regardless of main tag firing status.
  1833. StopTeardownOnFailure bool `json:"stopTeardownOnFailure,omitempty"`
  1834. // TagName: The name of the teardown tag.
  1835. TagName string `json:"tagName,omitempty"`
  1836. // ForceSendFields is a list of field names (e.g.
  1837. // "StopTeardownOnFailure") to unconditionally include in API requests.
  1838. // By default, fields with empty values are omitted from API requests.
  1839. // However, any non-pointer, non-interface field appearing in
  1840. // ForceSendFields will be sent to the server regardless of whether the
  1841. // field is empty or not. This may be used to include empty fields in
  1842. // Patch requests.
  1843. ForceSendFields []string `json:"-"`
  1844. // NullFields is a list of field names (e.g. "StopTeardownOnFailure") to
  1845. // include in API requests with the JSON null value. By default, fields
  1846. // with empty values are omitted from API requests. However, any field
  1847. // with an empty value appearing in NullFields will be sent to the
  1848. // server as null. It is an error if a field in this list has a
  1849. // non-empty value. This may be used to include null fields in Patch
  1850. // requests.
  1851. NullFields []string `json:"-"`
  1852. }
  1853. func (s *TeardownTag) MarshalJSON() ([]byte, error) {
  1854. type NoMethod TeardownTag
  1855. raw := NoMethod(*s)
  1856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1857. }
  1858. // Timestamp: A Timestamp represents a point in time independent of any
  1859. // time zone or calendar, represented as seconds and fractions of
  1860. // seconds at nanosecond resolution in UTC Epoch time. It is encoded
  1861. // using the Proleptic Gregorian Calendar which extends the Gregorian
  1862. // calendar backwards to year one. It is encoded assuming all minutes
  1863. // are 60 seconds long, i.e. leap seconds are "smeared" so that no leap
  1864. // second table is needed for interpretation. Range is from
  1865. // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
  1866. // restricting to that range, we ensure that we can convert to and from
  1867. // RFC 3339 date strings. See
  1868. // [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc333
  1869. // 9.txt).
  1870. //
  1871. // # Examples
  1872. //
  1873. // Example 1: Compute Timestamp from POSIX `time()`.
  1874. //
  1875. // Timestamp timestamp; timestamp.set_seconds(time(NULL));
  1876. // timestamp.set_nanos(0);
  1877. //
  1878. // Example 2: Compute Timestamp from POSIX `gettimeofday()`.
  1879. //
  1880. // struct timeval tv; gettimeofday(&tv, NULL);
  1881. //
  1882. // Timestamp timestamp; timestamp.set_seconds(tv.tv_sec);
  1883. // timestamp.set_nanos(tv.tv_usec * 1000);
  1884. //
  1885. // Example 3: Compute Timestamp from Win32
  1886. // `GetSystemTimeAsFileTime()`.
  1887. //
  1888. // FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks =
  1889. // (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
  1890. //
  1891. // // A Windows tick is 100 nanoseconds. Windows epoch
  1892. // 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch
  1893. // 1970-01-01T00:00:00Z. Timestamp timestamp;
  1894. // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
  1895. // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
  1896. //
  1897. // Example 4: Compute Timestamp from Java
  1898. // `System.currentTimeMillis()`.
  1899. //
  1900. // long millis = System.currentTimeMillis();
  1901. //
  1902. // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis /
  1903. // 1000) .setNanos((int) ((millis % 1000) *
  1904. // 1000000)).build();
  1905. //
  1906. //
  1907. //
  1908. // Example 5: Compute Timestamp from current time in Python.
  1909. //
  1910. // timestamp = Timestamp() timestamp.GetCurrentTime()
  1911. //
  1912. // # JSON Mapping
  1913. //
  1914. // In JSON format, the Timestamp type is encoded as a string in the [RFC
  1915. // 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
  1916. // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
  1917. // where {year} is always expressed using four digits while {month},
  1918. // {day}, {hour}, {min}, and {sec} are zero-padded to two digits each.
  1919. // The fractional seconds, which can go up to 9 digits (i.e. up to 1
  1920. // nanosecond resolution), are optional. The "Z" suffix indicates the
  1921. // timezone ("UTC"); the timezone is required, though only UTC (as
  1922. // indicated by "Z") is presently supported.
  1923. //
  1924. // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
  1925. // 01:30 UTC on January 15, 2017.
  1926. //
  1927. // In JavaScript, one can convert a Date object to this format using the
  1928. // standard
  1929. // [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScrip
  1930. // t/Reference/Global_Objects/Date/toISOString] method. In Python, a
  1931. // standard `datetime.datetime` object can be converted to this format
  1932. // using
  1933. // [`strftime`](https://docs.python.org/2/library/time.html#time.strftime
  1934. // ) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in
  1935. // Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
  1936. // http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) to obtain a formatter capable of generating timestamps in this
  1937. // format.
  1938. type Timestamp struct {
  1939. // Nanos: Non-negative fractions of a second at nanosecond resolution.
  1940. // Negative second values with fractions must still have non-negative
  1941. // nanos values that count forward in time. Must be from 0 to
  1942. // 999,999,999 inclusive.
  1943. Nanos int64 `json:"nanos,omitempty"`
  1944. // Seconds: Represents seconds of UTC time since Unix epoch
  1945. // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
  1946. // 9999-12-31T23:59:59Z inclusive.
  1947. Seconds int64 `json:"seconds,omitempty,string"`
  1948. // ForceSendFields is a list of field names (e.g. "Nanos") to
  1949. // unconditionally include in API requests. By default, fields with
  1950. // empty values are omitted from API requests. However, any non-pointer,
  1951. // non-interface field appearing in ForceSendFields will be sent to the
  1952. // server regardless of whether the field is empty or not. This may be
  1953. // used to include empty fields in Patch requests.
  1954. ForceSendFields []string `json:"-"`
  1955. // NullFields is a list of field names (e.g. "Nanos") to include in API
  1956. // requests with the JSON null value. By default, fields with empty
  1957. // values are omitted from API requests. However, any field with an
  1958. // empty value appearing in NullFields will be sent to the server as
  1959. // null. It is an error if a field in this list has a non-empty value.
  1960. // This may be used to include null fields in Patch requests.
  1961. NullFields []string `json:"-"`
  1962. }
  1963. func (s *Timestamp) MarshalJSON() ([]byte, error) {
  1964. type NoMethod Timestamp
  1965. raw := NoMethod(*s)
  1966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1967. }
  1968. // Trigger: Represents a Google Tag Manager Trigger
  1969. type Trigger struct {
  1970. // AccountId: GTM Account ID.
  1971. AccountId string `json:"accountId,omitempty"`
  1972. // AutoEventFilter: Used in the case of auto event tracking.
  1973. AutoEventFilter []*Condition `json:"autoEventFilter,omitempty"`
  1974. // CheckValidation: Whether or not we should only fire tags if the form
  1975. // submit or link click event is not cancelled by some other event
  1976. // handler (e.g. because of validation). Only valid for Form Submission
  1977. // and Link Click triggers.
  1978. CheckValidation *Parameter `json:"checkValidation,omitempty"`
  1979. // ContainerId: GTM Container ID.
  1980. ContainerId string `json:"containerId,omitempty"`
  1981. // ContinuousTimeMinMilliseconds: A visibility trigger minimum
  1982. // continuous visible time (in milliseconds). Only valid for AMP
  1983. // Visibility trigger.
  1984. ContinuousTimeMinMilliseconds *Parameter `json:"continuousTimeMinMilliseconds,omitempty"`
  1985. // CustomEventFilter: Used in the case of custom event, which is fired
  1986. // iff all Conditions are true.
  1987. CustomEventFilter []*Condition `json:"customEventFilter,omitempty"`
  1988. // EventName: Name of the GTM event that is fired. Only valid for Timer
  1989. // triggers.
  1990. EventName *Parameter `json:"eventName,omitempty"`
  1991. // Filter: The trigger will only fire iff all Conditions are true.
  1992. Filter []*Condition `json:"filter,omitempty"`
  1993. // Fingerprint: The fingerprint of the GTM Trigger as computed at
  1994. // storage time. This value is recomputed whenever the trigger is
  1995. // modified.
  1996. Fingerprint string `json:"fingerprint,omitempty"`
  1997. // HorizontalScrollPercentageList: List of integer percentage values for
  1998. // scroll triggers. The trigger will fire when each percentage is
  1999. // reached when the view is scrolled horizontally. Only valid for AMP
  2000. // scroll triggers.
  2001. HorizontalScrollPercentageList *Parameter `json:"horizontalScrollPercentageList,omitempty"`
  2002. // Interval: Time between triggering recurring Timer Events (in
  2003. // milliseconds). Only valid for Timer triggers.
  2004. Interval *Parameter `json:"interval,omitempty"`
  2005. // IntervalSeconds: Time between Timer Events to fire (in seconds). Only
  2006. // valid for AMP Timer trigger.
  2007. IntervalSeconds *Parameter `json:"intervalSeconds,omitempty"`
  2008. // Limit: Limit of the number of GTM events this Timer Trigger will
  2009. // fire. If no limit is set, we will continue to fire GTM events until
  2010. // the user leaves the page. Only valid for Timer triggers.
  2011. Limit *Parameter `json:"limit,omitempty"`
  2012. // MaxTimerLengthSeconds: Max time to fire Timer Events (in seconds).
  2013. // Only valid for AMP Timer trigger.
  2014. MaxTimerLengthSeconds *Parameter `json:"maxTimerLengthSeconds,omitempty"`
  2015. // Name: Trigger display name.
  2016. Name string `json:"name,omitempty"`
  2017. // Notes: User notes on how to apply this trigger in the container.
  2018. Notes string `json:"notes,omitempty"`
  2019. // Parameter: Additional parameters.
  2020. Parameter []*Parameter `json:"parameter,omitempty"`
  2021. // ParentFolderId: Parent folder id.
  2022. ParentFolderId string `json:"parentFolderId,omitempty"`
  2023. // Path: GTM Trigger's API relative path.
  2024. Path string `json:"path,omitempty"`
  2025. // Selector: A click trigger CSS selector (i.e. "a", "button" etc.).
  2026. // Only valid for AMP Click trigger.
  2027. Selector *Parameter `json:"selector,omitempty"`
  2028. // TagManagerUrl: Auto generated link to the tag manager UI
  2029. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2030. // TotalTimeMinMilliseconds: A visibility trigger minimum total visible
  2031. // time (in milliseconds). Only valid for AMP Visibility trigger.
  2032. TotalTimeMinMilliseconds *Parameter `json:"totalTimeMinMilliseconds,omitempty"`
  2033. // TriggerId: The Trigger ID uniquely identifies the GTM Trigger.
  2034. TriggerId string `json:"triggerId,omitempty"`
  2035. // Type: Defines the data layer event that causes this trigger.
  2036. //
  2037. // Possible values:
  2038. // "always"
  2039. // "ampClick"
  2040. // "ampScroll"
  2041. // "ampTimer"
  2042. // "ampVisibility"
  2043. // "click"
  2044. // "customEvent"
  2045. // "domReady"
  2046. // "elementVisibility"
  2047. // "eventTypeUnspecified"
  2048. // "firebaseAppException"
  2049. // "firebaseAppUpdate"
  2050. // "firebaseCampaign"
  2051. // "firebaseFirstOpen"
  2052. // "firebaseInAppPurchase"
  2053. // "firebaseNotificationDismiss"
  2054. // "firebaseNotificationForeground"
  2055. // "firebaseNotificationOpen"
  2056. // "firebaseNotificationReceive"
  2057. // "firebaseOsUpdate"
  2058. // "firebaseSessionStart"
  2059. // "firebaseUserEngagement"
  2060. // "formSubmission"
  2061. // "historyChange"
  2062. // "jsError"
  2063. // "linkClick"
  2064. // "pageview"
  2065. // "scrollDepth"
  2066. // "timer"
  2067. // "windowLoaded"
  2068. // "youTubeVideo"
  2069. Type string `json:"type,omitempty"`
  2070. // UniqueTriggerId: Globally unique id of the trigger that
  2071. // auto-generates this (a Form Submit, Link Click or Timer listener) if
  2072. // any. Used to make incompatible auto-events work together with trigger
  2073. // filtering based on trigger ids. This value is populated during output
  2074. // generation since the tags implied by triggers don't exist until then.
  2075. // Only valid for Form Submit, Link Click and Timer triggers.
  2076. UniqueTriggerId *Parameter `json:"uniqueTriggerId,omitempty"`
  2077. // VerticalScrollPercentageList: List of integer percentage values for
  2078. // scroll triggers. The trigger will fire when each percentage is
  2079. // reached when the view is scrolled vertically. Only valid for AMP
  2080. // scroll triggers.
  2081. VerticalScrollPercentageList *Parameter `json:"verticalScrollPercentageList,omitempty"`
  2082. // VisibilitySelector: A visibility trigger CSS selector (i.e. "#id").
  2083. // Only valid for AMP Visibility trigger.
  2084. VisibilitySelector *Parameter `json:"visibilitySelector,omitempty"`
  2085. // VisiblePercentageMax: A visibility trigger maximum percent
  2086. // visibility. Only valid for AMP Visibility trigger.
  2087. VisiblePercentageMax *Parameter `json:"visiblePercentageMax,omitempty"`
  2088. // VisiblePercentageMin: A visibility trigger minimum percent
  2089. // visibility. Only valid for AMP Visibility trigger.
  2090. VisiblePercentageMin *Parameter `json:"visiblePercentageMin,omitempty"`
  2091. // WaitForTags: Whether or not we should delay the form submissions or
  2092. // link opening until all of the tags have fired (by preventing the
  2093. // default action and later simulating the default action). Only valid
  2094. // for Form Submission and Link Click triggers.
  2095. WaitForTags *Parameter `json:"waitForTags,omitempty"`
  2096. // WaitForTagsTimeout: How long to wait (in milliseconds) for tags to
  2097. // fire when 'waits_for_tags' above evaluates to true. Only valid for
  2098. // Form Submission and Link Click triggers.
  2099. WaitForTagsTimeout *Parameter `json:"waitForTagsTimeout,omitempty"`
  2100. // WorkspaceId: GTM Workspace ID.
  2101. WorkspaceId string `json:"workspaceId,omitempty"`
  2102. // ServerResponse contains the HTTP response code and headers from the
  2103. // server.
  2104. googleapi.ServerResponse `json:"-"`
  2105. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2106. // unconditionally include in API requests. By default, fields with
  2107. // empty values are omitted from API requests. However, any non-pointer,
  2108. // non-interface field appearing in ForceSendFields will be sent to the
  2109. // server regardless of whether the field is empty or not. This may be
  2110. // used to include empty fields in Patch requests.
  2111. ForceSendFields []string `json:"-"`
  2112. // NullFields is a list of field names (e.g. "AccountId") to include in
  2113. // API requests with the JSON null value. By default, fields with empty
  2114. // values are omitted from API requests. However, any field with an
  2115. // empty value appearing in NullFields will be sent to the server as
  2116. // null. It is an error if a field in this list has a non-empty value.
  2117. // This may be used to include null fields in Patch requests.
  2118. NullFields []string `json:"-"`
  2119. }
  2120. func (s *Trigger) MarshalJSON() ([]byte, error) {
  2121. type NoMethod Trigger
  2122. raw := NoMethod(*s)
  2123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2124. }
  2125. // UpdateWorkspaceProposalRequest: Updates a workspace proposal with
  2126. // patch-like semantics.
  2127. type UpdateWorkspaceProposalRequest struct {
  2128. // Fingerprint: When provided, this fingerprint must match the
  2129. // fingerprint of the proposal in storage.
  2130. Fingerprint string `json:"fingerprint,omitempty"`
  2131. // NewComment: If present, a new comment is added to the workspace
  2132. // proposal history.
  2133. NewComment *WorkspaceProposalHistoryComment `json:"newComment,omitempty"`
  2134. // Reviewers: If present, the list of reviewers of the workspace
  2135. // proposal is updated.
  2136. Reviewers []*WorkspaceProposalUser `json:"reviewers,omitempty"`
  2137. // Status: If present, the status of the workspace proposal is updated.
  2138. //
  2139. // Possible values:
  2140. // "approved"
  2141. // "cancelled"
  2142. // "completed"
  2143. // "requested"
  2144. // "reviewed"
  2145. // "statusUnspecified"
  2146. Status string `json:"status,omitempty"`
  2147. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  2148. // unconditionally include in API requests. By default, fields with
  2149. // empty values are omitted from API requests. However, any non-pointer,
  2150. // non-interface field appearing in ForceSendFields will be sent to the
  2151. // server regardless of whether the field is empty or not. This may be
  2152. // used to include empty fields in Patch requests.
  2153. ForceSendFields []string `json:"-"`
  2154. // NullFields is a list of field names (e.g. "Fingerprint") to include
  2155. // in API requests with the JSON null value. By default, fields with
  2156. // empty values are omitted from API requests. However, any field with
  2157. // an empty value appearing in NullFields will be sent to the server as
  2158. // null. It is an error if a field in this list has a non-empty value.
  2159. // This may be used to include null fields in Patch requests.
  2160. NullFields []string `json:"-"`
  2161. }
  2162. func (s *UpdateWorkspaceProposalRequest) MarshalJSON() ([]byte, error) {
  2163. type NoMethod UpdateWorkspaceProposalRequest
  2164. raw := NoMethod(*s)
  2165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2166. }
  2167. // UserPermission: Represents a user's permissions to an account and its
  2168. // container.
  2169. type UserPermission struct {
  2170. // AccountAccess: GTM Account access permissions.
  2171. AccountAccess *AccountAccess `json:"accountAccess,omitempty"`
  2172. // AccountId: The Account ID uniquely identifies the GTM Account.
  2173. AccountId string `json:"accountId,omitempty"`
  2174. // ContainerAccess: GTM Container access permissions.
  2175. ContainerAccess []*ContainerAccess `json:"containerAccess,omitempty"`
  2176. // EmailAddress: User's email address.
  2177. EmailAddress string `json:"emailAddress,omitempty"`
  2178. // Path: GTM UserPermission's API relative path.
  2179. Path string `json:"path,omitempty"`
  2180. // ServerResponse contains the HTTP response code and headers from the
  2181. // server.
  2182. googleapi.ServerResponse `json:"-"`
  2183. // ForceSendFields is a list of field names (e.g. "AccountAccess") to
  2184. // unconditionally include in API requests. By default, fields with
  2185. // empty values are omitted from API requests. However, any non-pointer,
  2186. // non-interface field appearing in ForceSendFields will be sent to the
  2187. // server regardless of whether the field is empty or not. This may be
  2188. // used to include empty fields in Patch requests.
  2189. ForceSendFields []string `json:"-"`
  2190. // NullFields is a list of field names (e.g. "AccountAccess") to include
  2191. // in API requests with the JSON null value. By default, fields with
  2192. // empty values are omitted from API requests. However, any field with
  2193. // an empty value appearing in NullFields will be sent to the server as
  2194. // null. It is an error if a field in this list has a non-empty value.
  2195. // This may be used to include null fields in Patch requests.
  2196. NullFields []string `json:"-"`
  2197. }
  2198. func (s *UserPermission) MarshalJSON() ([]byte, error) {
  2199. type NoMethod UserPermission
  2200. raw := NoMethod(*s)
  2201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2202. }
  2203. // Variable: Represents a Google Tag Manager Variable.
  2204. type Variable struct {
  2205. // AccountId: GTM Account ID.
  2206. AccountId string `json:"accountId,omitempty"`
  2207. // ContainerId: GTM Container ID.
  2208. ContainerId string `json:"containerId,omitempty"`
  2209. // DisablingTriggerId: For mobile containers only: A list of trigger IDs
  2210. // for disabling conditional variables; the variable is enabled if one
  2211. // of the enabling trigger is true while all the disabling trigger are
  2212. // false. Treated as an unordered set.
  2213. DisablingTriggerId []string `json:"disablingTriggerId,omitempty"`
  2214. // EnablingTriggerId: For mobile containers only: A list of trigger IDs
  2215. // for enabling conditional variables; the variable is enabled if one of
  2216. // the enabling triggers is true while all the disabling triggers are
  2217. // false. Treated as an unordered set.
  2218. EnablingTriggerId []string `json:"enablingTriggerId,omitempty"`
  2219. // Fingerprint: The fingerprint of the GTM Variable as computed at
  2220. // storage time. This value is recomputed whenever the variable is
  2221. // modified.
  2222. Fingerprint string `json:"fingerprint,omitempty"`
  2223. // Name: Variable display name.
  2224. Name string `json:"name,omitempty"`
  2225. // Notes: User notes on how to apply this variable in the container.
  2226. Notes string `json:"notes,omitempty"`
  2227. // Parameter: The variable's parameters.
  2228. Parameter []*Parameter `json:"parameter,omitempty"`
  2229. // ParentFolderId: Parent folder id.
  2230. ParentFolderId string `json:"parentFolderId,omitempty"`
  2231. // Path: GTM Variable's API relative path.
  2232. Path string `json:"path,omitempty"`
  2233. // ScheduleEndMs: The end timestamp in milliseconds to schedule a
  2234. // variable.
  2235. ScheduleEndMs int64 `json:"scheduleEndMs,omitempty,string"`
  2236. // ScheduleStartMs: The start timestamp in milliseconds to schedule a
  2237. // variable.
  2238. ScheduleStartMs int64 `json:"scheduleStartMs,omitempty,string"`
  2239. // TagManagerUrl: Auto generated link to the tag manager UI
  2240. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2241. // Type: GTM Variable Type.
  2242. Type string `json:"type,omitempty"`
  2243. // VariableId: The Variable ID uniquely identifies the GTM Variable.
  2244. VariableId string `json:"variableId,omitempty"`
  2245. // WorkspaceId: GTM Workspace ID.
  2246. WorkspaceId string `json:"workspaceId,omitempty"`
  2247. // ServerResponse contains the HTTP response code and headers from the
  2248. // server.
  2249. googleapi.ServerResponse `json:"-"`
  2250. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2251. // unconditionally include in API requests. By default, fields with
  2252. // empty values are omitted from API requests. However, any non-pointer,
  2253. // non-interface field appearing in ForceSendFields will be sent to the
  2254. // server regardless of whether the field is empty or not. This may be
  2255. // used to include empty fields in Patch requests.
  2256. ForceSendFields []string `json:"-"`
  2257. // NullFields is a list of field names (e.g. "AccountId") to include in
  2258. // API requests with the JSON null value. By default, fields with empty
  2259. // values are omitted from API requests. However, any field with an
  2260. // empty value appearing in NullFields will be sent to the server as
  2261. // null. It is an error if a field in this list has a non-empty value.
  2262. // This may be used to include null fields in Patch requests.
  2263. NullFields []string `json:"-"`
  2264. }
  2265. func (s *Variable) MarshalJSON() ([]byte, error) {
  2266. type NoMethod Variable
  2267. raw := NoMethod(*s)
  2268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2269. }
  2270. // Workspace: Represents a Google Tag Manager Container Workspace.
  2271. type Workspace struct {
  2272. // AccountId: GTM Account ID.
  2273. AccountId string `json:"accountId,omitempty"`
  2274. // ContainerId: GTM Container ID.
  2275. ContainerId string `json:"containerId,omitempty"`
  2276. // Description: Workspace description.
  2277. Description string `json:"description,omitempty"`
  2278. // Fingerprint: The fingerprint of the GTM Workspace as computed at
  2279. // storage time. This value is recomputed whenever the workspace is
  2280. // modified.
  2281. Fingerprint string `json:"fingerprint,omitempty"`
  2282. // Name: Workspace display name.
  2283. Name string `json:"name,omitempty"`
  2284. // Path: GTM Workspace's API relative path.
  2285. Path string `json:"path,omitempty"`
  2286. // TagManagerUrl: Auto generated link to the tag manager UI
  2287. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2288. // WorkspaceId: The Workspace ID uniquely identifies the GTM Workspace.
  2289. WorkspaceId string `json:"workspaceId,omitempty"`
  2290. // ServerResponse contains the HTTP response code and headers from the
  2291. // server.
  2292. googleapi.ServerResponse `json:"-"`
  2293. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2294. // unconditionally include in API requests. By default, fields with
  2295. // empty values are omitted from API requests. However, any non-pointer,
  2296. // non-interface field appearing in ForceSendFields will be sent to the
  2297. // server regardless of whether the field is empty or not. This may be
  2298. // used to include empty fields in Patch requests.
  2299. ForceSendFields []string `json:"-"`
  2300. // NullFields is a list of field names (e.g. "AccountId") to include in
  2301. // API requests with the JSON null value. By default, fields with empty
  2302. // values are omitted from API requests. However, any field with an
  2303. // empty value appearing in NullFields will be sent to the server as
  2304. // null. It is an error if a field in this list has a non-empty value.
  2305. // This may be used to include null fields in Patch requests.
  2306. NullFields []string `json:"-"`
  2307. }
  2308. func (s *Workspace) MarshalJSON() ([]byte, error) {
  2309. type NoMethod Workspace
  2310. raw := NoMethod(*s)
  2311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2312. }
  2313. // WorkspaceProposal: A workspace proposal represents an ongoing review
  2314. // of workspace changes in an effort to gain approval for container
  2315. // version creation.
  2316. type WorkspaceProposal struct {
  2317. // Authors: List of authors for the workspace proposal.
  2318. Authors []*WorkspaceProposalUser `json:"authors,omitempty"`
  2319. // Fingerprint: The fingerprint of the GTM workspace proposal as
  2320. // computed at storage time. This value is recomputed whenever the
  2321. // proposal is modified.
  2322. Fingerprint string `json:"fingerprint,omitempty"`
  2323. // History: Records the history of comments and status changes.
  2324. History []*WorkspaceProposalHistory `json:"history,omitempty"`
  2325. // Path: GTM workspace proposal's relative path.
  2326. Path string `json:"path,omitempty"`
  2327. // Reviewers: Lists of reviewers for the workspace proposal.
  2328. Reviewers []*WorkspaceProposalUser `json:"reviewers,omitempty"`
  2329. // Status: The status of the workspace proposal as it goes through
  2330. // review.
  2331. //
  2332. // Possible values:
  2333. // "approved"
  2334. // "cancelled"
  2335. // "completed"
  2336. // "requested"
  2337. // "reviewed"
  2338. // "statusUnspecified"
  2339. Status string `json:"status,omitempty"`
  2340. // ServerResponse contains the HTTP response code and headers from the
  2341. // server.
  2342. googleapi.ServerResponse `json:"-"`
  2343. // ForceSendFields is a list of field names (e.g. "Authors") to
  2344. // unconditionally include in API requests. By default, fields with
  2345. // empty values are omitted from API requests. However, any non-pointer,
  2346. // non-interface field appearing in ForceSendFields will be sent to the
  2347. // server regardless of whether the field is empty or not. This may be
  2348. // used to include empty fields in Patch requests.
  2349. ForceSendFields []string `json:"-"`
  2350. // NullFields is a list of field names (e.g. "Authors") to include in
  2351. // API requests with the JSON null value. By default, fields with empty
  2352. // values are omitted from API requests. However, any field with an
  2353. // empty value appearing in NullFields will be sent to the server as
  2354. // null. It is an error if a field in this list has a non-empty value.
  2355. // This may be used to include null fields in Patch requests.
  2356. NullFields []string `json:"-"`
  2357. }
  2358. func (s *WorkspaceProposal) MarshalJSON() ([]byte, error) {
  2359. type NoMethod WorkspaceProposal
  2360. raw := NoMethod(*s)
  2361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2362. }
  2363. // WorkspaceProposalHistory: A history event that represents a comment
  2364. // or status change in the proposal.
  2365. type WorkspaceProposalHistory struct {
  2366. // Comment: A user or reviewer comment.
  2367. Comment *WorkspaceProposalHistoryComment `json:"comment,omitempty"`
  2368. // CreatedBy: The party responsible for the change in history.
  2369. CreatedBy *WorkspaceProposalUser `json:"createdBy,omitempty"`
  2370. // CreatedTimestamp: When this history event was added to the workspace
  2371. // proposal.
  2372. CreatedTimestamp *Timestamp `json:"createdTimestamp,omitempty"`
  2373. // StatusChange: A change in the proposal's status.
  2374. StatusChange *WorkspaceProposalHistoryStatusChange `json:"statusChange,omitempty"`
  2375. // Type: The history type distinguishing between comments and status
  2376. // changes.
  2377. //
  2378. // Possible values:
  2379. // "comment"
  2380. // "statusChange"
  2381. // "unspecified"
  2382. Type string `json:"type,omitempty"`
  2383. // ForceSendFields is a list of field names (e.g. "Comment") to
  2384. // unconditionally include in API requests. By default, fields with
  2385. // empty values are omitted from API requests. However, any non-pointer,
  2386. // non-interface field appearing in ForceSendFields will be sent to the
  2387. // server regardless of whether the field is empty or not. This may be
  2388. // used to include empty fields in Patch requests.
  2389. ForceSendFields []string `json:"-"`
  2390. // NullFields is a list of field names (e.g. "Comment") to include in
  2391. // API requests with the JSON null value. By default, fields with empty
  2392. // values are omitted from API requests. However, any field with an
  2393. // empty value appearing in NullFields will be sent to the server as
  2394. // null. It is an error if a field in this list has a non-empty value.
  2395. // This may be used to include null fields in Patch requests.
  2396. NullFields []string `json:"-"`
  2397. }
  2398. func (s *WorkspaceProposalHistory) MarshalJSON() ([]byte, error) {
  2399. type NoMethod WorkspaceProposalHistory
  2400. raw := NoMethod(*s)
  2401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2402. }
  2403. // WorkspaceProposalHistoryComment: A comment from the reviewer or
  2404. // author.
  2405. type WorkspaceProposalHistoryComment struct {
  2406. // Content: The contents of the reviewer or author comment.
  2407. Content string `json:"content,omitempty"`
  2408. // ForceSendFields is a list of field names (e.g. "Content") to
  2409. // unconditionally include in API requests. By default, fields with
  2410. // empty values are omitted from API requests. However, any non-pointer,
  2411. // non-interface field appearing in ForceSendFields will be sent to the
  2412. // server regardless of whether the field is empty or not. This may be
  2413. // used to include empty fields in Patch requests.
  2414. ForceSendFields []string `json:"-"`
  2415. // NullFields is a list of field names (e.g. "Content") to include in
  2416. // API requests with the JSON null value. By default, fields with empty
  2417. // values are omitted from API requests. However, any field with an
  2418. // empty value appearing in NullFields will be sent to the server as
  2419. // null. It is an error if a field in this list has a non-empty value.
  2420. // This may be used to include null fields in Patch requests.
  2421. NullFields []string `json:"-"`
  2422. }
  2423. func (s *WorkspaceProposalHistoryComment) MarshalJSON() ([]byte, error) {
  2424. type NoMethod WorkspaceProposalHistoryComment
  2425. raw := NoMethod(*s)
  2426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2427. }
  2428. // WorkspaceProposalHistoryStatusChange: A change in the proposal's
  2429. // status.
  2430. type WorkspaceProposalHistoryStatusChange struct {
  2431. // NewStatus: The new proposal status after that status change.
  2432. //
  2433. // Possible values:
  2434. // "approved"
  2435. // "cancelled"
  2436. // "completed"
  2437. // "requested"
  2438. // "reviewed"
  2439. // "statusUnspecified"
  2440. NewStatus string `json:"newStatus,omitempty"`
  2441. // OldStatus: The old proposal status before the status change.
  2442. //
  2443. // Possible values:
  2444. // "approved"
  2445. // "cancelled"
  2446. // "completed"
  2447. // "requested"
  2448. // "reviewed"
  2449. // "statusUnspecified"
  2450. OldStatus string `json:"oldStatus,omitempty"`
  2451. // ForceSendFields is a list of field names (e.g. "NewStatus") to
  2452. // unconditionally include in API requests. By default, fields with
  2453. // empty values are omitted from API requests. However, any non-pointer,
  2454. // non-interface field appearing in ForceSendFields will be sent to the
  2455. // server regardless of whether the field is empty or not. This may be
  2456. // used to include empty fields in Patch requests.
  2457. ForceSendFields []string `json:"-"`
  2458. // NullFields is a list of field names (e.g. "NewStatus") to include in
  2459. // API requests with the JSON null value. By default, fields with empty
  2460. // values are omitted from API requests. However, any field with an
  2461. // empty value appearing in NullFields will be sent to the server as
  2462. // null. It is an error if a field in this list has a non-empty value.
  2463. // This may be used to include null fields in Patch requests.
  2464. NullFields []string `json:"-"`
  2465. }
  2466. func (s *WorkspaceProposalHistoryStatusChange) MarshalJSON() ([]byte, error) {
  2467. type NoMethod WorkspaceProposalHistoryStatusChange
  2468. raw := NoMethod(*s)
  2469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2470. }
  2471. // WorkspaceProposalUser: Represents an external user or internal Google
  2472. // Tag Manager system.
  2473. type WorkspaceProposalUser struct {
  2474. // GaiaId: Gaia id associated with a user, absent for the Google Tag
  2475. // Manager system.
  2476. GaiaId int64 `json:"gaiaId,omitempty,string"`
  2477. // Type: User type distinguishes between a user and the Google Tag
  2478. // Manager system.
  2479. //
  2480. // Possible values:
  2481. // "gaiaId"
  2482. // "system"
  2483. Type string `json:"type,omitempty"`
  2484. // ForceSendFields is a list of field names (e.g. "GaiaId") to
  2485. // unconditionally include in API requests. By default, fields with
  2486. // empty values are omitted from API requests. However, any non-pointer,
  2487. // non-interface field appearing in ForceSendFields will be sent to the
  2488. // server regardless of whether the field is empty or not. This may be
  2489. // used to include empty fields in Patch requests.
  2490. ForceSendFields []string `json:"-"`
  2491. // NullFields is a list of field names (e.g. "GaiaId") to include in API
  2492. // requests with the JSON null value. By default, fields with empty
  2493. // values are omitted from API requests. However, any field with an
  2494. // empty value appearing in NullFields will be sent to the server as
  2495. // null. It is an error if a field in this list has a non-empty value.
  2496. // This may be used to include null fields in Patch requests.
  2497. NullFields []string `json:"-"`
  2498. }
  2499. func (s *WorkspaceProposalUser) MarshalJSON() ([]byte, error) {
  2500. type NoMethod WorkspaceProposalUser
  2501. raw := NoMethod(*s)
  2502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2503. }
  2504. // Zone: Represents a Google Tag Manager Zone's contents.
  2505. type Zone struct {
  2506. // AccountId: GTM Account ID.
  2507. AccountId string `json:"accountId,omitempty"`
  2508. // Boundary: This Zone's boundary.
  2509. Boundary *ZoneBoundary `json:"boundary,omitempty"`
  2510. // ChildContainer: Containers that are children of this Zone.
  2511. ChildContainer []*ZoneChildContainer `json:"childContainer,omitempty"`
  2512. // ContainerId: GTM Container ID.
  2513. ContainerId string `json:"containerId,omitempty"`
  2514. // Fingerprint: The fingerprint of the GTM Zone as computed at storage
  2515. // time. This value is recomputed whenever the zone is modified.
  2516. Fingerprint string `json:"fingerprint,omitempty"`
  2517. // Name: Zone display name.
  2518. Name string `json:"name,omitempty"`
  2519. // Notes: User notes on how to apply this zone in the container.
  2520. Notes string `json:"notes,omitempty"`
  2521. // Path: GTM Zone's API relative path.
  2522. Path string `json:"path,omitempty"`
  2523. // TagManagerUrl: Auto generated link to the tag manager UI
  2524. TagManagerUrl string `json:"tagManagerUrl,omitempty"`
  2525. // TypeRestriction: This Zone's type restrictions.
  2526. TypeRestriction *ZoneTypeRestriction `json:"typeRestriction,omitempty"`
  2527. // WorkspaceId: GTM Workspace ID.
  2528. WorkspaceId string `json:"workspaceId,omitempty"`
  2529. // ZoneId: The Zone ID uniquely identifies the GTM Zone.
  2530. ZoneId string `json:"zoneId,omitempty"`
  2531. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2532. // unconditionally include in API requests. By default, fields with
  2533. // empty values are omitted from API requests. However, any non-pointer,
  2534. // non-interface field appearing in ForceSendFields will be sent to the
  2535. // server regardless of whether the field is empty or not. This may be
  2536. // used to include empty fields in Patch requests.
  2537. ForceSendFields []string `json:"-"`
  2538. // NullFields is a list of field names (e.g. "AccountId") to include in
  2539. // API requests with the JSON null value. By default, fields with empty
  2540. // values are omitted from API requests. However, any field with an
  2541. // empty value appearing in NullFields will be sent to the server as
  2542. // null. It is an error if a field in this list has a non-empty value.
  2543. // This may be used to include null fields in Patch requests.
  2544. NullFields []string `json:"-"`
  2545. }
  2546. func (s *Zone) MarshalJSON() ([]byte, error) {
  2547. type NoMethod Zone
  2548. raw := NoMethod(*s)
  2549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2550. }
  2551. // ZoneBoundary: Represents a Zone's boundaries.
  2552. type ZoneBoundary struct {
  2553. // Condition: The conditions that, when conjoined, make up the boundary.
  2554. Condition []*Condition `json:"condition,omitempty"`
  2555. // CustomEvaluationTriggerId: Custom evaluation trigger IDs. A zone will
  2556. // evaluate its boundary conditions when any of the listed triggers are
  2557. // true.
  2558. CustomEvaluationTriggerId []string `json:"customEvaluationTriggerId,omitempty"`
  2559. // ForceSendFields is a list of field names (e.g. "Condition") to
  2560. // unconditionally include in API requests. By default, fields with
  2561. // empty values are omitted from API requests. However, any non-pointer,
  2562. // non-interface field appearing in ForceSendFields will be sent to the
  2563. // server regardless of whether the field is empty or not. This may be
  2564. // used to include empty fields in Patch requests.
  2565. ForceSendFields []string `json:"-"`
  2566. // NullFields is a list of field names (e.g. "Condition") to include in
  2567. // API requests with the JSON null value. By default, fields with empty
  2568. // values are omitted from API requests. However, any field with an
  2569. // empty value appearing in NullFields will be sent to the server as
  2570. // null. It is an error if a field in this list has a non-empty value.
  2571. // This may be used to include null fields in Patch requests.
  2572. NullFields []string `json:"-"`
  2573. }
  2574. func (s *ZoneBoundary) MarshalJSON() ([]byte, error) {
  2575. type NoMethod ZoneBoundary
  2576. raw := NoMethod(*s)
  2577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2578. }
  2579. // ZoneChildContainer: Represents a child container of a Zone.
  2580. type ZoneChildContainer struct {
  2581. // Nickname: The zone's nickname for the child container.
  2582. Nickname string `json:"nickname,omitempty"`
  2583. // PublicId: The child container's public id.
  2584. PublicId string `json:"publicId,omitempty"`
  2585. // ForceSendFields is a list of field names (e.g. "Nickname") to
  2586. // unconditionally include in API requests. By default, fields with
  2587. // empty values are omitted from API requests. However, any non-pointer,
  2588. // non-interface field appearing in ForceSendFields will be sent to the
  2589. // server regardless of whether the field is empty or not. This may be
  2590. // used to include empty fields in Patch requests.
  2591. ForceSendFields []string `json:"-"`
  2592. // NullFields is a list of field names (e.g. "Nickname") to include in
  2593. // API requests with the JSON null value. By default, fields with empty
  2594. // values are omitted from API requests. However, any field with an
  2595. // empty value appearing in NullFields will be sent to the server as
  2596. // null. It is an error if a field in this list has a non-empty value.
  2597. // This may be used to include null fields in Patch requests.
  2598. NullFields []string `json:"-"`
  2599. }
  2600. func (s *ZoneChildContainer) MarshalJSON() ([]byte, error) {
  2601. type NoMethod ZoneChildContainer
  2602. raw := NoMethod(*s)
  2603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2604. }
  2605. // ZoneTypeRestriction: Represents a Zone's type restrictions.
  2606. type ZoneTypeRestriction struct {
  2607. // Enable: True if type restrictions have been enabled for this Zone.
  2608. Enable bool `json:"enable,omitempty"`
  2609. // WhitelistedTypeId: List of type public ids that have been whitelisted
  2610. // for use in this Zone.
  2611. WhitelistedTypeId []string `json:"whitelistedTypeId,omitempty"`
  2612. // ForceSendFields is a list of field names (e.g. "Enable") to
  2613. // unconditionally include in API requests. By default, fields with
  2614. // empty values are omitted from API requests. However, any non-pointer,
  2615. // non-interface field appearing in ForceSendFields will be sent to the
  2616. // server regardless of whether the field is empty or not. This may be
  2617. // used to include empty fields in Patch requests.
  2618. ForceSendFields []string `json:"-"`
  2619. // NullFields is a list of field names (e.g. "Enable") to include in API
  2620. // requests with the JSON null value. By default, fields with empty
  2621. // values are omitted from API requests. However, any field with an
  2622. // empty value appearing in NullFields will be sent to the server as
  2623. // null. It is an error if a field in this list has a non-empty value.
  2624. // This may be used to include null fields in Patch requests.
  2625. NullFields []string `json:"-"`
  2626. }
  2627. func (s *ZoneTypeRestriction) MarshalJSON() ([]byte, error) {
  2628. type NoMethod ZoneTypeRestriction
  2629. raw := NoMethod(*s)
  2630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2631. }
  2632. // method id "tagmanager.accounts.get":
  2633. type AccountsGetCall struct {
  2634. s *Service
  2635. path string
  2636. urlParams_ gensupport.URLParams
  2637. ifNoneMatch_ string
  2638. ctx_ context.Context
  2639. header_ http.Header
  2640. }
  2641. // Get: Gets a GTM Account.
  2642. func (r *AccountsService) Get(path string) *AccountsGetCall {
  2643. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2644. c.path = path
  2645. return c
  2646. }
  2647. // Fields allows partial responses to be retrieved. See
  2648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2649. // for more information.
  2650. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  2651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2652. return c
  2653. }
  2654. // IfNoneMatch sets the optional parameter which makes the operation
  2655. // fail if the object's ETag matches the given value. This is useful for
  2656. // getting updates only after the object has changed since the last
  2657. // request. Use googleapi.IsNotModified to check whether the response
  2658. // error from Do is the result of In-None-Match.
  2659. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  2660. c.ifNoneMatch_ = entityTag
  2661. return c
  2662. }
  2663. // Context sets the context to be used in this call's Do method. Any
  2664. // pending HTTP request will be aborted if the provided context is
  2665. // canceled.
  2666. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  2667. c.ctx_ = ctx
  2668. return c
  2669. }
  2670. // Header returns an http.Header that can be modified by the caller to
  2671. // add HTTP headers to the request.
  2672. func (c *AccountsGetCall) Header() http.Header {
  2673. if c.header_ == nil {
  2674. c.header_ = make(http.Header)
  2675. }
  2676. return c.header_
  2677. }
  2678. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  2679. reqHeaders := make(http.Header)
  2680. for k, v := range c.header_ {
  2681. reqHeaders[k] = v
  2682. }
  2683. reqHeaders.Set("User-Agent", c.s.userAgent())
  2684. if c.ifNoneMatch_ != "" {
  2685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2686. }
  2687. var body io.Reader = nil
  2688. c.urlParams_.Set("alt", alt)
  2689. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  2690. urls += "?" + c.urlParams_.Encode()
  2691. req, _ := http.NewRequest("GET", urls, body)
  2692. req.Header = reqHeaders
  2693. googleapi.Expand(req.URL, map[string]string{
  2694. "path": c.path,
  2695. })
  2696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2697. }
  2698. // Do executes the "tagmanager.accounts.get" call.
  2699. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  2700. // code is an error. Response headers are in either
  2701. // *Account.ServerResponse.Header or (if a response was returned at all)
  2702. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2703. // check whether the returned error was because http.StatusNotModified
  2704. // was returned.
  2705. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  2706. gensupport.SetOptions(c.urlParams_, opts...)
  2707. res, err := c.doRequest("json")
  2708. if res != nil && res.StatusCode == http.StatusNotModified {
  2709. if res.Body != nil {
  2710. res.Body.Close()
  2711. }
  2712. return nil, &googleapi.Error{
  2713. Code: res.StatusCode,
  2714. Header: res.Header,
  2715. }
  2716. }
  2717. if err != nil {
  2718. return nil, err
  2719. }
  2720. defer googleapi.CloseBody(res)
  2721. if err := googleapi.CheckResponse(res); err != nil {
  2722. return nil, err
  2723. }
  2724. ret := &Account{
  2725. ServerResponse: googleapi.ServerResponse{
  2726. Header: res.Header,
  2727. HTTPStatusCode: res.StatusCode,
  2728. },
  2729. }
  2730. target := &ret
  2731. if err := gensupport.DecodeResponse(target, res); err != nil {
  2732. return nil, err
  2733. }
  2734. return ret, nil
  2735. // {
  2736. // "description": "Gets a GTM Account.",
  2737. // "httpMethod": "GET",
  2738. // "id": "tagmanager.accounts.get",
  2739. // "parameterOrder": [
  2740. // "path"
  2741. // ],
  2742. // "parameters": {
  2743. // "path": {
  2744. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}",
  2745. // "location": "path",
  2746. // "required": true,
  2747. // "type": "string"
  2748. // }
  2749. // },
  2750. // "path": "{+path}",
  2751. // "response": {
  2752. // "$ref": "Account"
  2753. // },
  2754. // "scopes": [
  2755. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  2756. // "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  2757. // "https://www.googleapis.com/auth/tagmanager.readonly"
  2758. // ]
  2759. // }
  2760. }
  2761. // method id "tagmanager.accounts.list":
  2762. type AccountsListCall struct {
  2763. s *Service
  2764. urlParams_ gensupport.URLParams
  2765. ifNoneMatch_ string
  2766. ctx_ context.Context
  2767. header_ http.Header
  2768. }
  2769. // List: Lists all GTM Accounts that a user has access to.
  2770. func (r *AccountsService) List() *AccountsListCall {
  2771. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2772. return c
  2773. }
  2774. // PageToken sets the optional parameter "pageToken": Continuation token
  2775. // for fetching the next page of results.
  2776. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  2777. c.urlParams_.Set("pageToken", pageToken)
  2778. return c
  2779. }
  2780. // Fields allows partial responses to be retrieved. See
  2781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2782. // for more information.
  2783. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  2784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2785. return c
  2786. }
  2787. // IfNoneMatch sets the optional parameter which makes the operation
  2788. // fail if the object's ETag matches the given value. This is useful for
  2789. // getting updates only after the object has changed since the last
  2790. // request. Use googleapi.IsNotModified to check whether the response
  2791. // error from Do is the result of In-None-Match.
  2792. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  2793. c.ifNoneMatch_ = entityTag
  2794. return c
  2795. }
  2796. // Context sets the context to be used in this call's Do method. Any
  2797. // pending HTTP request will be aborted if the provided context is
  2798. // canceled.
  2799. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  2800. c.ctx_ = ctx
  2801. return c
  2802. }
  2803. // Header returns an http.Header that can be modified by the caller to
  2804. // add HTTP headers to the request.
  2805. func (c *AccountsListCall) Header() http.Header {
  2806. if c.header_ == nil {
  2807. c.header_ = make(http.Header)
  2808. }
  2809. return c.header_
  2810. }
  2811. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  2812. reqHeaders := make(http.Header)
  2813. for k, v := range c.header_ {
  2814. reqHeaders[k] = v
  2815. }
  2816. reqHeaders.Set("User-Agent", c.s.userAgent())
  2817. if c.ifNoneMatch_ != "" {
  2818. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2819. }
  2820. var body io.Reader = nil
  2821. c.urlParams_.Set("alt", alt)
  2822. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
  2823. urls += "?" + c.urlParams_.Encode()
  2824. req, _ := http.NewRequest("GET", urls, body)
  2825. req.Header = reqHeaders
  2826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2827. }
  2828. // Do executes the "tagmanager.accounts.list" call.
  2829. // Exactly one of *ListAccountsResponse or error will be non-nil. Any
  2830. // non-2xx status code is an error. Response headers are in either
  2831. // *ListAccountsResponse.ServerResponse.Header or (if a response was
  2832. // returned at all) in error.(*googleapi.Error).Header. Use
  2833. // googleapi.IsNotModified to check whether the returned error was
  2834. // because http.StatusNotModified was returned.
  2835. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error) {
  2836. gensupport.SetOptions(c.urlParams_, opts...)
  2837. res, err := c.doRequest("json")
  2838. if res != nil && res.StatusCode == http.StatusNotModified {
  2839. if res.Body != nil {
  2840. res.Body.Close()
  2841. }
  2842. return nil, &googleapi.Error{
  2843. Code: res.StatusCode,
  2844. Header: res.Header,
  2845. }
  2846. }
  2847. if err != nil {
  2848. return nil, err
  2849. }
  2850. defer googleapi.CloseBody(res)
  2851. if err := googleapi.CheckResponse(res); err != nil {
  2852. return nil, err
  2853. }
  2854. ret := &ListAccountsResponse{
  2855. ServerResponse: googleapi.ServerResponse{
  2856. Header: res.Header,
  2857. HTTPStatusCode: res.StatusCode,
  2858. },
  2859. }
  2860. target := &ret
  2861. if err := gensupport.DecodeResponse(target, res); err != nil {
  2862. return nil, err
  2863. }
  2864. return ret, nil
  2865. // {
  2866. // "description": "Lists all GTM Accounts that a user has access to.",
  2867. // "httpMethod": "GET",
  2868. // "id": "tagmanager.accounts.list",
  2869. // "parameters": {
  2870. // "pageToken": {
  2871. // "description": "Continuation token for fetching the next page of results.",
  2872. // "location": "query",
  2873. // "type": "string"
  2874. // }
  2875. // },
  2876. // "path": "accounts",
  2877. // "response": {
  2878. // "$ref": "ListAccountsResponse"
  2879. // },
  2880. // "scopes": [
  2881. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  2882. // "https://www.googleapis.com/auth/tagmanager.manage.accounts",
  2883. // "https://www.googleapis.com/auth/tagmanager.readonly"
  2884. // ]
  2885. // }
  2886. }
  2887. // Pages invokes f for each page of results.
  2888. // A non-nil error returned from f will halt the iteration.
  2889. // The provided context supersedes any context provided to the Context method.
  2890. func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error {
  2891. c.ctx_ = ctx
  2892. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2893. for {
  2894. x, err := c.Do()
  2895. if err != nil {
  2896. return err
  2897. }
  2898. if err := f(x); err != nil {
  2899. return err
  2900. }
  2901. if x.NextPageToken == "" {
  2902. return nil
  2903. }
  2904. c.PageToken(x.NextPageToken)
  2905. }
  2906. }
  2907. // method id "tagmanager.accounts.update":
  2908. type AccountsUpdateCall struct {
  2909. s *Service
  2910. path string
  2911. account *Account
  2912. urlParams_ gensupport.URLParams
  2913. ctx_ context.Context
  2914. header_ http.Header
  2915. }
  2916. // Update: Updates a GTM Account.
  2917. func (r *AccountsService) Update(path string, account *Account) *AccountsUpdateCall {
  2918. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2919. c.path = path
  2920. c.account = account
  2921. return c
  2922. }
  2923. // Fingerprint sets the optional parameter "fingerprint": When provided,
  2924. // this fingerprint must match the fingerprint of the account in
  2925. // storage.
  2926. func (c *AccountsUpdateCall) Fingerprint(fingerprint string) *AccountsUpdateCall {
  2927. c.urlParams_.Set("fingerprint", fingerprint)
  2928. return c
  2929. }
  2930. // Fields allows partial responses to be retrieved. See
  2931. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2932. // for more information.
  2933. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  2934. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2935. return c
  2936. }
  2937. // Context sets the context to be used in this call's Do method. Any
  2938. // pending HTTP request will be aborted if the provided context is
  2939. // canceled.
  2940. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  2941. c.ctx_ = ctx
  2942. return c
  2943. }
  2944. // Header returns an http.Header that can be modified by the caller to
  2945. // add HTTP headers to the request.
  2946. func (c *AccountsUpdateCall) Header() http.Header {
  2947. if c.header_ == nil {
  2948. c.header_ = make(http.Header)
  2949. }
  2950. return c.header_
  2951. }
  2952. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2953. reqHeaders := make(http.Header)
  2954. for k, v := range c.header_ {
  2955. reqHeaders[k] = v
  2956. }
  2957. reqHeaders.Set("User-Agent", c.s.userAgent())
  2958. var body io.Reader = nil
  2959. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  2960. if err != nil {
  2961. return nil, err
  2962. }
  2963. reqHeaders.Set("Content-Type", "application/json")
  2964. c.urlParams_.Set("alt", alt)
  2965. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  2966. urls += "?" + c.urlParams_.Encode()
  2967. req, _ := http.NewRequest("PUT", urls, body)
  2968. req.Header = reqHeaders
  2969. googleapi.Expand(req.URL, map[string]string{
  2970. "path": c.path,
  2971. })
  2972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2973. }
  2974. // Do executes the "tagmanager.accounts.update" call.
  2975. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  2976. // code is an error. Response headers are in either
  2977. // *Account.ServerResponse.Header or (if a response was returned at all)
  2978. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2979. // check whether the returned error was because http.StatusNotModified
  2980. // was returned.
  2981. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  2982. gensupport.SetOptions(c.urlParams_, opts...)
  2983. res, err := c.doRequest("json")
  2984. if res != nil && res.StatusCode == http.StatusNotModified {
  2985. if res.Body != nil {
  2986. res.Body.Close()
  2987. }
  2988. return nil, &googleapi.Error{
  2989. Code: res.StatusCode,
  2990. Header: res.Header,
  2991. }
  2992. }
  2993. if err != nil {
  2994. return nil, err
  2995. }
  2996. defer googleapi.CloseBody(res)
  2997. if err := googleapi.CheckResponse(res); err != nil {
  2998. return nil, err
  2999. }
  3000. ret := &Account{
  3001. ServerResponse: googleapi.ServerResponse{
  3002. Header: res.Header,
  3003. HTTPStatusCode: res.StatusCode,
  3004. },
  3005. }
  3006. target := &ret
  3007. if err := gensupport.DecodeResponse(target, res); err != nil {
  3008. return nil, err
  3009. }
  3010. return ret, nil
  3011. // {
  3012. // "description": "Updates a GTM Account.",
  3013. // "httpMethod": "PUT",
  3014. // "id": "tagmanager.accounts.update",
  3015. // "parameterOrder": [
  3016. // "path"
  3017. // ],
  3018. // "parameters": {
  3019. // "fingerprint": {
  3020. // "description": "When provided, this fingerprint must match the fingerprint of the account in storage.",
  3021. // "location": "query",
  3022. // "type": "string"
  3023. // },
  3024. // "path": {
  3025. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}",
  3026. // "location": "path",
  3027. // "required": true,
  3028. // "type": "string"
  3029. // }
  3030. // },
  3031. // "path": "{+path}",
  3032. // "request": {
  3033. // "$ref": "Account"
  3034. // },
  3035. // "response": {
  3036. // "$ref": "Account"
  3037. // },
  3038. // "scopes": [
  3039. // "https://www.googleapis.com/auth/tagmanager.manage.accounts"
  3040. // ]
  3041. // }
  3042. }
  3043. // method id "tagmanager.accounts.containers.create":
  3044. type AccountsContainersCreateCall struct {
  3045. s *Service
  3046. parent string
  3047. container *Container
  3048. urlParams_ gensupport.URLParams
  3049. ctx_ context.Context
  3050. header_ http.Header
  3051. }
  3052. // Create: Creates a Container.
  3053. func (r *AccountsContainersService) Create(parent string, container *Container) *AccountsContainersCreateCall {
  3054. c := &AccountsContainersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3055. c.parent = parent
  3056. c.container = container
  3057. return c
  3058. }
  3059. // Fields allows partial responses to be retrieved. See
  3060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3061. // for more information.
  3062. func (c *AccountsContainersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersCreateCall {
  3063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3064. return c
  3065. }
  3066. // Context sets the context to be used in this call's Do method. Any
  3067. // pending HTTP request will be aborted if the provided context is
  3068. // canceled.
  3069. func (c *AccountsContainersCreateCall) Context(ctx context.Context) *AccountsContainersCreateCall {
  3070. c.ctx_ = ctx
  3071. return c
  3072. }
  3073. // Header returns an http.Header that can be modified by the caller to
  3074. // add HTTP headers to the request.
  3075. func (c *AccountsContainersCreateCall) Header() http.Header {
  3076. if c.header_ == nil {
  3077. c.header_ = make(http.Header)
  3078. }
  3079. return c.header_
  3080. }
  3081. func (c *AccountsContainersCreateCall) doRequest(alt string) (*http.Response, error) {
  3082. reqHeaders := make(http.Header)
  3083. for k, v := range c.header_ {
  3084. reqHeaders[k] = v
  3085. }
  3086. reqHeaders.Set("User-Agent", c.s.userAgent())
  3087. var body io.Reader = nil
  3088. body, err := googleapi.WithoutDataWrapper.JSONReader(c.container)
  3089. if err != nil {
  3090. return nil, err
  3091. }
  3092. reqHeaders.Set("Content-Type", "application/json")
  3093. c.urlParams_.Set("alt", alt)
  3094. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/containers")
  3095. urls += "?" + c.urlParams_.Encode()
  3096. req, _ := http.NewRequest("POST", urls, body)
  3097. req.Header = reqHeaders
  3098. googleapi.Expand(req.URL, map[string]string{
  3099. "parent": c.parent,
  3100. })
  3101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3102. }
  3103. // Do executes the "tagmanager.accounts.containers.create" call.
  3104. // Exactly one of *Container or error will be non-nil. Any non-2xx
  3105. // status code is an error. Response headers are in either
  3106. // *Container.ServerResponse.Header or (if a response was returned at
  3107. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3108. // to check whether the returned error was because
  3109. // http.StatusNotModified was returned.
  3110. func (c *AccountsContainersCreateCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  3111. gensupport.SetOptions(c.urlParams_, opts...)
  3112. res, err := c.doRequest("json")
  3113. if res != nil && res.StatusCode == http.StatusNotModified {
  3114. if res.Body != nil {
  3115. res.Body.Close()
  3116. }
  3117. return nil, &googleapi.Error{
  3118. Code: res.StatusCode,
  3119. Header: res.Header,
  3120. }
  3121. }
  3122. if err != nil {
  3123. return nil, err
  3124. }
  3125. defer googleapi.CloseBody(res)
  3126. if err := googleapi.CheckResponse(res); err != nil {
  3127. return nil, err
  3128. }
  3129. ret := &Container{
  3130. ServerResponse: googleapi.ServerResponse{
  3131. Header: res.Header,
  3132. HTTPStatusCode: res.StatusCode,
  3133. },
  3134. }
  3135. target := &ret
  3136. if err := gensupport.DecodeResponse(target, res); err != nil {
  3137. return nil, err
  3138. }
  3139. return ret, nil
  3140. // {
  3141. // "description": "Creates a Container.",
  3142. // "httpMethod": "POST",
  3143. // "id": "tagmanager.accounts.containers.create",
  3144. // "parameterOrder": [
  3145. // "parent"
  3146. // ],
  3147. // "parameters": {
  3148. // "parent": {
  3149. // "description": "GTM Account's API relative path. Example: accounts/{account_id}.",
  3150. // "location": "path",
  3151. // "required": true,
  3152. // "type": "string"
  3153. // }
  3154. // },
  3155. // "path": "{+parent}/containers",
  3156. // "request": {
  3157. // "$ref": "Container"
  3158. // },
  3159. // "response": {
  3160. // "$ref": "Container"
  3161. // },
  3162. // "scopes": [
  3163. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3164. // ]
  3165. // }
  3166. }
  3167. // method id "tagmanager.accounts.containers.delete":
  3168. type AccountsContainersDeleteCall struct {
  3169. s *Service
  3170. path string
  3171. urlParams_ gensupport.URLParams
  3172. ctx_ context.Context
  3173. header_ http.Header
  3174. }
  3175. // Delete: Deletes a Container.
  3176. func (r *AccountsContainersService) Delete(path string) *AccountsContainersDeleteCall {
  3177. c := &AccountsContainersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3178. c.path = path
  3179. return c
  3180. }
  3181. // Fields allows partial responses to be retrieved. See
  3182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3183. // for more information.
  3184. func (c *AccountsContainersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersDeleteCall {
  3185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3186. return c
  3187. }
  3188. // Context sets the context to be used in this call's Do method. Any
  3189. // pending HTTP request will be aborted if the provided context is
  3190. // canceled.
  3191. func (c *AccountsContainersDeleteCall) Context(ctx context.Context) *AccountsContainersDeleteCall {
  3192. c.ctx_ = ctx
  3193. return c
  3194. }
  3195. // Header returns an http.Header that can be modified by the caller to
  3196. // add HTTP headers to the request.
  3197. func (c *AccountsContainersDeleteCall) Header() http.Header {
  3198. if c.header_ == nil {
  3199. c.header_ = make(http.Header)
  3200. }
  3201. return c.header_
  3202. }
  3203. func (c *AccountsContainersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3204. reqHeaders := make(http.Header)
  3205. for k, v := range c.header_ {
  3206. reqHeaders[k] = v
  3207. }
  3208. reqHeaders.Set("User-Agent", c.s.userAgent())
  3209. var body io.Reader = nil
  3210. c.urlParams_.Set("alt", alt)
  3211. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3212. urls += "?" + c.urlParams_.Encode()
  3213. req, _ := http.NewRequest("DELETE", urls, body)
  3214. req.Header = reqHeaders
  3215. googleapi.Expand(req.URL, map[string]string{
  3216. "path": c.path,
  3217. })
  3218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3219. }
  3220. // Do executes the "tagmanager.accounts.containers.delete" call.
  3221. func (c *AccountsContainersDeleteCall) Do(opts ...googleapi.CallOption) error {
  3222. gensupport.SetOptions(c.urlParams_, opts...)
  3223. res, err := c.doRequest("json")
  3224. if err != nil {
  3225. return err
  3226. }
  3227. defer googleapi.CloseBody(res)
  3228. if err := googleapi.CheckResponse(res); err != nil {
  3229. return err
  3230. }
  3231. return nil
  3232. // {
  3233. // "description": "Deletes a Container.",
  3234. // "httpMethod": "DELETE",
  3235. // "id": "tagmanager.accounts.containers.delete",
  3236. // "parameterOrder": [
  3237. // "path"
  3238. // ],
  3239. // "parameters": {
  3240. // "path": {
  3241. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3242. // "location": "path",
  3243. // "required": true,
  3244. // "type": "string"
  3245. // }
  3246. // },
  3247. // "path": "{+path}",
  3248. // "scopes": [
  3249. // "https://www.googleapis.com/auth/tagmanager.delete.containers"
  3250. // ]
  3251. // }
  3252. }
  3253. // method id "tagmanager.accounts.containers.get":
  3254. type AccountsContainersGetCall struct {
  3255. s *Service
  3256. path string
  3257. urlParams_ gensupport.URLParams
  3258. ifNoneMatch_ string
  3259. ctx_ context.Context
  3260. header_ http.Header
  3261. }
  3262. // Get: Gets a Container.
  3263. func (r *AccountsContainersService) Get(path string) *AccountsContainersGetCall {
  3264. c := &AccountsContainersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3265. c.path = path
  3266. return c
  3267. }
  3268. // Fields allows partial responses to be retrieved. See
  3269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3270. // for more information.
  3271. func (c *AccountsContainersGetCall) Fields(s ...googleapi.Field) *AccountsContainersGetCall {
  3272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3273. return c
  3274. }
  3275. // IfNoneMatch sets the optional parameter which makes the operation
  3276. // fail if the object's ETag matches the given value. This is useful for
  3277. // getting updates only after the object has changed since the last
  3278. // request. Use googleapi.IsNotModified to check whether the response
  3279. // error from Do is the result of In-None-Match.
  3280. func (c *AccountsContainersGetCall) IfNoneMatch(entityTag string) *AccountsContainersGetCall {
  3281. c.ifNoneMatch_ = entityTag
  3282. return c
  3283. }
  3284. // Context sets the context to be used in this call's Do method. Any
  3285. // pending HTTP request will be aborted if the provided context is
  3286. // canceled.
  3287. func (c *AccountsContainersGetCall) Context(ctx context.Context) *AccountsContainersGetCall {
  3288. c.ctx_ = ctx
  3289. return c
  3290. }
  3291. // Header returns an http.Header that can be modified by the caller to
  3292. // add HTTP headers to the request.
  3293. func (c *AccountsContainersGetCall) Header() http.Header {
  3294. if c.header_ == nil {
  3295. c.header_ = make(http.Header)
  3296. }
  3297. return c.header_
  3298. }
  3299. func (c *AccountsContainersGetCall) doRequest(alt string) (*http.Response, error) {
  3300. reqHeaders := make(http.Header)
  3301. for k, v := range c.header_ {
  3302. reqHeaders[k] = v
  3303. }
  3304. reqHeaders.Set("User-Agent", c.s.userAgent())
  3305. if c.ifNoneMatch_ != "" {
  3306. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3307. }
  3308. var body io.Reader = nil
  3309. c.urlParams_.Set("alt", alt)
  3310. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3311. urls += "?" + c.urlParams_.Encode()
  3312. req, _ := http.NewRequest("GET", urls, body)
  3313. req.Header = reqHeaders
  3314. googleapi.Expand(req.URL, map[string]string{
  3315. "path": c.path,
  3316. })
  3317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3318. }
  3319. // Do executes the "tagmanager.accounts.containers.get" call.
  3320. // Exactly one of *Container or error will be non-nil. Any non-2xx
  3321. // status code is an error. Response headers are in either
  3322. // *Container.ServerResponse.Header or (if a response was returned at
  3323. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3324. // to check whether the returned error was because
  3325. // http.StatusNotModified was returned.
  3326. func (c *AccountsContainersGetCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  3327. gensupport.SetOptions(c.urlParams_, opts...)
  3328. res, err := c.doRequest("json")
  3329. if res != nil && res.StatusCode == http.StatusNotModified {
  3330. if res.Body != nil {
  3331. res.Body.Close()
  3332. }
  3333. return nil, &googleapi.Error{
  3334. Code: res.StatusCode,
  3335. Header: res.Header,
  3336. }
  3337. }
  3338. if err != nil {
  3339. return nil, err
  3340. }
  3341. defer googleapi.CloseBody(res)
  3342. if err := googleapi.CheckResponse(res); err != nil {
  3343. return nil, err
  3344. }
  3345. ret := &Container{
  3346. ServerResponse: googleapi.ServerResponse{
  3347. Header: res.Header,
  3348. HTTPStatusCode: res.StatusCode,
  3349. },
  3350. }
  3351. target := &ret
  3352. if err := gensupport.DecodeResponse(target, res); err != nil {
  3353. return nil, err
  3354. }
  3355. return ret, nil
  3356. // {
  3357. // "description": "Gets a Container.",
  3358. // "httpMethod": "GET",
  3359. // "id": "tagmanager.accounts.containers.get",
  3360. // "parameterOrder": [
  3361. // "path"
  3362. // ],
  3363. // "parameters": {
  3364. // "path": {
  3365. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3366. // "location": "path",
  3367. // "required": true,
  3368. // "type": "string"
  3369. // }
  3370. // },
  3371. // "path": "{+path}",
  3372. // "response": {
  3373. // "$ref": "Container"
  3374. // },
  3375. // "scopes": [
  3376. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3377. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3378. // ]
  3379. // }
  3380. }
  3381. // method id "tagmanager.accounts.containers.list":
  3382. type AccountsContainersListCall struct {
  3383. s *Service
  3384. parent string
  3385. urlParams_ gensupport.URLParams
  3386. ifNoneMatch_ string
  3387. ctx_ context.Context
  3388. header_ http.Header
  3389. }
  3390. // List: Lists all Containers that belongs to a GTM Account.
  3391. func (r *AccountsContainersService) List(parent string) *AccountsContainersListCall {
  3392. c := &AccountsContainersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3393. c.parent = parent
  3394. return c
  3395. }
  3396. // PageToken sets the optional parameter "pageToken": Continuation token
  3397. // for fetching the next page of results.
  3398. func (c *AccountsContainersListCall) PageToken(pageToken string) *AccountsContainersListCall {
  3399. c.urlParams_.Set("pageToken", pageToken)
  3400. return c
  3401. }
  3402. // Fields allows partial responses to be retrieved. See
  3403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3404. // for more information.
  3405. func (c *AccountsContainersListCall) Fields(s ...googleapi.Field) *AccountsContainersListCall {
  3406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3407. return c
  3408. }
  3409. // IfNoneMatch sets the optional parameter which makes the operation
  3410. // fail if the object's ETag matches the given value. This is useful for
  3411. // getting updates only after the object has changed since the last
  3412. // request. Use googleapi.IsNotModified to check whether the response
  3413. // error from Do is the result of In-None-Match.
  3414. func (c *AccountsContainersListCall) IfNoneMatch(entityTag string) *AccountsContainersListCall {
  3415. c.ifNoneMatch_ = entityTag
  3416. return c
  3417. }
  3418. // Context sets the context to be used in this call's Do method. Any
  3419. // pending HTTP request will be aborted if the provided context is
  3420. // canceled.
  3421. func (c *AccountsContainersListCall) Context(ctx context.Context) *AccountsContainersListCall {
  3422. c.ctx_ = ctx
  3423. return c
  3424. }
  3425. // Header returns an http.Header that can be modified by the caller to
  3426. // add HTTP headers to the request.
  3427. func (c *AccountsContainersListCall) Header() http.Header {
  3428. if c.header_ == nil {
  3429. c.header_ = make(http.Header)
  3430. }
  3431. return c.header_
  3432. }
  3433. func (c *AccountsContainersListCall) doRequest(alt string) (*http.Response, error) {
  3434. reqHeaders := make(http.Header)
  3435. for k, v := range c.header_ {
  3436. reqHeaders[k] = v
  3437. }
  3438. reqHeaders.Set("User-Agent", c.s.userAgent())
  3439. if c.ifNoneMatch_ != "" {
  3440. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3441. }
  3442. var body io.Reader = nil
  3443. c.urlParams_.Set("alt", alt)
  3444. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/containers")
  3445. urls += "?" + c.urlParams_.Encode()
  3446. req, _ := http.NewRequest("GET", urls, body)
  3447. req.Header = reqHeaders
  3448. googleapi.Expand(req.URL, map[string]string{
  3449. "parent": c.parent,
  3450. })
  3451. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3452. }
  3453. // Do executes the "tagmanager.accounts.containers.list" call.
  3454. // Exactly one of *ListContainersResponse or error will be non-nil. Any
  3455. // non-2xx status code is an error. Response headers are in either
  3456. // *ListContainersResponse.ServerResponse.Header or (if a response was
  3457. // returned at all) in error.(*googleapi.Error).Header. Use
  3458. // googleapi.IsNotModified to check whether the returned error was
  3459. // because http.StatusNotModified was returned.
  3460. func (c *AccountsContainersListCall) Do(opts ...googleapi.CallOption) (*ListContainersResponse, error) {
  3461. gensupport.SetOptions(c.urlParams_, opts...)
  3462. res, err := c.doRequest("json")
  3463. if res != nil && res.StatusCode == http.StatusNotModified {
  3464. if res.Body != nil {
  3465. res.Body.Close()
  3466. }
  3467. return nil, &googleapi.Error{
  3468. Code: res.StatusCode,
  3469. Header: res.Header,
  3470. }
  3471. }
  3472. if err != nil {
  3473. return nil, err
  3474. }
  3475. defer googleapi.CloseBody(res)
  3476. if err := googleapi.CheckResponse(res); err != nil {
  3477. return nil, err
  3478. }
  3479. ret := &ListContainersResponse{
  3480. ServerResponse: googleapi.ServerResponse{
  3481. Header: res.Header,
  3482. HTTPStatusCode: res.StatusCode,
  3483. },
  3484. }
  3485. target := &ret
  3486. if err := gensupport.DecodeResponse(target, res); err != nil {
  3487. return nil, err
  3488. }
  3489. return ret, nil
  3490. // {
  3491. // "description": "Lists all Containers that belongs to a GTM Account.",
  3492. // "httpMethod": "GET",
  3493. // "id": "tagmanager.accounts.containers.list",
  3494. // "parameterOrder": [
  3495. // "parent"
  3496. // ],
  3497. // "parameters": {
  3498. // "pageToken": {
  3499. // "description": "Continuation token for fetching the next page of results.",
  3500. // "location": "query",
  3501. // "type": "string"
  3502. // },
  3503. // "parent": {
  3504. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}.",
  3505. // "location": "path",
  3506. // "required": true,
  3507. // "type": "string"
  3508. // }
  3509. // },
  3510. // "path": "{+parent}/containers",
  3511. // "response": {
  3512. // "$ref": "ListContainersResponse"
  3513. // },
  3514. // "scopes": [
  3515. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  3516. // "https://www.googleapis.com/auth/tagmanager.readonly"
  3517. // ]
  3518. // }
  3519. }
  3520. // Pages invokes f for each page of results.
  3521. // A non-nil error returned from f will halt the iteration.
  3522. // The provided context supersedes any context provided to the Context method.
  3523. func (c *AccountsContainersListCall) Pages(ctx context.Context, f func(*ListContainersResponse) error) error {
  3524. c.ctx_ = ctx
  3525. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3526. for {
  3527. x, err := c.Do()
  3528. if err != nil {
  3529. return err
  3530. }
  3531. if err := f(x); err != nil {
  3532. return err
  3533. }
  3534. if x.NextPageToken == "" {
  3535. return nil
  3536. }
  3537. c.PageToken(x.NextPageToken)
  3538. }
  3539. }
  3540. // method id "tagmanager.accounts.containers.update":
  3541. type AccountsContainersUpdateCall struct {
  3542. s *Service
  3543. path string
  3544. container *Container
  3545. urlParams_ gensupport.URLParams
  3546. ctx_ context.Context
  3547. header_ http.Header
  3548. }
  3549. // Update: Updates a Container.
  3550. func (r *AccountsContainersService) Update(path string, container *Container) *AccountsContainersUpdateCall {
  3551. c := &AccountsContainersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3552. c.path = path
  3553. c.container = container
  3554. return c
  3555. }
  3556. // Fingerprint sets the optional parameter "fingerprint": When provided,
  3557. // this fingerprint must match the fingerprint of the container in
  3558. // storage.
  3559. func (c *AccountsContainersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersUpdateCall {
  3560. c.urlParams_.Set("fingerprint", fingerprint)
  3561. return c
  3562. }
  3563. // Fields allows partial responses to be retrieved. See
  3564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3565. // for more information.
  3566. func (c *AccountsContainersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersUpdateCall {
  3567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3568. return c
  3569. }
  3570. // Context sets the context to be used in this call's Do method. Any
  3571. // pending HTTP request will be aborted if the provided context is
  3572. // canceled.
  3573. func (c *AccountsContainersUpdateCall) Context(ctx context.Context) *AccountsContainersUpdateCall {
  3574. c.ctx_ = ctx
  3575. return c
  3576. }
  3577. // Header returns an http.Header that can be modified by the caller to
  3578. // add HTTP headers to the request.
  3579. func (c *AccountsContainersUpdateCall) Header() http.Header {
  3580. if c.header_ == nil {
  3581. c.header_ = make(http.Header)
  3582. }
  3583. return c.header_
  3584. }
  3585. func (c *AccountsContainersUpdateCall) doRequest(alt string) (*http.Response, error) {
  3586. reqHeaders := make(http.Header)
  3587. for k, v := range c.header_ {
  3588. reqHeaders[k] = v
  3589. }
  3590. reqHeaders.Set("User-Agent", c.s.userAgent())
  3591. var body io.Reader = nil
  3592. body, err := googleapi.WithoutDataWrapper.JSONReader(c.container)
  3593. if err != nil {
  3594. return nil, err
  3595. }
  3596. reqHeaders.Set("Content-Type", "application/json")
  3597. c.urlParams_.Set("alt", alt)
  3598. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3599. urls += "?" + c.urlParams_.Encode()
  3600. req, _ := http.NewRequest("PUT", urls, body)
  3601. req.Header = reqHeaders
  3602. googleapi.Expand(req.URL, map[string]string{
  3603. "path": c.path,
  3604. })
  3605. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3606. }
  3607. // Do executes the "tagmanager.accounts.containers.update" call.
  3608. // Exactly one of *Container or error will be non-nil. Any non-2xx
  3609. // status code is an error. Response headers are in either
  3610. // *Container.ServerResponse.Header or (if a response was returned at
  3611. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3612. // to check whether the returned error was because
  3613. // http.StatusNotModified was returned.
  3614. func (c *AccountsContainersUpdateCall) Do(opts ...googleapi.CallOption) (*Container, error) {
  3615. gensupport.SetOptions(c.urlParams_, opts...)
  3616. res, err := c.doRequest("json")
  3617. if res != nil && res.StatusCode == http.StatusNotModified {
  3618. if res.Body != nil {
  3619. res.Body.Close()
  3620. }
  3621. return nil, &googleapi.Error{
  3622. Code: res.StatusCode,
  3623. Header: res.Header,
  3624. }
  3625. }
  3626. if err != nil {
  3627. return nil, err
  3628. }
  3629. defer googleapi.CloseBody(res)
  3630. if err := googleapi.CheckResponse(res); err != nil {
  3631. return nil, err
  3632. }
  3633. ret := &Container{
  3634. ServerResponse: googleapi.ServerResponse{
  3635. Header: res.Header,
  3636. HTTPStatusCode: res.StatusCode,
  3637. },
  3638. }
  3639. target := &ret
  3640. if err := gensupport.DecodeResponse(target, res); err != nil {
  3641. return nil, err
  3642. }
  3643. return ret, nil
  3644. // {
  3645. // "description": "Updates a Container.",
  3646. // "httpMethod": "PUT",
  3647. // "id": "tagmanager.accounts.containers.update",
  3648. // "parameterOrder": [
  3649. // "path"
  3650. // ],
  3651. // "parameters": {
  3652. // "fingerprint": {
  3653. // "description": "When provided, this fingerprint must match the fingerprint of the container in storage.",
  3654. // "location": "query",
  3655. // "type": "string"
  3656. // },
  3657. // "path": {
  3658. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3659. // "location": "path",
  3660. // "required": true,
  3661. // "type": "string"
  3662. // }
  3663. // },
  3664. // "path": "{+path}",
  3665. // "request": {
  3666. // "$ref": "Container"
  3667. // },
  3668. // "response": {
  3669. // "$ref": "Container"
  3670. // },
  3671. // "scopes": [
  3672. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3673. // ]
  3674. // }
  3675. }
  3676. // method id "tagmanager.accounts.containers.environments.create":
  3677. type AccountsContainersEnvironmentsCreateCall struct {
  3678. s *Service
  3679. parent string
  3680. environment *Environment
  3681. urlParams_ gensupport.URLParams
  3682. ctx_ context.Context
  3683. header_ http.Header
  3684. }
  3685. // Create: Creates a GTM Environment.
  3686. func (r *AccountsContainersEnvironmentsService) Create(parent string, environment *Environment) *AccountsContainersEnvironmentsCreateCall {
  3687. c := &AccountsContainersEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3688. c.parent = parent
  3689. c.environment = environment
  3690. return c
  3691. }
  3692. // Fields allows partial responses to be retrieved. See
  3693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3694. // for more information.
  3695. func (c *AccountsContainersEnvironmentsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsCreateCall {
  3696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3697. return c
  3698. }
  3699. // Context sets the context to be used in this call's Do method. Any
  3700. // pending HTTP request will be aborted if the provided context is
  3701. // canceled.
  3702. func (c *AccountsContainersEnvironmentsCreateCall) Context(ctx context.Context) *AccountsContainersEnvironmentsCreateCall {
  3703. c.ctx_ = ctx
  3704. return c
  3705. }
  3706. // Header returns an http.Header that can be modified by the caller to
  3707. // add HTTP headers to the request.
  3708. func (c *AccountsContainersEnvironmentsCreateCall) Header() http.Header {
  3709. if c.header_ == nil {
  3710. c.header_ = make(http.Header)
  3711. }
  3712. return c.header_
  3713. }
  3714. func (c *AccountsContainersEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) {
  3715. reqHeaders := make(http.Header)
  3716. for k, v := range c.header_ {
  3717. reqHeaders[k] = v
  3718. }
  3719. reqHeaders.Set("User-Agent", c.s.userAgent())
  3720. var body io.Reader = nil
  3721. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  3722. if err != nil {
  3723. return nil, err
  3724. }
  3725. reqHeaders.Set("Content-Type", "application/json")
  3726. c.urlParams_.Set("alt", alt)
  3727. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/environments")
  3728. urls += "?" + c.urlParams_.Encode()
  3729. req, _ := http.NewRequest("POST", urls, body)
  3730. req.Header = reqHeaders
  3731. googleapi.Expand(req.URL, map[string]string{
  3732. "parent": c.parent,
  3733. })
  3734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3735. }
  3736. // Do executes the "tagmanager.accounts.containers.environments.create" call.
  3737. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  3738. // status code is an error. Response headers are in either
  3739. // *Environment.ServerResponse.Header or (if a response was returned at
  3740. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3741. // to check whether the returned error was because
  3742. // http.StatusNotModified was returned.
  3743. func (c *AccountsContainersEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  3744. gensupport.SetOptions(c.urlParams_, opts...)
  3745. res, err := c.doRequest("json")
  3746. if res != nil && res.StatusCode == http.StatusNotModified {
  3747. if res.Body != nil {
  3748. res.Body.Close()
  3749. }
  3750. return nil, &googleapi.Error{
  3751. Code: res.StatusCode,
  3752. Header: res.Header,
  3753. }
  3754. }
  3755. if err != nil {
  3756. return nil, err
  3757. }
  3758. defer googleapi.CloseBody(res)
  3759. if err := googleapi.CheckResponse(res); err != nil {
  3760. return nil, err
  3761. }
  3762. ret := &Environment{
  3763. ServerResponse: googleapi.ServerResponse{
  3764. Header: res.Header,
  3765. HTTPStatusCode: res.StatusCode,
  3766. },
  3767. }
  3768. target := &ret
  3769. if err := gensupport.DecodeResponse(target, res); err != nil {
  3770. return nil, err
  3771. }
  3772. return ret, nil
  3773. // {
  3774. // "description": "Creates a GTM Environment.",
  3775. // "httpMethod": "POST",
  3776. // "id": "tagmanager.accounts.containers.environments.create",
  3777. // "parameterOrder": [
  3778. // "parent"
  3779. // ],
  3780. // "parameters": {
  3781. // "parent": {
  3782. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  3783. // "location": "path",
  3784. // "required": true,
  3785. // "type": "string"
  3786. // }
  3787. // },
  3788. // "path": "{+parent}/environments",
  3789. // "request": {
  3790. // "$ref": "Environment"
  3791. // },
  3792. // "response": {
  3793. // "$ref": "Environment"
  3794. // },
  3795. // "scopes": [
  3796. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3797. // ]
  3798. // }
  3799. }
  3800. // method id "tagmanager.accounts.containers.environments.delete":
  3801. type AccountsContainersEnvironmentsDeleteCall struct {
  3802. s *Service
  3803. path string
  3804. urlParams_ gensupport.URLParams
  3805. ctx_ context.Context
  3806. header_ http.Header
  3807. }
  3808. // Delete: Deletes a GTM Environment.
  3809. func (r *AccountsContainersEnvironmentsService) Delete(path string) *AccountsContainersEnvironmentsDeleteCall {
  3810. c := &AccountsContainersEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3811. c.path = path
  3812. return c
  3813. }
  3814. // Fields allows partial responses to be retrieved. See
  3815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3816. // for more information.
  3817. func (c *AccountsContainersEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsDeleteCall {
  3818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3819. return c
  3820. }
  3821. // Context sets the context to be used in this call's Do method. Any
  3822. // pending HTTP request will be aborted if the provided context is
  3823. // canceled.
  3824. func (c *AccountsContainersEnvironmentsDeleteCall) Context(ctx context.Context) *AccountsContainersEnvironmentsDeleteCall {
  3825. c.ctx_ = ctx
  3826. return c
  3827. }
  3828. // Header returns an http.Header that can be modified by the caller to
  3829. // add HTTP headers to the request.
  3830. func (c *AccountsContainersEnvironmentsDeleteCall) Header() http.Header {
  3831. if c.header_ == nil {
  3832. c.header_ = make(http.Header)
  3833. }
  3834. return c.header_
  3835. }
  3836. func (c *AccountsContainersEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3837. reqHeaders := make(http.Header)
  3838. for k, v := range c.header_ {
  3839. reqHeaders[k] = v
  3840. }
  3841. reqHeaders.Set("User-Agent", c.s.userAgent())
  3842. var body io.Reader = nil
  3843. c.urlParams_.Set("alt", alt)
  3844. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3845. urls += "?" + c.urlParams_.Encode()
  3846. req, _ := http.NewRequest("DELETE", urls, body)
  3847. req.Header = reqHeaders
  3848. googleapi.Expand(req.URL, map[string]string{
  3849. "path": c.path,
  3850. })
  3851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3852. }
  3853. // Do executes the "tagmanager.accounts.containers.environments.delete" call.
  3854. func (c *AccountsContainersEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  3855. gensupport.SetOptions(c.urlParams_, opts...)
  3856. res, err := c.doRequest("json")
  3857. if err != nil {
  3858. return err
  3859. }
  3860. defer googleapi.CloseBody(res)
  3861. if err := googleapi.CheckResponse(res); err != nil {
  3862. return err
  3863. }
  3864. return nil
  3865. // {
  3866. // "description": "Deletes a GTM Environment.",
  3867. // "httpMethod": "DELETE",
  3868. // "id": "tagmanager.accounts.containers.environments.delete",
  3869. // "parameterOrder": [
  3870. // "path"
  3871. // ],
  3872. // "parameters": {
  3873. // "path": {
  3874. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  3875. // "location": "path",
  3876. // "required": true,
  3877. // "type": "string"
  3878. // }
  3879. // },
  3880. // "path": "{+path}",
  3881. // "scopes": [
  3882. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  3883. // ]
  3884. // }
  3885. }
  3886. // method id "tagmanager.accounts.containers.environments.get":
  3887. type AccountsContainersEnvironmentsGetCall struct {
  3888. s *Service
  3889. path string
  3890. urlParams_ gensupport.URLParams
  3891. ifNoneMatch_ string
  3892. ctx_ context.Context
  3893. header_ http.Header
  3894. }
  3895. // Get: Gets a GTM Environment.
  3896. func (r *AccountsContainersEnvironmentsService) Get(path string) *AccountsContainersEnvironmentsGetCall {
  3897. c := &AccountsContainersEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3898. c.path = path
  3899. return c
  3900. }
  3901. // Fields allows partial responses to be retrieved. See
  3902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3903. // for more information.
  3904. func (c *AccountsContainersEnvironmentsGetCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsGetCall {
  3905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3906. return c
  3907. }
  3908. // IfNoneMatch sets the optional parameter which makes the operation
  3909. // fail if the object's ETag matches the given value. This is useful for
  3910. // getting updates only after the object has changed since the last
  3911. // request. Use googleapi.IsNotModified to check whether the response
  3912. // error from Do is the result of In-None-Match.
  3913. func (c *AccountsContainersEnvironmentsGetCall) IfNoneMatch(entityTag string) *AccountsContainersEnvironmentsGetCall {
  3914. c.ifNoneMatch_ = entityTag
  3915. return c
  3916. }
  3917. // Context sets the context to be used in this call's Do method. Any
  3918. // pending HTTP request will be aborted if the provided context is
  3919. // canceled.
  3920. func (c *AccountsContainersEnvironmentsGetCall) Context(ctx context.Context) *AccountsContainersEnvironmentsGetCall {
  3921. c.ctx_ = ctx
  3922. return c
  3923. }
  3924. // Header returns an http.Header that can be modified by the caller to
  3925. // add HTTP headers to the request.
  3926. func (c *AccountsContainersEnvironmentsGetCall) Header() http.Header {
  3927. if c.header_ == nil {
  3928. c.header_ = make(http.Header)
  3929. }
  3930. return c.header_
  3931. }
  3932. func (c *AccountsContainersEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  3933. reqHeaders := make(http.Header)
  3934. for k, v := range c.header_ {
  3935. reqHeaders[k] = v
  3936. }
  3937. reqHeaders.Set("User-Agent", c.s.userAgent())
  3938. if c.ifNoneMatch_ != "" {
  3939. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3940. }
  3941. var body io.Reader = nil
  3942. c.urlParams_.Set("alt", alt)
  3943. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  3944. urls += "?" + c.urlParams_.Encode()
  3945. req, _ := http.NewRequest("GET", urls, body)
  3946. req.Header = reqHeaders
  3947. googleapi.Expand(req.URL, map[string]string{
  3948. "path": c.path,
  3949. })
  3950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3951. }
  3952. // Do executes the "tagmanager.accounts.containers.environments.get" call.
  3953. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  3954. // status code is an error. Response headers are in either
  3955. // *Environment.ServerResponse.Header or (if a response was returned at
  3956. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3957. // to check whether the returned error was because
  3958. // http.StatusNotModified was returned.
  3959. func (c *AccountsContainersEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  3960. gensupport.SetOptions(c.urlParams_, opts...)
  3961. res, err := c.doRequest("json")
  3962. if res != nil && res.StatusCode == http.StatusNotModified {
  3963. if res.Body != nil {
  3964. res.Body.Close()
  3965. }
  3966. return nil, &googleapi.Error{
  3967. Code: res.StatusCode,
  3968. Header: res.Header,
  3969. }
  3970. }
  3971. if err != nil {
  3972. return nil, err
  3973. }
  3974. defer googleapi.CloseBody(res)
  3975. if err := googleapi.CheckResponse(res); err != nil {
  3976. return nil, err
  3977. }
  3978. ret := &Environment{
  3979. ServerResponse: googleapi.ServerResponse{
  3980. Header: res.Header,
  3981. HTTPStatusCode: res.StatusCode,
  3982. },
  3983. }
  3984. target := &ret
  3985. if err := gensupport.DecodeResponse(target, res); err != nil {
  3986. return nil, err
  3987. }
  3988. return ret, nil
  3989. // {
  3990. // "description": "Gets a GTM Environment.",
  3991. // "httpMethod": "GET",
  3992. // "id": "tagmanager.accounts.containers.environments.get",
  3993. // "parameterOrder": [
  3994. // "path"
  3995. // ],
  3996. // "parameters": {
  3997. // "path": {
  3998. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  3999. // "location": "path",
  4000. // "required": true,
  4001. // "type": "string"
  4002. // }
  4003. // },
  4004. // "path": "{+path}",
  4005. // "response": {
  4006. // "$ref": "Environment"
  4007. // },
  4008. // "scopes": [
  4009. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4010. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4011. // ]
  4012. // }
  4013. }
  4014. // method id "tagmanager.accounts.containers.environments.list":
  4015. type AccountsContainersEnvironmentsListCall struct {
  4016. s *Service
  4017. parent string
  4018. urlParams_ gensupport.URLParams
  4019. ifNoneMatch_ string
  4020. ctx_ context.Context
  4021. header_ http.Header
  4022. }
  4023. // List: Lists all GTM Environments of a GTM Container.
  4024. func (r *AccountsContainersEnvironmentsService) List(parent string) *AccountsContainersEnvironmentsListCall {
  4025. c := &AccountsContainersEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4026. c.parent = parent
  4027. return c
  4028. }
  4029. // PageToken sets the optional parameter "pageToken": Continuation token
  4030. // for fetching the next page of results.
  4031. func (c *AccountsContainersEnvironmentsListCall) PageToken(pageToken string) *AccountsContainersEnvironmentsListCall {
  4032. c.urlParams_.Set("pageToken", pageToken)
  4033. return c
  4034. }
  4035. // Fields allows partial responses to be retrieved. See
  4036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4037. // for more information.
  4038. func (c *AccountsContainersEnvironmentsListCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsListCall {
  4039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4040. return c
  4041. }
  4042. // IfNoneMatch sets the optional parameter which makes the operation
  4043. // fail if the object's ETag matches the given value. This is useful for
  4044. // getting updates only after the object has changed since the last
  4045. // request. Use googleapi.IsNotModified to check whether the response
  4046. // error from Do is the result of In-None-Match.
  4047. func (c *AccountsContainersEnvironmentsListCall) IfNoneMatch(entityTag string) *AccountsContainersEnvironmentsListCall {
  4048. c.ifNoneMatch_ = entityTag
  4049. return c
  4050. }
  4051. // Context sets the context to be used in this call's Do method. Any
  4052. // pending HTTP request will be aborted if the provided context is
  4053. // canceled.
  4054. func (c *AccountsContainersEnvironmentsListCall) Context(ctx context.Context) *AccountsContainersEnvironmentsListCall {
  4055. c.ctx_ = ctx
  4056. return c
  4057. }
  4058. // Header returns an http.Header that can be modified by the caller to
  4059. // add HTTP headers to the request.
  4060. func (c *AccountsContainersEnvironmentsListCall) Header() http.Header {
  4061. if c.header_ == nil {
  4062. c.header_ = make(http.Header)
  4063. }
  4064. return c.header_
  4065. }
  4066. func (c *AccountsContainersEnvironmentsListCall) doRequest(alt string) (*http.Response, error) {
  4067. reqHeaders := make(http.Header)
  4068. for k, v := range c.header_ {
  4069. reqHeaders[k] = v
  4070. }
  4071. reqHeaders.Set("User-Agent", c.s.userAgent())
  4072. if c.ifNoneMatch_ != "" {
  4073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4074. }
  4075. var body io.Reader = nil
  4076. c.urlParams_.Set("alt", alt)
  4077. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/environments")
  4078. urls += "?" + c.urlParams_.Encode()
  4079. req, _ := http.NewRequest("GET", urls, body)
  4080. req.Header = reqHeaders
  4081. googleapi.Expand(req.URL, map[string]string{
  4082. "parent": c.parent,
  4083. })
  4084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4085. }
  4086. // Do executes the "tagmanager.accounts.containers.environments.list" call.
  4087. // Exactly one of *ListEnvironmentsResponse or error will be non-nil.
  4088. // Any non-2xx status code is an error. Response headers are in either
  4089. // *ListEnvironmentsResponse.ServerResponse.Header or (if a response was
  4090. // returned at all) in error.(*googleapi.Error).Header. Use
  4091. // googleapi.IsNotModified to check whether the returned error was
  4092. // because http.StatusNotModified was returned.
  4093. func (c *AccountsContainersEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) {
  4094. gensupport.SetOptions(c.urlParams_, opts...)
  4095. res, err := c.doRequest("json")
  4096. if res != nil && res.StatusCode == http.StatusNotModified {
  4097. if res.Body != nil {
  4098. res.Body.Close()
  4099. }
  4100. return nil, &googleapi.Error{
  4101. Code: res.StatusCode,
  4102. Header: res.Header,
  4103. }
  4104. }
  4105. if err != nil {
  4106. return nil, err
  4107. }
  4108. defer googleapi.CloseBody(res)
  4109. if err := googleapi.CheckResponse(res); err != nil {
  4110. return nil, err
  4111. }
  4112. ret := &ListEnvironmentsResponse{
  4113. ServerResponse: googleapi.ServerResponse{
  4114. Header: res.Header,
  4115. HTTPStatusCode: res.StatusCode,
  4116. },
  4117. }
  4118. target := &ret
  4119. if err := gensupport.DecodeResponse(target, res); err != nil {
  4120. return nil, err
  4121. }
  4122. return ret, nil
  4123. // {
  4124. // "description": "Lists all GTM Environments of a GTM Container.",
  4125. // "httpMethod": "GET",
  4126. // "id": "tagmanager.accounts.containers.environments.list",
  4127. // "parameterOrder": [
  4128. // "parent"
  4129. // ],
  4130. // "parameters": {
  4131. // "pageToken": {
  4132. // "description": "Continuation token for fetching the next page of results.",
  4133. // "location": "query",
  4134. // "type": "string"
  4135. // },
  4136. // "parent": {
  4137. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  4138. // "location": "path",
  4139. // "required": true,
  4140. // "type": "string"
  4141. // }
  4142. // },
  4143. // "path": "{+parent}/environments",
  4144. // "response": {
  4145. // "$ref": "ListEnvironmentsResponse"
  4146. // },
  4147. // "scopes": [
  4148. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4149. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4150. // ]
  4151. // }
  4152. }
  4153. // Pages invokes f for each page of results.
  4154. // A non-nil error returned from f will halt the iteration.
  4155. // The provided context supersedes any context provided to the Context method.
  4156. func (c *AccountsContainersEnvironmentsListCall) Pages(ctx context.Context, f func(*ListEnvironmentsResponse) error) error {
  4157. c.ctx_ = ctx
  4158. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4159. for {
  4160. x, err := c.Do()
  4161. if err != nil {
  4162. return err
  4163. }
  4164. if err := f(x); err != nil {
  4165. return err
  4166. }
  4167. if x.NextPageToken == "" {
  4168. return nil
  4169. }
  4170. c.PageToken(x.NextPageToken)
  4171. }
  4172. }
  4173. // method id "tagmanager.accounts.containers.environments.patch":
  4174. type AccountsContainersEnvironmentsPatchCall struct {
  4175. s *Service
  4176. path string
  4177. environment *Environment
  4178. urlParams_ gensupport.URLParams
  4179. ctx_ context.Context
  4180. header_ http.Header
  4181. }
  4182. // Patch: Updates a GTM Environment. This method supports patch
  4183. // semantics.
  4184. func (r *AccountsContainersEnvironmentsService) Patch(path string, environment *Environment) *AccountsContainersEnvironmentsPatchCall {
  4185. c := &AccountsContainersEnvironmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4186. c.path = path
  4187. c.environment = environment
  4188. return c
  4189. }
  4190. // Fingerprint sets the optional parameter "fingerprint": When provided,
  4191. // this fingerprint must match the fingerprint of the environment in
  4192. // storage.
  4193. func (c *AccountsContainersEnvironmentsPatchCall) Fingerprint(fingerprint string) *AccountsContainersEnvironmentsPatchCall {
  4194. c.urlParams_.Set("fingerprint", fingerprint)
  4195. return c
  4196. }
  4197. // Fields allows partial responses to be retrieved. See
  4198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4199. // for more information.
  4200. func (c *AccountsContainersEnvironmentsPatchCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsPatchCall {
  4201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4202. return c
  4203. }
  4204. // Context sets the context to be used in this call's Do method. Any
  4205. // pending HTTP request will be aborted if the provided context is
  4206. // canceled.
  4207. func (c *AccountsContainersEnvironmentsPatchCall) Context(ctx context.Context) *AccountsContainersEnvironmentsPatchCall {
  4208. c.ctx_ = ctx
  4209. return c
  4210. }
  4211. // Header returns an http.Header that can be modified by the caller to
  4212. // add HTTP headers to the request.
  4213. func (c *AccountsContainersEnvironmentsPatchCall) Header() http.Header {
  4214. if c.header_ == nil {
  4215. c.header_ = make(http.Header)
  4216. }
  4217. return c.header_
  4218. }
  4219. func (c *AccountsContainersEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  4220. reqHeaders := make(http.Header)
  4221. for k, v := range c.header_ {
  4222. reqHeaders[k] = v
  4223. }
  4224. reqHeaders.Set("User-Agent", c.s.userAgent())
  4225. var body io.Reader = nil
  4226. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  4227. if err != nil {
  4228. return nil, err
  4229. }
  4230. reqHeaders.Set("Content-Type", "application/json")
  4231. c.urlParams_.Set("alt", alt)
  4232. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  4233. urls += "?" + c.urlParams_.Encode()
  4234. req, _ := http.NewRequest("PATCH", urls, body)
  4235. req.Header = reqHeaders
  4236. googleapi.Expand(req.URL, map[string]string{
  4237. "path": c.path,
  4238. })
  4239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4240. }
  4241. // Do executes the "tagmanager.accounts.containers.environments.patch" call.
  4242. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  4243. // status code is an error. Response headers are in either
  4244. // *Environment.ServerResponse.Header or (if a response was returned at
  4245. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4246. // to check whether the returned error was because
  4247. // http.StatusNotModified was returned.
  4248. func (c *AccountsContainersEnvironmentsPatchCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  4249. gensupport.SetOptions(c.urlParams_, opts...)
  4250. res, err := c.doRequest("json")
  4251. if res != nil && res.StatusCode == http.StatusNotModified {
  4252. if res.Body != nil {
  4253. res.Body.Close()
  4254. }
  4255. return nil, &googleapi.Error{
  4256. Code: res.StatusCode,
  4257. Header: res.Header,
  4258. }
  4259. }
  4260. if err != nil {
  4261. return nil, err
  4262. }
  4263. defer googleapi.CloseBody(res)
  4264. if err := googleapi.CheckResponse(res); err != nil {
  4265. return nil, err
  4266. }
  4267. ret := &Environment{
  4268. ServerResponse: googleapi.ServerResponse{
  4269. Header: res.Header,
  4270. HTTPStatusCode: res.StatusCode,
  4271. },
  4272. }
  4273. target := &ret
  4274. if err := gensupport.DecodeResponse(target, res); err != nil {
  4275. return nil, err
  4276. }
  4277. return ret, nil
  4278. // {
  4279. // "description": "Updates a GTM Environment. This method supports patch semantics.",
  4280. // "httpMethod": "PATCH",
  4281. // "id": "tagmanager.accounts.containers.environments.patch",
  4282. // "parameterOrder": [
  4283. // "path"
  4284. // ],
  4285. // "parameters": {
  4286. // "fingerprint": {
  4287. // "description": "When provided, this fingerprint must match the fingerprint of the environment in storage.",
  4288. // "location": "query",
  4289. // "type": "string"
  4290. // },
  4291. // "path": {
  4292. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  4293. // "location": "path",
  4294. // "required": true,
  4295. // "type": "string"
  4296. // }
  4297. // },
  4298. // "path": "{+path}",
  4299. // "request": {
  4300. // "$ref": "Environment"
  4301. // },
  4302. // "response": {
  4303. // "$ref": "Environment"
  4304. // },
  4305. // "scopes": [
  4306. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4307. // ]
  4308. // }
  4309. }
  4310. // method id "tagmanager.accounts.containers.environments.reauthorize":
  4311. type AccountsContainersEnvironmentsReauthorizeCall struct {
  4312. s *Service
  4313. path string
  4314. environment *Environment
  4315. urlParams_ gensupport.URLParams
  4316. ctx_ context.Context
  4317. header_ http.Header
  4318. }
  4319. // Reauthorize: Re-generates the authorization code for a GTM
  4320. // Environment.
  4321. func (r *AccountsContainersEnvironmentsService) Reauthorize(path string, environment *Environment) *AccountsContainersEnvironmentsReauthorizeCall {
  4322. c := &AccountsContainersEnvironmentsReauthorizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4323. c.path = path
  4324. c.environment = environment
  4325. return c
  4326. }
  4327. // Fields allows partial responses to be retrieved. See
  4328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4329. // for more information.
  4330. func (c *AccountsContainersEnvironmentsReauthorizeCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsReauthorizeCall {
  4331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4332. return c
  4333. }
  4334. // Context sets the context to be used in this call's Do method. Any
  4335. // pending HTTP request will be aborted if the provided context is
  4336. // canceled.
  4337. func (c *AccountsContainersEnvironmentsReauthorizeCall) Context(ctx context.Context) *AccountsContainersEnvironmentsReauthorizeCall {
  4338. c.ctx_ = ctx
  4339. return c
  4340. }
  4341. // Header returns an http.Header that can be modified by the caller to
  4342. // add HTTP headers to the request.
  4343. func (c *AccountsContainersEnvironmentsReauthorizeCall) Header() http.Header {
  4344. if c.header_ == nil {
  4345. c.header_ = make(http.Header)
  4346. }
  4347. return c.header_
  4348. }
  4349. func (c *AccountsContainersEnvironmentsReauthorizeCall) doRequest(alt string) (*http.Response, error) {
  4350. reqHeaders := make(http.Header)
  4351. for k, v := range c.header_ {
  4352. reqHeaders[k] = v
  4353. }
  4354. reqHeaders.Set("User-Agent", c.s.userAgent())
  4355. var body io.Reader = nil
  4356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  4357. if err != nil {
  4358. return nil, err
  4359. }
  4360. reqHeaders.Set("Content-Type", "application/json")
  4361. c.urlParams_.Set("alt", alt)
  4362. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:reauthorize")
  4363. urls += "?" + c.urlParams_.Encode()
  4364. req, _ := http.NewRequest("POST", urls, body)
  4365. req.Header = reqHeaders
  4366. googleapi.Expand(req.URL, map[string]string{
  4367. "path": c.path,
  4368. })
  4369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4370. }
  4371. // Do executes the "tagmanager.accounts.containers.environments.reauthorize" call.
  4372. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  4373. // status code is an error. Response headers are in either
  4374. // *Environment.ServerResponse.Header or (if a response was returned at
  4375. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4376. // to check whether the returned error was because
  4377. // http.StatusNotModified was returned.
  4378. func (c *AccountsContainersEnvironmentsReauthorizeCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  4379. gensupport.SetOptions(c.urlParams_, opts...)
  4380. res, err := c.doRequest("json")
  4381. if res != nil && res.StatusCode == http.StatusNotModified {
  4382. if res.Body != nil {
  4383. res.Body.Close()
  4384. }
  4385. return nil, &googleapi.Error{
  4386. Code: res.StatusCode,
  4387. Header: res.Header,
  4388. }
  4389. }
  4390. if err != nil {
  4391. return nil, err
  4392. }
  4393. defer googleapi.CloseBody(res)
  4394. if err := googleapi.CheckResponse(res); err != nil {
  4395. return nil, err
  4396. }
  4397. ret := &Environment{
  4398. ServerResponse: googleapi.ServerResponse{
  4399. Header: res.Header,
  4400. HTTPStatusCode: res.StatusCode,
  4401. },
  4402. }
  4403. target := &ret
  4404. if err := gensupport.DecodeResponse(target, res); err != nil {
  4405. return nil, err
  4406. }
  4407. return ret, nil
  4408. // {
  4409. // "description": "Re-generates the authorization code for a GTM Environment.",
  4410. // "httpMethod": "POST",
  4411. // "id": "tagmanager.accounts.containers.environments.reauthorize",
  4412. // "parameterOrder": [
  4413. // "path"
  4414. // ],
  4415. // "parameters": {
  4416. // "path": {
  4417. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  4418. // "location": "path",
  4419. // "required": true,
  4420. // "type": "string"
  4421. // }
  4422. // },
  4423. // "path": "{+path}:reauthorize",
  4424. // "request": {
  4425. // "$ref": "Environment"
  4426. // },
  4427. // "response": {
  4428. // "$ref": "Environment"
  4429. // },
  4430. // "scopes": [
  4431. // "https://www.googleapis.com/auth/tagmanager.publish"
  4432. // ]
  4433. // }
  4434. }
  4435. // method id "tagmanager.accounts.containers.environments.update":
  4436. type AccountsContainersEnvironmentsUpdateCall struct {
  4437. s *Service
  4438. path string
  4439. environment *Environment
  4440. urlParams_ gensupport.URLParams
  4441. ctx_ context.Context
  4442. header_ http.Header
  4443. }
  4444. // Update: Updates a GTM Environment.
  4445. func (r *AccountsContainersEnvironmentsService) Update(path string, environment *Environment) *AccountsContainersEnvironmentsUpdateCall {
  4446. c := &AccountsContainersEnvironmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4447. c.path = path
  4448. c.environment = environment
  4449. return c
  4450. }
  4451. // Fingerprint sets the optional parameter "fingerprint": When provided,
  4452. // this fingerprint must match the fingerprint of the environment in
  4453. // storage.
  4454. func (c *AccountsContainersEnvironmentsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersEnvironmentsUpdateCall {
  4455. c.urlParams_.Set("fingerprint", fingerprint)
  4456. return c
  4457. }
  4458. // Fields allows partial responses to be retrieved. See
  4459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4460. // for more information.
  4461. func (c *AccountsContainersEnvironmentsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersEnvironmentsUpdateCall {
  4462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4463. return c
  4464. }
  4465. // Context sets the context to be used in this call's Do method. Any
  4466. // pending HTTP request will be aborted if the provided context is
  4467. // canceled.
  4468. func (c *AccountsContainersEnvironmentsUpdateCall) Context(ctx context.Context) *AccountsContainersEnvironmentsUpdateCall {
  4469. c.ctx_ = ctx
  4470. return c
  4471. }
  4472. // Header returns an http.Header that can be modified by the caller to
  4473. // add HTTP headers to the request.
  4474. func (c *AccountsContainersEnvironmentsUpdateCall) Header() http.Header {
  4475. if c.header_ == nil {
  4476. c.header_ = make(http.Header)
  4477. }
  4478. return c.header_
  4479. }
  4480. func (c *AccountsContainersEnvironmentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4481. reqHeaders := make(http.Header)
  4482. for k, v := range c.header_ {
  4483. reqHeaders[k] = v
  4484. }
  4485. reqHeaders.Set("User-Agent", c.s.userAgent())
  4486. var body io.Reader = nil
  4487. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  4488. if err != nil {
  4489. return nil, err
  4490. }
  4491. reqHeaders.Set("Content-Type", "application/json")
  4492. c.urlParams_.Set("alt", alt)
  4493. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  4494. urls += "?" + c.urlParams_.Encode()
  4495. req, _ := http.NewRequest("PUT", urls, body)
  4496. req.Header = reqHeaders
  4497. googleapi.Expand(req.URL, map[string]string{
  4498. "path": c.path,
  4499. })
  4500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4501. }
  4502. // Do executes the "tagmanager.accounts.containers.environments.update" call.
  4503. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  4504. // status code is an error. Response headers are in either
  4505. // *Environment.ServerResponse.Header or (if a response was returned at
  4506. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4507. // to check whether the returned error was because
  4508. // http.StatusNotModified was returned.
  4509. func (c *AccountsContainersEnvironmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  4510. gensupport.SetOptions(c.urlParams_, opts...)
  4511. res, err := c.doRequest("json")
  4512. if res != nil && res.StatusCode == http.StatusNotModified {
  4513. if res.Body != nil {
  4514. res.Body.Close()
  4515. }
  4516. return nil, &googleapi.Error{
  4517. Code: res.StatusCode,
  4518. Header: res.Header,
  4519. }
  4520. }
  4521. if err != nil {
  4522. return nil, err
  4523. }
  4524. defer googleapi.CloseBody(res)
  4525. if err := googleapi.CheckResponse(res); err != nil {
  4526. return nil, err
  4527. }
  4528. ret := &Environment{
  4529. ServerResponse: googleapi.ServerResponse{
  4530. Header: res.Header,
  4531. HTTPStatusCode: res.StatusCode,
  4532. },
  4533. }
  4534. target := &ret
  4535. if err := gensupport.DecodeResponse(target, res); err != nil {
  4536. return nil, err
  4537. }
  4538. return ret, nil
  4539. // {
  4540. // "description": "Updates a GTM Environment.",
  4541. // "httpMethod": "PUT",
  4542. // "id": "tagmanager.accounts.containers.environments.update",
  4543. // "parameterOrder": [
  4544. // "path"
  4545. // ],
  4546. // "parameters": {
  4547. // "fingerprint": {
  4548. // "description": "When provided, this fingerprint must match the fingerprint of the environment in storage.",
  4549. // "location": "query",
  4550. // "type": "string"
  4551. // },
  4552. // "path": {
  4553. // "description": "GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id}",
  4554. // "location": "path",
  4555. // "required": true,
  4556. // "type": "string"
  4557. // }
  4558. // },
  4559. // "path": "{+path}",
  4560. // "request": {
  4561. // "$ref": "Environment"
  4562. // },
  4563. // "response": {
  4564. // "$ref": "Environment"
  4565. // },
  4566. // "scopes": [
  4567. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  4568. // ]
  4569. // }
  4570. }
  4571. // method id "tagmanager.accounts.containers.version_headers.latest":
  4572. type AccountsContainersVersionHeadersLatestCall struct {
  4573. s *Service
  4574. parent string
  4575. urlParams_ gensupport.URLParams
  4576. ifNoneMatch_ string
  4577. ctx_ context.Context
  4578. header_ http.Header
  4579. }
  4580. // Latest: Gets the latest container version header
  4581. func (r *AccountsContainersVersionHeadersService) Latest(parent string) *AccountsContainersVersionHeadersLatestCall {
  4582. c := &AccountsContainersVersionHeadersLatestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4583. c.parent = parent
  4584. return c
  4585. }
  4586. // Fields allows partial responses to be retrieved. See
  4587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4588. // for more information.
  4589. func (c *AccountsContainersVersionHeadersLatestCall) Fields(s ...googleapi.Field) *AccountsContainersVersionHeadersLatestCall {
  4590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4591. return c
  4592. }
  4593. // IfNoneMatch sets the optional parameter which makes the operation
  4594. // fail if the object's ETag matches the given value. This is useful for
  4595. // getting updates only after the object has changed since the last
  4596. // request. Use googleapi.IsNotModified to check whether the response
  4597. // error from Do is the result of In-None-Match.
  4598. func (c *AccountsContainersVersionHeadersLatestCall) IfNoneMatch(entityTag string) *AccountsContainersVersionHeadersLatestCall {
  4599. c.ifNoneMatch_ = entityTag
  4600. return c
  4601. }
  4602. // Context sets the context to be used in this call's Do method. Any
  4603. // pending HTTP request will be aborted if the provided context is
  4604. // canceled.
  4605. func (c *AccountsContainersVersionHeadersLatestCall) Context(ctx context.Context) *AccountsContainersVersionHeadersLatestCall {
  4606. c.ctx_ = ctx
  4607. return c
  4608. }
  4609. // Header returns an http.Header that can be modified by the caller to
  4610. // add HTTP headers to the request.
  4611. func (c *AccountsContainersVersionHeadersLatestCall) Header() http.Header {
  4612. if c.header_ == nil {
  4613. c.header_ = make(http.Header)
  4614. }
  4615. return c.header_
  4616. }
  4617. func (c *AccountsContainersVersionHeadersLatestCall) doRequest(alt string) (*http.Response, error) {
  4618. reqHeaders := make(http.Header)
  4619. for k, v := range c.header_ {
  4620. reqHeaders[k] = v
  4621. }
  4622. reqHeaders.Set("User-Agent", c.s.userAgent())
  4623. if c.ifNoneMatch_ != "" {
  4624. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4625. }
  4626. var body io.Reader = nil
  4627. c.urlParams_.Set("alt", alt)
  4628. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/version_headers:latest")
  4629. urls += "?" + c.urlParams_.Encode()
  4630. req, _ := http.NewRequest("GET", urls, body)
  4631. req.Header = reqHeaders
  4632. googleapi.Expand(req.URL, map[string]string{
  4633. "parent": c.parent,
  4634. })
  4635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4636. }
  4637. // Do executes the "tagmanager.accounts.containers.version_headers.latest" call.
  4638. // Exactly one of *ContainerVersionHeader or error will be non-nil. Any
  4639. // non-2xx status code is an error. Response headers are in either
  4640. // *ContainerVersionHeader.ServerResponse.Header or (if a response was
  4641. // returned at all) in error.(*googleapi.Error).Header. Use
  4642. // googleapi.IsNotModified to check whether the returned error was
  4643. // because http.StatusNotModified was returned.
  4644. func (c *AccountsContainersVersionHeadersLatestCall) Do(opts ...googleapi.CallOption) (*ContainerVersionHeader, error) {
  4645. gensupport.SetOptions(c.urlParams_, opts...)
  4646. res, err := c.doRequest("json")
  4647. if res != nil && res.StatusCode == http.StatusNotModified {
  4648. if res.Body != nil {
  4649. res.Body.Close()
  4650. }
  4651. return nil, &googleapi.Error{
  4652. Code: res.StatusCode,
  4653. Header: res.Header,
  4654. }
  4655. }
  4656. if err != nil {
  4657. return nil, err
  4658. }
  4659. defer googleapi.CloseBody(res)
  4660. if err := googleapi.CheckResponse(res); err != nil {
  4661. return nil, err
  4662. }
  4663. ret := &ContainerVersionHeader{
  4664. ServerResponse: googleapi.ServerResponse{
  4665. Header: res.Header,
  4666. HTTPStatusCode: res.StatusCode,
  4667. },
  4668. }
  4669. target := &ret
  4670. if err := gensupport.DecodeResponse(target, res); err != nil {
  4671. return nil, err
  4672. }
  4673. return ret, nil
  4674. // {
  4675. // "description": "Gets the latest container version header",
  4676. // "httpMethod": "GET",
  4677. // "id": "tagmanager.accounts.containers.version_headers.latest",
  4678. // "parameterOrder": [
  4679. // "parent"
  4680. // ],
  4681. // "parameters": {
  4682. // "parent": {
  4683. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  4684. // "location": "path",
  4685. // "required": true,
  4686. // "type": "string"
  4687. // }
  4688. // },
  4689. // "path": "{+parent}/version_headers:latest",
  4690. // "response": {
  4691. // "$ref": "ContainerVersionHeader"
  4692. // },
  4693. // "scopes": [
  4694. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4695. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4696. // ]
  4697. // }
  4698. }
  4699. // method id "tagmanager.accounts.containers.version_headers.list":
  4700. type AccountsContainersVersionHeadersListCall struct {
  4701. s *Service
  4702. parent string
  4703. urlParams_ gensupport.URLParams
  4704. ifNoneMatch_ string
  4705. ctx_ context.Context
  4706. header_ http.Header
  4707. }
  4708. // List: Lists all Container Versions of a GTM Container.
  4709. func (r *AccountsContainersVersionHeadersService) List(parent string) *AccountsContainersVersionHeadersListCall {
  4710. c := &AccountsContainersVersionHeadersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4711. c.parent = parent
  4712. return c
  4713. }
  4714. // IncludeDeleted sets the optional parameter "includeDeleted": Also
  4715. // retrieve deleted (archived) versions when true.
  4716. func (c *AccountsContainersVersionHeadersListCall) IncludeDeleted(includeDeleted bool) *AccountsContainersVersionHeadersListCall {
  4717. c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  4718. return c
  4719. }
  4720. // PageToken sets the optional parameter "pageToken": Continuation token
  4721. // for fetching the next page of results.
  4722. func (c *AccountsContainersVersionHeadersListCall) PageToken(pageToken string) *AccountsContainersVersionHeadersListCall {
  4723. c.urlParams_.Set("pageToken", pageToken)
  4724. return c
  4725. }
  4726. // Fields allows partial responses to be retrieved. See
  4727. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4728. // for more information.
  4729. func (c *AccountsContainersVersionHeadersListCall) Fields(s ...googleapi.Field) *AccountsContainersVersionHeadersListCall {
  4730. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4731. return c
  4732. }
  4733. // IfNoneMatch sets the optional parameter which makes the operation
  4734. // fail if the object's ETag matches the given value. This is useful for
  4735. // getting updates only after the object has changed since the last
  4736. // request. Use googleapi.IsNotModified to check whether the response
  4737. // error from Do is the result of In-None-Match.
  4738. func (c *AccountsContainersVersionHeadersListCall) IfNoneMatch(entityTag string) *AccountsContainersVersionHeadersListCall {
  4739. c.ifNoneMatch_ = entityTag
  4740. return c
  4741. }
  4742. // Context sets the context to be used in this call's Do method. Any
  4743. // pending HTTP request will be aborted if the provided context is
  4744. // canceled.
  4745. func (c *AccountsContainersVersionHeadersListCall) Context(ctx context.Context) *AccountsContainersVersionHeadersListCall {
  4746. c.ctx_ = ctx
  4747. return c
  4748. }
  4749. // Header returns an http.Header that can be modified by the caller to
  4750. // add HTTP headers to the request.
  4751. func (c *AccountsContainersVersionHeadersListCall) Header() http.Header {
  4752. if c.header_ == nil {
  4753. c.header_ = make(http.Header)
  4754. }
  4755. return c.header_
  4756. }
  4757. func (c *AccountsContainersVersionHeadersListCall) doRequest(alt string) (*http.Response, error) {
  4758. reqHeaders := make(http.Header)
  4759. for k, v := range c.header_ {
  4760. reqHeaders[k] = v
  4761. }
  4762. reqHeaders.Set("User-Agent", c.s.userAgent())
  4763. if c.ifNoneMatch_ != "" {
  4764. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4765. }
  4766. var body io.Reader = nil
  4767. c.urlParams_.Set("alt", alt)
  4768. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/version_headers")
  4769. urls += "?" + c.urlParams_.Encode()
  4770. req, _ := http.NewRequest("GET", urls, body)
  4771. req.Header = reqHeaders
  4772. googleapi.Expand(req.URL, map[string]string{
  4773. "parent": c.parent,
  4774. })
  4775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4776. }
  4777. // Do executes the "tagmanager.accounts.containers.version_headers.list" call.
  4778. // Exactly one of *ListContainerVersionsResponse or error will be
  4779. // non-nil. Any non-2xx status code is an error. Response headers are in
  4780. // either *ListContainerVersionsResponse.ServerResponse.Header or (if a
  4781. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4782. // googleapi.IsNotModified to check whether the returned error was
  4783. // because http.StatusNotModified was returned.
  4784. func (c *AccountsContainersVersionHeadersListCall) Do(opts ...googleapi.CallOption) (*ListContainerVersionsResponse, error) {
  4785. gensupport.SetOptions(c.urlParams_, opts...)
  4786. res, err := c.doRequest("json")
  4787. if res != nil && res.StatusCode == http.StatusNotModified {
  4788. if res.Body != nil {
  4789. res.Body.Close()
  4790. }
  4791. return nil, &googleapi.Error{
  4792. Code: res.StatusCode,
  4793. Header: res.Header,
  4794. }
  4795. }
  4796. if err != nil {
  4797. return nil, err
  4798. }
  4799. defer googleapi.CloseBody(res)
  4800. if err := googleapi.CheckResponse(res); err != nil {
  4801. return nil, err
  4802. }
  4803. ret := &ListContainerVersionsResponse{
  4804. ServerResponse: googleapi.ServerResponse{
  4805. Header: res.Header,
  4806. HTTPStatusCode: res.StatusCode,
  4807. },
  4808. }
  4809. target := &ret
  4810. if err := gensupport.DecodeResponse(target, res); err != nil {
  4811. return nil, err
  4812. }
  4813. return ret, nil
  4814. // {
  4815. // "description": "Lists all Container Versions of a GTM Container.",
  4816. // "httpMethod": "GET",
  4817. // "id": "tagmanager.accounts.containers.version_headers.list",
  4818. // "parameterOrder": [
  4819. // "parent"
  4820. // ],
  4821. // "parameters": {
  4822. // "includeDeleted": {
  4823. // "description": "Also retrieve deleted (archived) versions when true.",
  4824. // "location": "query",
  4825. // "type": "boolean"
  4826. // },
  4827. // "pageToken": {
  4828. // "description": "Continuation token for fetching the next page of results.",
  4829. // "location": "query",
  4830. // "type": "string"
  4831. // },
  4832. // "parent": {
  4833. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  4834. // "location": "path",
  4835. // "required": true,
  4836. // "type": "string"
  4837. // }
  4838. // },
  4839. // "path": "{+parent}/version_headers",
  4840. // "response": {
  4841. // "$ref": "ListContainerVersionsResponse"
  4842. // },
  4843. // "scopes": [
  4844. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  4845. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  4846. // "https://www.googleapis.com/auth/tagmanager.readonly"
  4847. // ]
  4848. // }
  4849. }
  4850. // Pages invokes f for each page of results.
  4851. // A non-nil error returned from f will halt the iteration.
  4852. // The provided context supersedes any context provided to the Context method.
  4853. func (c *AccountsContainersVersionHeadersListCall) Pages(ctx context.Context, f func(*ListContainerVersionsResponse) error) error {
  4854. c.ctx_ = ctx
  4855. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4856. for {
  4857. x, err := c.Do()
  4858. if err != nil {
  4859. return err
  4860. }
  4861. if err := f(x); err != nil {
  4862. return err
  4863. }
  4864. if x.NextPageToken == "" {
  4865. return nil
  4866. }
  4867. c.PageToken(x.NextPageToken)
  4868. }
  4869. }
  4870. // method id "tagmanager.accounts.containers.versions.delete":
  4871. type AccountsContainersVersionsDeleteCall struct {
  4872. s *Service
  4873. path string
  4874. urlParams_ gensupport.URLParams
  4875. ctx_ context.Context
  4876. header_ http.Header
  4877. }
  4878. // Delete: Deletes a Container Version.
  4879. func (r *AccountsContainersVersionsService) Delete(path string) *AccountsContainersVersionsDeleteCall {
  4880. c := &AccountsContainersVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4881. c.path = path
  4882. return c
  4883. }
  4884. // Fields allows partial responses to be retrieved. See
  4885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4886. // for more information.
  4887. func (c *AccountsContainersVersionsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsDeleteCall {
  4888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4889. return c
  4890. }
  4891. // Context sets the context to be used in this call's Do method. Any
  4892. // pending HTTP request will be aborted if the provided context is
  4893. // canceled.
  4894. func (c *AccountsContainersVersionsDeleteCall) Context(ctx context.Context) *AccountsContainersVersionsDeleteCall {
  4895. c.ctx_ = ctx
  4896. return c
  4897. }
  4898. // Header returns an http.Header that can be modified by the caller to
  4899. // add HTTP headers to the request.
  4900. func (c *AccountsContainersVersionsDeleteCall) Header() http.Header {
  4901. if c.header_ == nil {
  4902. c.header_ = make(http.Header)
  4903. }
  4904. return c.header_
  4905. }
  4906. func (c *AccountsContainersVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4907. reqHeaders := make(http.Header)
  4908. for k, v := range c.header_ {
  4909. reqHeaders[k] = v
  4910. }
  4911. reqHeaders.Set("User-Agent", c.s.userAgent())
  4912. var body io.Reader = nil
  4913. c.urlParams_.Set("alt", alt)
  4914. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  4915. urls += "?" + c.urlParams_.Encode()
  4916. req, _ := http.NewRequest("DELETE", urls, body)
  4917. req.Header = reqHeaders
  4918. googleapi.Expand(req.URL, map[string]string{
  4919. "path": c.path,
  4920. })
  4921. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4922. }
  4923. // Do executes the "tagmanager.accounts.containers.versions.delete" call.
  4924. func (c *AccountsContainersVersionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4925. gensupport.SetOptions(c.urlParams_, opts...)
  4926. res, err := c.doRequest("json")
  4927. if err != nil {
  4928. return err
  4929. }
  4930. defer googleapi.CloseBody(res)
  4931. if err := googleapi.CheckResponse(res); err != nil {
  4932. return err
  4933. }
  4934. return nil
  4935. // {
  4936. // "description": "Deletes a Container Version.",
  4937. // "httpMethod": "DELETE",
  4938. // "id": "tagmanager.accounts.containers.versions.delete",
  4939. // "parameterOrder": [
  4940. // "path"
  4941. // ],
  4942. // "parameters": {
  4943. // "path": {
  4944. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  4945. // "location": "path",
  4946. // "required": true,
  4947. // "type": "string"
  4948. // }
  4949. // },
  4950. // "path": "{+path}",
  4951. // "scopes": [
  4952. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  4953. // ]
  4954. // }
  4955. }
  4956. // method id "tagmanager.accounts.containers.versions.get":
  4957. type AccountsContainersVersionsGetCall struct {
  4958. s *Service
  4959. path string
  4960. urlParams_ gensupport.URLParams
  4961. ifNoneMatch_ string
  4962. ctx_ context.Context
  4963. header_ http.Header
  4964. }
  4965. // Get: Gets a Container Version.
  4966. func (r *AccountsContainersVersionsService) Get(path string) *AccountsContainersVersionsGetCall {
  4967. c := &AccountsContainersVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4968. c.path = path
  4969. return c
  4970. }
  4971. // ContainerVersionId sets the optional parameter "containerVersionId":
  4972. // The GTM ContainerVersion ID. Specify published to retrieve the
  4973. // currently published version.
  4974. func (c *AccountsContainersVersionsGetCall) ContainerVersionId(containerVersionId string) *AccountsContainersVersionsGetCall {
  4975. c.urlParams_.Set("containerVersionId", containerVersionId)
  4976. return c
  4977. }
  4978. // Fields allows partial responses to be retrieved. See
  4979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4980. // for more information.
  4981. func (c *AccountsContainersVersionsGetCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsGetCall {
  4982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4983. return c
  4984. }
  4985. // IfNoneMatch sets the optional parameter which makes the operation
  4986. // fail if the object's ETag matches the given value. This is useful for
  4987. // getting updates only after the object has changed since the last
  4988. // request. Use googleapi.IsNotModified to check whether the response
  4989. // error from Do is the result of In-None-Match.
  4990. func (c *AccountsContainersVersionsGetCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsGetCall {
  4991. c.ifNoneMatch_ = entityTag
  4992. return c
  4993. }
  4994. // Context sets the context to be used in this call's Do method. Any
  4995. // pending HTTP request will be aborted if the provided context is
  4996. // canceled.
  4997. func (c *AccountsContainersVersionsGetCall) Context(ctx context.Context) *AccountsContainersVersionsGetCall {
  4998. c.ctx_ = ctx
  4999. return c
  5000. }
  5001. // Header returns an http.Header that can be modified by the caller to
  5002. // add HTTP headers to the request.
  5003. func (c *AccountsContainersVersionsGetCall) Header() http.Header {
  5004. if c.header_ == nil {
  5005. c.header_ = make(http.Header)
  5006. }
  5007. return c.header_
  5008. }
  5009. func (c *AccountsContainersVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  5010. reqHeaders := make(http.Header)
  5011. for k, v := range c.header_ {
  5012. reqHeaders[k] = v
  5013. }
  5014. reqHeaders.Set("User-Agent", c.s.userAgent())
  5015. if c.ifNoneMatch_ != "" {
  5016. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5017. }
  5018. var body io.Reader = nil
  5019. c.urlParams_.Set("alt", alt)
  5020. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  5021. urls += "?" + c.urlParams_.Encode()
  5022. req, _ := http.NewRequest("GET", urls, body)
  5023. req.Header = reqHeaders
  5024. googleapi.Expand(req.URL, map[string]string{
  5025. "path": c.path,
  5026. })
  5027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5028. }
  5029. // Do executes the "tagmanager.accounts.containers.versions.get" call.
  5030. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5031. // non-2xx status code is an error. Response headers are in either
  5032. // *ContainerVersion.ServerResponse.Header or (if a response was
  5033. // returned at all) in error.(*googleapi.Error).Header. Use
  5034. // googleapi.IsNotModified to check whether the returned error was
  5035. // because http.StatusNotModified was returned.
  5036. func (c *AccountsContainersVersionsGetCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5037. gensupport.SetOptions(c.urlParams_, opts...)
  5038. res, err := c.doRequest("json")
  5039. if res != nil && res.StatusCode == http.StatusNotModified {
  5040. if res.Body != nil {
  5041. res.Body.Close()
  5042. }
  5043. return nil, &googleapi.Error{
  5044. Code: res.StatusCode,
  5045. Header: res.Header,
  5046. }
  5047. }
  5048. if err != nil {
  5049. return nil, err
  5050. }
  5051. defer googleapi.CloseBody(res)
  5052. if err := googleapi.CheckResponse(res); err != nil {
  5053. return nil, err
  5054. }
  5055. ret := &ContainerVersion{
  5056. ServerResponse: googleapi.ServerResponse{
  5057. Header: res.Header,
  5058. HTTPStatusCode: res.StatusCode,
  5059. },
  5060. }
  5061. target := &ret
  5062. if err := gensupport.DecodeResponse(target, res); err != nil {
  5063. return nil, err
  5064. }
  5065. return ret, nil
  5066. // {
  5067. // "description": "Gets a Container Version.",
  5068. // "httpMethod": "GET",
  5069. // "id": "tagmanager.accounts.containers.versions.get",
  5070. // "parameterOrder": [
  5071. // "path"
  5072. // ],
  5073. // "parameters": {
  5074. // "containerVersionId": {
  5075. // "description": "The GTM ContainerVersion ID. Specify published to retrieve the currently published version.",
  5076. // "location": "query",
  5077. // "type": "string"
  5078. // },
  5079. // "path": {
  5080. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5081. // "location": "path",
  5082. // "required": true,
  5083. // "type": "string"
  5084. // }
  5085. // },
  5086. // "path": "{+path}",
  5087. // "response": {
  5088. // "$ref": "ContainerVersion"
  5089. // },
  5090. // "scopes": [
  5091. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  5092. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions",
  5093. // "https://www.googleapis.com/auth/tagmanager.readonly"
  5094. // ]
  5095. // }
  5096. }
  5097. // method id "tagmanager.accounts.containers.versions.live":
  5098. type AccountsContainersVersionsLiveCall struct {
  5099. s *Service
  5100. parent string
  5101. urlParams_ gensupport.URLParams
  5102. ifNoneMatch_ string
  5103. ctx_ context.Context
  5104. header_ http.Header
  5105. }
  5106. // Live: Gets the live (i.e. published) container version
  5107. func (r *AccountsContainersVersionsService) Live(parent string) *AccountsContainersVersionsLiveCall {
  5108. c := &AccountsContainersVersionsLiveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5109. c.parent = parent
  5110. return c
  5111. }
  5112. // Fields allows partial responses to be retrieved. See
  5113. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5114. // for more information.
  5115. func (c *AccountsContainersVersionsLiveCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsLiveCall {
  5116. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5117. return c
  5118. }
  5119. // IfNoneMatch sets the optional parameter which makes the operation
  5120. // fail if the object's ETag matches the given value. This is useful for
  5121. // getting updates only after the object has changed since the last
  5122. // request. Use googleapi.IsNotModified to check whether the response
  5123. // error from Do is the result of In-None-Match.
  5124. func (c *AccountsContainersVersionsLiveCall) IfNoneMatch(entityTag string) *AccountsContainersVersionsLiveCall {
  5125. c.ifNoneMatch_ = entityTag
  5126. return c
  5127. }
  5128. // Context sets the context to be used in this call's Do method. Any
  5129. // pending HTTP request will be aborted if the provided context is
  5130. // canceled.
  5131. func (c *AccountsContainersVersionsLiveCall) Context(ctx context.Context) *AccountsContainersVersionsLiveCall {
  5132. c.ctx_ = ctx
  5133. return c
  5134. }
  5135. // Header returns an http.Header that can be modified by the caller to
  5136. // add HTTP headers to the request.
  5137. func (c *AccountsContainersVersionsLiveCall) Header() http.Header {
  5138. if c.header_ == nil {
  5139. c.header_ = make(http.Header)
  5140. }
  5141. return c.header_
  5142. }
  5143. func (c *AccountsContainersVersionsLiveCall) doRequest(alt string) (*http.Response, error) {
  5144. reqHeaders := make(http.Header)
  5145. for k, v := range c.header_ {
  5146. reqHeaders[k] = v
  5147. }
  5148. reqHeaders.Set("User-Agent", c.s.userAgent())
  5149. if c.ifNoneMatch_ != "" {
  5150. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5151. }
  5152. var body io.Reader = nil
  5153. c.urlParams_.Set("alt", alt)
  5154. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/versions:live")
  5155. urls += "?" + c.urlParams_.Encode()
  5156. req, _ := http.NewRequest("GET", urls, body)
  5157. req.Header = reqHeaders
  5158. googleapi.Expand(req.URL, map[string]string{
  5159. "parent": c.parent,
  5160. })
  5161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5162. }
  5163. // Do executes the "tagmanager.accounts.containers.versions.live" call.
  5164. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5165. // non-2xx status code is an error. Response headers are in either
  5166. // *ContainerVersion.ServerResponse.Header or (if a response was
  5167. // returned at all) in error.(*googleapi.Error).Header. Use
  5168. // googleapi.IsNotModified to check whether the returned error was
  5169. // because http.StatusNotModified was returned.
  5170. func (c *AccountsContainersVersionsLiveCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5171. gensupport.SetOptions(c.urlParams_, opts...)
  5172. res, err := c.doRequest("json")
  5173. if res != nil && res.StatusCode == http.StatusNotModified {
  5174. if res.Body != nil {
  5175. res.Body.Close()
  5176. }
  5177. return nil, &googleapi.Error{
  5178. Code: res.StatusCode,
  5179. Header: res.Header,
  5180. }
  5181. }
  5182. if err != nil {
  5183. return nil, err
  5184. }
  5185. defer googleapi.CloseBody(res)
  5186. if err := googleapi.CheckResponse(res); err != nil {
  5187. return nil, err
  5188. }
  5189. ret := &ContainerVersion{
  5190. ServerResponse: googleapi.ServerResponse{
  5191. Header: res.Header,
  5192. HTTPStatusCode: res.StatusCode,
  5193. },
  5194. }
  5195. target := &ret
  5196. if err := gensupport.DecodeResponse(target, res); err != nil {
  5197. return nil, err
  5198. }
  5199. return ret, nil
  5200. // {
  5201. // "description": "Gets the live (i.e. published) container version",
  5202. // "httpMethod": "GET",
  5203. // "id": "tagmanager.accounts.containers.versions.live",
  5204. // "parameterOrder": [
  5205. // "parent"
  5206. // ],
  5207. // "parameters": {
  5208. // "parent": {
  5209. // "description": "GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  5210. // "location": "path",
  5211. // "required": true,
  5212. // "type": "string"
  5213. // }
  5214. // },
  5215. // "path": "{+parent}/versions:live",
  5216. // "response": {
  5217. // "$ref": "ContainerVersion"
  5218. // },
  5219. // "scopes": [
  5220. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  5221. // "https://www.googleapis.com/auth/tagmanager.readonly"
  5222. // ]
  5223. // }
  5224. }
  5225. // method id "tagmanager.accounts.containers.versions.publish":
  5226. type AccountsContainersVersionsPublishCall struct {
  5227. s *Service
  5228. path string
  5229. urlParams_ gensupport.URLParams
  5230. ctx_ context.Context
  5231. header_ http.Header
  5232. }
  5233. // Publish: Publishes a Container Version.
  5234. func (r *AccountsContainersVersionsService) Publish(path string) *AccountsContainersVersionsPublishCall {
  5235. c := &AccountsContainersVersionsPublishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5236. c.path = path
  5237. return c
  5238. }
  5239. // Fingerprint sets the optional parameter "fingerprint": When provided,
  5240. // this fingerprint must match the fingerprint of the container version
  5241. // in storage.
  5242. func (c *AccountsContainersVersionsPublishCall) Fingerprint(fingerprint string) *AccountsContainersVersionsPublishCall {
  5243. c.urlParams_.Set("fingerprint", fingerprint)
  5244. return c
  5245. }
  5246. // Fields allows partial responses to be retrieved. See
  5247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5248. // for more information.
  5249. func (c *AccountsContainersVersionsPublishCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsPublishCall {
  5250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5251. return c
  5252. }
  5253. // Context sets the context to be used in this call's Do method. Any
  5254. // pending HTTP request will be aborted if the provided context is
  5255. // canceled.
  5256. func (c *AccountsContainersVersionsPublishCall) Context(ctx context.Context) *AccountsContainersVersionsPublishCall {
  5257. c.ctx_ = ctx
  5258. return c
  5259. }
  5260. // Header returns an http.Header that can be modified by the caller to
  5261. // add HTTP headers to the request.
  5262. func (c *AccountsContainersVersionsPublishCall) Header() http.Header {
  5263. if c.header_ == nil {
  5264. c.header_ = make(http.Header)
  5265. }
  5266. return c.header_
  5267. }
  5268. func (c *AccountsContainersVersionsPublishCall) doRequest(alt string) (*http.Response, error) {
  5269. reqHeaders := make(http.Header)
  5270. for k, v := range c.header_ {
  5271. reqHeaders[k] = v
  5272. }
  5273. reqHeaders.Set("User-Agent", c.s.userAgent())
  5274. var body io.Reader = nil
  5275. c.urlParams_.Set("alt", alt)
  5276. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:publish")
  5277. urls += "?" + c.urlParams_.Encode()
  5278. req, _ := http.NewRequest("POST", urls, body)
  5279. req.Header = reqHeaders
  5280. googleapi.Expand(req.URL, map[string]string{
  5281. "path": c.path,
  5282. })
  5283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5284. }
  5285. // Do executes the "tagmanager.accounts.containers.versions.publish" call.
  5286. // Exactly one of *PublishContainerVersionResponse or error will be
  5287. // non-nil. Any non-2xx status code is an error. Response headers are in
  5288. // either *PublishContainerVersionResponse.ServerResponse.Header or (if
  5289. // a response was returned at all) in error.(*googleapi.Error).Header.
  5290. // Use googleapi.IsNotModified to check whether the returned error was
  5291. // because http.StatusNotModified was returned.
  5292. func (c *AccountsContainersVersionsPublishCall) Do(opts ...googleapi.CallOption) (*PublishContainerVersionResponse, error) {
  5293. gensupport.SetOptions(c.urlParams_, opts...)
  5294. res, err := c.doRequest("json")
  5295. if res != nil && res.StatusCode == http.StatusNotModified {
  5296. if res.Body != nil {
  5297. res.Body.Close()
  5298. }
  5299. return nil, &googleapi.Error{
  5300. Code: res.StatusCode,
  5301. Header: res.Header,
  5302. }
  5303. }
  5304. if err != nil {
  5305. return nil, err
  5306. }
  5307. defer googleapi.CloseBody(res)
  5308. if err := googleapi.CheckResponse(res); err != nil {
  5309. return nil, err
  5310. }
  5311. ret := &PublishContainerVersionResponse{
  5312. ServerResponse: googleapi.ServerResponse{
  5313. Header: res.Header,
  5314. HTTPStatusCode: res.StatusCode,
  5315. },
  5316. }
  5317. target := &ret
  5318. if err := gensupport.DecodeResponse(target, res); err != nil {
  5319. return nil, err
  5320. }
  5321. return ret, nil
  5322. // {
  5323. // "description": "Publishes a Container Version.",
  5324. // "httpMethod": "POST",
  5325. // "id": "tagmanager.accounts.containers.versions.publish",
  5326. // "parameterOrder": [
  5327. // "path"
  5328. // ],
  5329. // "parameters": {
  5330. // "fingerprint": {
  5331. // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.",
  5332. // "location": "query",
  5333. // "type": "string"
  5334. // },
  5335. // "path": {
  5336. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5337. // "location": "path",
  5338. // "required": true,
  5339. // "type": "string"
  5340. // }
  5341. // },
  5342. // "path": "{+path}:publish",
  5343. // "response": {
  5344. // "$ref": "PublishContainerVersionResponse"
  5345. // },
  5346. // "scopes": [
  5347. // "https://www.googleapis.com/auth/tagmanager.publish"
  5348. // ]
  5349. // }
  5350. }
  5351. // method id "tagmanager.accounts.containers.versions.set_latest":
  5352. type AccountsContainersVersionsSetLatestCall struct {
  5353. s *Service
  5354. path string
  5355. urlParams_ gensupport.URLParams
  5356. ctx_ context.Context
  5357. header_ http.Header
  5358. }
  5359. // SetLatest: Sets the latest version used for synchronization of
  5360. // workspaces when detecting conflicts and errors.
  5361. func (r *AccountsContainersVersionsService) SetLatest(path string) *AccountsContainersVersionsSetLatestCall {
  5362. c := &AccountsContainersVersionsSetLatestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5363. c.path = path
  5364. return c
  5365. }
  5366. // Fields allows partial responses to be retrieved. See
  5367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5368. // for more information.
  5369. func (c *AccountsContainersVersionsSetLatestCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsSetLatestCall {
  5370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5371. return c
  5372. }
  5373. // Context sets the context to be used in this call's Do method. Any
  5374. // pending HTTP request will be aborted if the provided context is
  5375. // canceled.
  5376. func (c *AccountsContainersVersionsSetLatestCall) Context(ctx context.Context) *AccountsContainersVersionsSetLatestCall {
  5377. c.ctx_ = ctx
  5378. return c
  5379. }
  5380. // Header returns an http.Header that can be modified by the caller to
  5381. // add HTTP headers to the request.
  5382. func (c *AccountsContainersVersionsSetLatestCall) Header() http.Header {
  5383. if c.header_ == nil {
  5384. c.header_ = make(http.Header)
  5385. }
  5386. return c.header_
  5387. }
  5388. func (c *AccountsContainersVersionsSetLatestCall) doRequest(alt string) (*http.Response, error) {
  5389. reqHeaders := make(http.Header)
  5390. for k, v := range c.header_ {
  5391. reqHeaders[k] = v
  5392. }
  5393. reqHeaders.Set("User-Agent", c.s.userAgent())
  5394. var body io.Reader = nil
  5395. c.urlParams_.Set("alt", alt)
  5396. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:set_latest")
  5397. urls += "?" + c.urlParams_.Encode()
  5398. req, _ := http.NewRequest("POST", urls, body)
  5399. req.Header = reqHeaders
  5400. googleapi.Expand(req.URL, map[string]string{
  5401. "path": c.path,
  5402. })
  5403. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5404. }
  5405. // Do executes the "tagmanager.accounts.containers.versions.set_latest" call.
  5406. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5407. // non-2xx status code is an error. Response headers are in either
  5408. // *ContainerVersion.ServerResponse.Header or (if a response was
  5409. // returned at all) in error.(*googleapi.Error).Header. Use
  5410. // googleapi.IsNotModified to check whether the returned error was
  5411. // because http.StatusNotModified was returned.
  5412. func (c *AccountsContainersVersionsSetLatestCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5413. gensupport.SetOptions(c.urlParams_, opts...)
  5414. res, err := c.doRequest("json")
  5415. if res != nil && res.StatusCode == http.StatusNotModified {
  5416. if res.Body != nil {
  5417. res.Body.Close()
  5418. }
  5419. return nil, &googleapi.Error{
  5420. Code: res.StatusCode,
  5421. Header: res.Header,
  5422. }
  5423. }
  5424. if err != nil {
  5425. return nil, err
  5426. }
  5427. defer googleapi.CloseBody(res)
  5428. if err := googleapi.CheckResponse(res); err != nil {
  5429. return nil, err
  5430. }
  5431. ret := &ContainerVersion{
  5432. ServerResponse: googleapi.ServerResponse{
  5433. Header: res.Header,
  5434. HTTPStatusCode: res.StatusCode,
  5435. },
  5436. }
  5437. target := &ret
  5438. if err := gensupport.DecodeResponse(target, res); err != nil {
  5439. return nil, err
  5440. }
  5441. return ret, nil
  5442. // {
  5443. // "description": "Sets the latest version used for synchronization of workspaces when detecting conflicts and errors.",
  5444. // "httpMethod": "POST",
  5445. // "id": "tagmanager.accounts.containers.versions.set_latest",
  5446. // "parameterOrder": [
  5447. // "path"
  5448. // ],
  5449. // "parameters": {
  5450. // "path": {
  5451. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5452. // "location": "path",
  5453. // "required": true,
  5454. // "type": "string"
  5455. // }
  5456. // },
  5457. // "path": "{+path}:set_latest",
  5458. // "response": {
  5459. // "$ref": "ContainerVersion"
  5460. // },
  5461. // "scopes": [
  5462. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5463. // ]
  5464. // }
  5465. }
  5466. // method id "tagmanager.accounts.containers.versions.undelete":
  5467. type AccountsContainersVersionsUndeleteCall struct {
  5468. s *Service
  5469. path string
  5470. urlParams_ gensupport.URLParams
  5471. ctx_ context.Context
  5472. header_ http.Header
  5473. }
  5474. // Undelete: Undeletes a Container Version.
  5475. func (r *AccountsContainersVersionsService) Undelete(path string) *AccountsContainersVersionsUndeleteCall {
  5476. c := &AccountsContainersVersionsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5477. c.path = path
  5478. return c
  5479. }
  5480. // Fields allows partial responses to be retrieved. See
  5481. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5482. // for more information.
  5483. func (c *AccountsContainersVersionsUndeleteCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUndeleteCall {
  5484. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5485. return c
  5486. }
  5487. // Context sets the context to be used in this call's Do method. Any
  5488. // pending HTTP request will be aborted if the provided context is
  5489. // canceled.
  5490. func (c *AccountsContainersVersionsUndeleteCall) Context(ctx context.Context) *AccountsContainersVersionsUndeleteCall {
  5491. c.ctx_ = ctx
  5492. return c
  5493. }
  5494. // Header returns an http.Header that can be modified by the caller to
  5495. // add HTTP headers to the request.
  5496. func (c *AccountsContainersVersionsUndeleteCall) Header() http.Header {
  5497. if c.header_ == nil {
  5498. c.header_ = make(http.Header)
  5499. }
  5500. return c.header_
  5501. }
  5502. func (c *AccountsContainersVersionsUndeleteCall) doRequest(alt string) (*http.Response, error) {
  5503. reqHeaders := make(http.Header)
  5504. for k, v := range c.header_ {
  5505. reqHeaders[k] = v
  5506. }
  5507. reqHeaders.Set("User-Agent", c.s.userAgent())
  5508. var body io.Reader = nil
  5509. c.urlParams_.Set("alt", alt)
  5510. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:undelete")
  5511. urls += "?" + c.urlParams_.Encode()
  5512. req, _ := http.NewRequest("POST", urls, body)
  5513. req.Header = reqHeaders
  5514. googleapi.Expand(req.URL, map[string]string{
  5515. "path": c.path,
  5516. })
  5517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5518. }
  5519. // Do executes the "tagmanager.accounts.containers.versions.undelete" call.
  5520. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5521. // non-2xx status code is an error. Response headers are in either
  5522. // *ContainerVersion.ServerResponse.Header or (if a response was
  5523. // returned at all) in error.(*googleapi.Error).Header. Use
  5524. // googleapi.IsNotModified to check whether the returned error was
  5525. // because http.StatusNotModified was returned.
  5526. func (c *AccountsContainersVersionsUndeleteCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5527. gensupport.SetOptions(c.urlParams_, opts...)
  5528. res, err := c.doRequest("json")
  5529. if res != nil && res.StatusCode == http.StatusNotModified {
  5530. if res.Body != nil {
  5531. res.Body.Close()
  5532. }
  5533. return nil, &googleapi.Error{
  5534. Code: res.StatusCode,
  5535. Header: res.Header,
  5536. }
  5537. }
  5538. if err != nil {
  5539. return nil, err
  5540. }
  5541. defer googleapi.CloseBody(res)
  5542. if err := googleapi.CheckResponse(res); err != nil {
  5543. return nil, err
  5544. }
  5545. ret := &ContainerVersion{
  5546. ServerResponse: googleapi.ServerResponse{
  5547. Header: res.Header,
  5548. HTTPStatusCode: res.StatusCode,
  5549. },
  5550. }
  5551. target := &ret
  5552. if err := gensupport.DecodeResponse(target, res); err != nil {
  5553. return nil, err
  5554. }
  5555. return ret, nil
  5556. // {
  5557. // "description": "Undeletes a Container Version.",
  5558. // "httpMethod": "POST",
  5559. // "id": "tagmanager.accounts.containers.versions.undelete",
  5560. // "parameterOrder": [
  5561. // "path"
  5562. // ],
  5563. // "parameters": {
  5564. // "path": {
  5565. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5566. // "location": "path",
  5567. // "required": true,
  5568. // "type": "string"
  5569. // }
  5570. // },
  5571. // "path": "{+path}:undelete",
  5572. // "response": {
  5573. // "$ref": "ContainerVersion"
  5574. // },
  5575. // "scopes": [
  5576. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  5577. // ]
  5578. // }
  5579. }
  5580. // method id "tagmanager.accounts.containers.versions.update":
  5581. type AccountsContainersVersionsUpdateCall struct {
  5582. s *Service
  5583. path string
  5584. containerversion *ContainerVersion
  5585. urlParams_ gensupport.URLParams
  5586. ctx_ context.Context
  5587. header_ http.Header
  5588. }
  5589. // Update: Updates a Container Version.
  5590. func (r *AccountsContainersVersionsService) Update(path string, containerversion *ContainerVersion) *AccountsContainersVersionsUpdateCall {
  5591. c := &AccountsContainersVersionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5592. c.path = path
  5593. c.containerversion = containerversion
  5594. return c
  5595. }
  5596. // Fingerprint sets the optional parameter "fingerprint": When provided,
  5597. // this fingerprint must match the fingerprint of the container version
  5598. // in storage.
  5599. func (c *AccountsContainersVersionsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersVersionsUpdateCall {
  5600. c.urlParams_.Set("fingerprint", fingerprint)
  5601. return c
  5602. }
  5603. // Fields allows partial responses to be retrieved. See
  5604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5605. // for more information.
  5606. func (c *AccountsContainersVersionsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersVersionsUpdateCall {
  5607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5608. return c
  5609. }
  5610. // Context sets the context to be used in this call's Do method. Any
  5611. // pending HTTP request will be aborted if the provided context is
  5612. // canceled.
  5613. func (c *AccountsContainersVersionsUpdateCall) Context(ctx context.Context) *AccountsContainersVersionsUpdateCall {
  5614. c.ctx_ = ctx
  5615. return c
  5616. }
  5617. // Header returns an http.Header that can be modified by the caller to
  5618. // add HTTP headers to the request.
  5619. func (c *AccountsContainersVersionsUpdateCall) Header() http.Header {
  5620. if c.header_ == nil {
  5621. c.header_ = make(http.Header)
  5622. }
  5623. return c.header_
  5624. }
  5625. func (c *AccountsContainersVersionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5626. reqHeaders := make(http.Header)
  5627. for k, v := range c.header_ {
  5628. reqHeaders[k] = v
  5629. }
  5630. reqHeaders.Set("User-Agent", c.s.userAgent())
  5631. var body io.Reader = nil
  5632. body, err := googleapi.WithoutDataWrapper.JSONReader(c.containerversion)
  5633. if err != nil {
  5634. return nil, err
  5635. }
  5636. reqHeaders.Set("Content-Type", "application/json")
  5637. c.urlParams_.Set("alt", alt)
  5638. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  5639. urls += "?" + c.urlParams_.Encode()
  5640. req, _ := http.NewRequest("PUT", urls, body)
  5641. req.Header = reqHeaders
  5642. googleapi.Expand(req.URL, map[string]string{
  5643. "path": c.path,
  5644. })
  5645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5646. }
  5647. // Do executes the "tagmanager.accounts.containers.versions.update" call.
  5648. // Exactly one of *ContainerVersion or error will be non-nil. Any
  5649. // non-2xx status code is an error. Response headers are in either
  5650. // *ContainerVersion.ServerResponse.Header or (if a response was
  5651. // returned at all) in error.(*googleapi.Error).Header. Use
  5652. // googleapi.IsNotModified to check whether the returned error was
  5653. // because http.StatusNotModified was returned.
  5654. func (c *AccountsContainersVersionsUpdateCall) Do(opts ...googleapi.CallOption) (*ContainerVersion, error) {
  5655. gensupport.SetOptions(c.urlParams_, opts...)
  5656. res, err := c.doRequest("json")
  5657. if res != nil && res.StatusCode == http.StatusNotModified {
  5658. if res.Body != nil {
  5659. res.Body.Close()
  5660. }
  5661. return nil, &googleapi.Error{
  5662. Code: res.StatusCode,
  5663. Header: res.Header,
  5664. }
  5665. }
  5666. if err != nil {
  5667. return nil, err
  5668. }
  5669. defer googleapi.CloseBody(res)
  5670. if err := googleapi.CheckResponse(res); err != nil {
  5671. return nil, err
  5672. }
  5673. ret := &ContainerVersion{
  5674. ServerResponse: googleapi.ServerResponse{
  5675. Header: res.Header,
  5676. HTTPStatusCode: res.StatusCode,
  5677. },
  5678. }
  5679. target := &ret
  5680. if err := gensupport.DecodeResponse(target, res); err != nil {
  5681. return nil, err
  5682. }
  5683. return ret, nil
  5684. // {
  5685. // "description": "Updates a Container Version.",
  5686. // "httpMethod": "PUT",
  5687. // "id": "tagmanager.accounts.containers.versions.update",
  5688. // "parameterOrder": [
  5689. // "path"
  5690. // ],
  5691. // "parameters": {
  5692. // "fingerprint": {
  5693. // "description": "When provided, this fingerprint must match the fingerprint of the container version in storage.",
  5694. // "location": "query",
  5695. // "type": "string"
  5696. // },
  5697. // "path": {
  5698. // "description": "GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id}",
  5699. // "location": "path",
  5700. // "required": true,
  5701. // "type": "string"
  5702. // }
  5703. // },
  5704. // "path": "{+path}",
  5705. // "request": {
  5706. // "$ref": "ContainerVersion"
  5707. // },
  5708. // "response": {
  5709. // "$ref": "ContainerVersion"
  5710. // },
  5711. // "scopes": [
  5712. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  5713. // ]
  5714. // }
  5715. }
  5716. // method id "tagmanager.accounts.containers.workspaces.create":
  5717. type AccountsContainersWorkspacesCreateCall struct {
  5718. s *Service
  5719. parent string
  5720. workspace *Workspace
  5721. urlParams_ gensupport.URLParams
  5722. ctx_ context.Context
  5723. header_ http.Header
  5724. }
  5725. // Create: Creates a Workspace.
  5726. func (r *AccountsContainersWorkspacesService) Create(parent string, workspace *Workspace) *AccountsContainersWorkspacesCreateCall {
  5727. c := &AccountsContainersWorkspacesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5728. c.parent = parent
  5729. c.workspace = workspace
  5730. return c
  5731. }
  5732. // Fields allows partial responses to be retrieved. See
  5733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5734. // for more information.
  5735. func (c *AccountsContainersWorkspacesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesCreateCall {
  5736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5737. return c
  5738. }
  5739. // Context sets the context to be used in this call's Do method. Any
  5740. // pending HTTP request will be aborted if the provided context is
  5741. // canceled.
  5742. func (c *AccountsContainersWorkspacesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesCreateCall {
  5743. c.ctx_ = ctx
  5744. return c
  5745. }
  5746. // Header returns an http.Header that can be modified by the caller to
  5747. // add HTTP headers to the request.
  5748. func (c *AccountsContainersWorkspacesCreateCall) Header() http.Header {
  5749. if c.header_ == nil {
  5750. c.header_ = make(http.Header)
  5751. }
  5752. return c.header_
  5753. }
  5754. func (c *AccountsContainersWorkspacesCreateCall) doRequest(alt string) (*http.Response, error) {
  5755. reqHeaders := make(http.Header)
  5756. for k, v := range c.header_ {
  5757. reqHeaders[k] = v
  5758. }
  5759. reqHeaders.Set("User-Agent", c.s.userAgent())
  5760. var body io.Reader = nil
  5761. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace)
  5762. if err != nil {
  5763. return nil, err
  5764. }
  5765. reqHeaders.Set("Content-Type", "application/json")
  5766. c.urlParams_.Set("alt", alt)
  5767. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/workspaces")
  5768. urls += "?" + c.urlParams_.Encode()
  5769. req, _ := http.NewRequest("POST", urls, body)
  5770. req.Header = reqHeaders
  5771. googleapi.Expand(req.URL, map[string]string{
  5772. "parent": c.parent,
  5773. })
  5774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5775. }
  5776. // Do executes the "tagmanager.accounts.containers.workspaces.create" call.
  5777. // Exactly one of *Workspace or error will be non-nil. Any non-2xx
  5778. // status code is an error. Response headers are in either
  5779. // *Workspace.ServerResponse.Header or (if a response was returned at
  5780. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5781. // to check whether the returned error was because
  5782. // http.StatusNotModified was returned.
  5783. func (c *AccountsContainersWorkspacesCreateCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
  5784. gensupport.SetOptions(c.urlParams_, opts...)
  5785. res, err := c.doRequest("json")
  5786. if res != nil && res.StatusCode == http.StatusNotModified {
  5787. if res.Body != nil {
  5788. res.Body.Close()
  5789. }
  5790. return nil, &googleapi.Error{
  5791. Code: res.StatusCode,
  5792. Header: res.Header,
  5793. }
  5794. }
  5795. if err != nil {
  5796. return nil, err
  5797. }
  5798. defer googleapi.CloseBody(res)
  5799. if err := googleapi.CheckResponse(res); err != nil {
  5800. return nil, err
  5801. }
  5802. ret := &Workspace{
  5803. ServerResponse: googleapi.ServerResponse{
  5804. Header: res.Header,
  5805. HTTPStatusCode: res.StatusCode,
  5806. },
  5807. }
  5808. target := &ret
  5809. if err := gensupport.DecodeResponse(target, res); err != nil {
  5810. return nil, err
  5811. }
  5812. return ret, nil
  5813. // {
  5814. // "description": "Creates a Workspace.",
  5815. // "httpMethod": "POST",
  5816. // "id": "tagmanager.accounts.containers.workspaces.create",
  5817. // "parameterOrder": [
  5818. // "parent"
  5819. // ],
  5820. // "parameters": {
  5821. // "parent": {
  5822. // "description": "GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  5823. // "location": "path",
  5824. // "required": true,
  5825. // "type": "string"
  5826. // }
  5827. // },
  5828. // "path": "{+parent}/workspaces",
  5829. // "request": {
  5830. // "$ref": "Workspace"
  5831. // },
  5832. // "response": {
  5833. // "$ref": "Workspace"
  5834. // },
  5835. // "scopes": [
  5836. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  5837. // ]
  5838. // }
  5839. }
  5840. // method id "tagmanager.accounts.containers.workspaces.create_version":
  5841. type AccountsContainersWorkspacesCreateVersionCall struct {
  5842. s *Service
  5843. path string
  5844. createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions
  5845. urlParams_ gensupport.URLParams
  5846. ctx_ context.Context
  5847. header_ http.Header
  5848. }
  5849. // CreateVersion: Creates a Container Version from the entities present
  5850. // in the workspace, deletes the workspace, and sets the base container
  5851. // version to the newly created version.
  5852. func (r *AccountsContainersWorkspacesService) CreateVersion(path string, createcontainerversionrequestversionoptions *CreateContainerVersionRequestVersionOptions) *AccountsContainersWorkspacesCreateVersionCall {
  5853. c := &AccountsContainersWorkspacesCreateVersionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5854. c.path = path
  5855. c.createcontainerversionrequestversionoptions = createcontainerversionrequestversionoptions
  5856. return c
  5857. }
  5858. // Fields allows partial responses to be retrieved. See
  5859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5860. // for more information.
  5861. func (c *AccountsContainersWorkspacesCreateVersionCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesCreateVersionCall {
  5862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5863. return c
  5864. }
  5865. // Context sets the context to be used in this call's Do method. Any
  5866. // pending HTTP request will be aborted if the provided context is
  5867. // canceled.
  5868. func (c *AccountsContainersWorkspacesCreateVersionCall) Context(ctx context.Context) *AccountsContainersWorkspacesCreateVersionCall {
  5869. c.ctx_ = ctx
  5870. return c
  5871. }
  5872. // Header returns an http.Header that can be modified by the caller to
  5873. // add HTTP headers to the request.
  5874. func (c *AccountsContainersWorkspacesCreateVersionCall) Header() http.Header {
  5875. if c.header_ == nil {
  5876. c.header_ = make(http.Header)
  5877. }
  5878. return c.header_
  5879. }
  5880. func (c *AccountsContainersWorkspacesCreateVersionCall) doRequest(alt string) (*http.Response, error) {
  5881. reqHeaders := make(http.Header)
  5882. for k, v := range c.header_ {
  5883. reqHeaders[k] = v
  5884. }
  5885. reqHeaders.Set("User-Agent", c.s.userAgent())
  5886. var body io.Reader = nil
  5887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcontainerversionrequestversionoptions)
  5888. if err != nil {
  5889. return nil, err
  5890. }
  5891. reqHeaders.Set("Content-Type", "application/json")
  5892. c.urlParams_.Set("alt", alt)
  5893. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:create_version")
  5894. urls += "?" + c.urlParams_.Encode()
  5895. req, _ := http.NewRequest("POST", urls, body)
  5896. req.Header = reqHeaders
  5897. googleapi.Expand(req.URL, map[string]string{
  5898. "path": c.path,
  5899. })
  5900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5901. }
  5902. // Do executes the "tagmanager.accounts.containers.workspaces.create_version" call.
  5903. // Exactly one of *CreateContainerVersionResponse or error will be
  5904. // non-nil. Any non-2xx status code is an error. Response headers are in
  5905. // either *CreateContainerVersionResponse.ServerResponse.Header or (if a
  5906. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5907. // googleapi.IsNotModified to check whether the returned error was
  5908. // because http.StatusNotModified was returned.
  5909. func (c *AccountsContainersWorkspacesCreateVersionCall) Do(opts ...googleapi.CallOption) (*CreateContainerVersionResponse, error) {
  5910. gensupport.SetOptions(c.urlParams_, opts...)
  5911. res, err := c.doRequest("json")
  5912. if res != nil && res.StatusCode == http.StatusNotModified {
  5913. if res.Body != nil {
  5914. res.Body.Close()
  5915. }
  5916. return nil, &googleapi.Error{
  5917. Code: res.StatusCode,
  5918. Header: res.Header,
  5919. }
  5920. }
  5921. if err != nil {
  5922. return nil, err
  5923. }
  5924. defer googleapi.CloseBody(res)
  5925. if err := googleapi.CheckResponse(res); err != nil {
  5926. return nil, err
  5927. }
  5928. ret := &CreateContainerVersionResponse{
  5929. ServerResponse: googleapi.ServerResponse{
  5930. Header: res.Header,
  5931. HTTPStatusCode: res.StatusCode,
  5932. },
  5933. }
  5934. target := &ret
  5935. if err := gensupport.DecodeResponse(target, res); err != nil {
  5936. return nil, err
  5937. }
  5938. return ret, nil
  5939. // {
  5940. // "description": "Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version.",
  5941. // "httpMethod": "POST",
  5942. // "id": "tagmanager.accounts.containers.workspaces.create_version",
  5943. // "parameterOrder": [
  5944. // "path"
  5945. // ],
  5946. // "parameters": {
  5947. // "path": {
  5948. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  5949. // "location": "path",
  5950. // "required": true,
  5951. // "type": "string"
  5952. // }
  5953. // },
  5954. // "path": "{+path}:create_version",
  5955. // "request": {
  5956. // "$ref": "CreateContainerVersionRequestVersionOptions"
  5957. // },
  5958. // "response": {
  5959. // "$ref": "CreateContainerVersionResponse"
  5960. // },
  5961. // "scopes": [
  5962. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  5963. // ]
  5964. // }
  5965. }
  5966. // method id "tagmanager.accounts.containers.workspaces.delete":
  5967. type AccountsContainersWorkspacesDeleteCall struct {
  5968. s *Service
  5969. path string
  5970. urlParams_ gensupport.URLParams
  5971. ctx_ context.Context
  5972. header_ http.Header
  5973. }
  5974. // Delete: Deletes a Workspace.
  5975. func (r *AccountsContainersWorkspacesService) Delete(path string) *AccountsContainersWorkspacesDeleteCall {
  5976. c := &AccountsContainersWorkspacesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5977. c.path = path
  5978. return c
  5979. }
  5980. // Fields allows partial responses to be retrieved. See
  5981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5982. // for more information.
  5983. func (c *AccountsContainersWorkspacesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesDeleteCall {
  5984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5985. return c
  5986. }
  5987. // Context sets the context to be used in this call's Do method. Any
  5988. // pending HTTP request will be aborted if the provided context is
  5989. // canceled.
  5990. func (c *AccountsContainersWorkspacesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesDeleteCall {
  5991. c.ctx_ = ctx
  5992. return c
  5993. }
  5994. // Header returns an http.Header that can be modified by the caller to
  5995. // add HTTP headers to the request.
  5996. func (c *AccountsContainersWorkspacesDeleteCall) Header() http.Header {
  5997. if c.header_ == nil {
  5998. c.header_ = make(http.Header)
  5999. }
  6000. return c.header_
  6001. }
  6002. func (c *AccountsContainersWorkspacesDeleteCall) doRequest(alt string) (*http.Response, error) {
  6003. reqHeaders := make(http.Header)
  6004. for k, v := range c.header_ {
  6005. reqHeaders[k] = v
  6006. }
  6007. reqHeaders.Set("User-Agent", c.s.userAgent())
  6008. var body io.Reader = nil
  6009. c.urlParams_.Set("alt", alt)
  6010. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  6011. urls += "?" + c.urlParams_.Encode()
  6012. req, _ := http.NewRequest("DELETE", urls, body)
  6013. req.Header = reqHeaders
  6014. googleapi.Expand(req.URL, map[string]string{
  6015. "path": c.path,
  6016. })
  6017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6018. }
  6019. // Do executes the "tagmanager.accounts.containers.workspaces.delete" call.
  6020. func (c *AccountsContainersWorkspacesDeleteCall) Do(opts ...googleapi.CallOption) error {
  6021. gensupport.SetOptions(c.urlParams_, opts...)
  6022. res, err := c.doRequest("json")
  6023. if err != nil {
  6024. return err
  6025. }
  6026. defer googleapi.CloseBody(res)
  6027. if err := googleapi.CheckResponse(res); err != nil {
  6028. return err
  6029. }
  6030. return nil
  6031. // {
  6032. // "description": "Deletes a Workspace.",
  6033. // "httpMethod": "DELETE",
  6034. // "id": "tagmanager.accounts.containers.workspaces.delete",
  6035. // "parameterOrder": [
  6036. // "path"
  6037. // ],
  6038. // "parameters": {
  6039. // "path": {
  6040. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6041. // "location": "path",
  6042. // "required": true,
  6043. // "type": "string"
  6044. // }
  6045. // },
  6046. // "path": "{+path}",
  6047. // "scopes": [
  6048. // "https://www.googleapis.com/auth/tagmanager.delete.containers"
  6049. // ]
  6050. // }
  6051. }
  6052. // method id "tagmanager.accounts.containers.workspaces.get":
  6053. type AccountsContainersWorkspacesGetCall struct {
  6054. s *Service
  6055. path string
  6056. urlParams_ gensupport.URLParams
  6057. ifNoneMatch_ string
  6058. ctx_ context.Context
  6059. header_ http.Header
  6060. }
  6061. // Get: Gets a Workspace.
  6062. func (r *AccountsContainersWorkspacesService) Get(path string) *AccountsContainersWorkspacesGetCall {
  6063. c := &AccountsContainersWorkspacesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6064. c.path = path
  6065. return c
  6066. }
  6067. // Fields allows partial responses to be retrieved. See
  6068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6069. // for more information.
  6070. func (c *AccountsContainersWorkspacesGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesGetCall {
  6071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6072. return c
  6073. }
  6074. // IfNoneMatch sets the optional parameter which makes the operation
  6075. // fail if the object's ETag matches the given value. This is useful for
  6076. // getting updates only after the object has changed since the last
  6077. // request. Use googleapi.IsNotModified to check whether the response
  6078. // error from Do is the result of In-None-Match.
  6079. func (c *AccountsContainersWorkspacesGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesGetCall {
  6080. c.ifNoneMatch_ = entityTag
  6081. return c
  6082. }
  6083. // Context sets the context to be used in this call's Do method. Any
  6084. // pending HTTP request will be aborted if the provided context is
  6085. // canceled.
  6086. func (c *AccountsContainersWorkspacesGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesGetCall {
  6087. c.ctx_ = ctx
  6088. return c
  6089. }
  6090. // Header returns an http.Header that can be modified by the caller to
  6091. // add HTTP headers to the request.
  6092. func (c *AccountsContainersWorkspacesGetCall) Header() http.Header {
  6093. if c.header_ == nil {
  6094. c.header_ = make(http.Header)
  6095. }
  6096. return c.header_
  6097. }
  6098. func (c *AccountsContainersWorkspacesGetCall) doRequest(alt string) (*http.Response, error) {
  6099. reqHeaders := make(http.Header)
  6100. for k, v := range c.header_ {
  6101. reqHeaders[k] = v
  6102. }
  6103. reqHeaders.Set("User-Agent", c.s.userAgent())
  6104. if c.ifNoneMatch_ != "" {
  6105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6106. }
  6107. var body io.Reader = nil
  6108. c.urlParams_.Set("alt", alt)
  6109. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  6110. urls += "?" + c.urlParams_.Encode()
  6111. req, _ := http.NewRequest("GET", urls, body)
  6112. req.Header = reqHeaders
  6113. googleapi.Expand(req.URL, map[string]string{
  6114. "path": c.path,
  6115. })
  6116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6117. }
  6118. // Do executes the "tagmanager.accounts.containers.workspaces.get" call.
  6119. // Exactly one of *Workspace or error will be non-nil. Any non-2xx
  6120. // status code is an error. Response headers are in either
  6121. // *Workspace.ServerResponse.Header or (if a response was returned at
  6122. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6123. // to check whether the returned error was because
  6124. // http.StatusNotModified was returned.
  6125. func (c *AccountsContainersWorkspacesGetCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
  6126. gensupport.SetOptions(c.urlParams_, opts...)
  6127. res, err := c.doRequest("json")
  6128. if res != nil && res.StatusCode == http.StatusNotModified {
  6129. if res.Body != nil {
  6130. res.Body.Close()
  6131. }
  6132. return nil, &googleapi.Error{
  6133. Code: res.StatusCode,
  6134. Header: res.Header,
  6135. }
  6136. }
  6137. if err != nil {
  6138. return nil, err
  6139. }
  6140. defer googleapi.CloseBody(res)
  6141. if err := googleapi.CheckResponse(res); err != nil {
  6142. return nil, err
  6143. }
  6144. ret := &Workspace{
  6145. ServerResponse: googleapi.ServerResponse{
  6146. Header: res.Header,
  6147. HTTPStatusCode: res.StatusCode,
  6148. },
  6149. }
  6150. target := &ret
  6151. if err := gensupport.DecodeResponse(target, res); err != nil {
  6152. return nil, err
  6153. }
  6154. return ret, nil
  6155. // {
  6156. // "description": "Gets a Workspace.",
  6157. // "httpMethod": "GET",
  6158. // "id": "tagmanager.accounts.containers.workspaces.get",
  6159. // "parameterOrder": [
  6160. // "path"
  6161. // ],
  6162. // "parameters": {
  6163. // "path": {
  6164. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6165. // "location": "path",
  6166. // "required": true,
  6167. // "type": "string"
  6168. // }
  6169. // },
  6170. // "path": "{+path}",
  6171. // "response": {
  6172. // "$ref": "Workspace"
  6173. // },
  6174. // "scopes": [
  6175. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6176. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6177. // ]
  6178. // }
  6179. }
  6180. // method id "tagmanager.accounts.containers.workspaces.getProposal":
  6181. type AccountsContainersWorkspacesGetProposalCall struct {
  6182. s *Service
  6183. path string
  6184. urlParams_ gensupport.URLParams
  6185. ifNoneMatch_ string
  6186. ctx_ context.Context
  6187. header_ http.Header
  6188. }
  6189. // GetProposal: Gets a GTM Workspace Proposal.
  6190. func (r *AccountsContainersWorkspacesService) GetProposal(path string) *AccountsContainersWorkspacesGetProposalCall {
  6191. c := &AccountsContainersWorkspacesGetProposalCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6192. c.path = path
  6193. return c
  6194. }
  6195. // Fields allows partial responses to be retrieved. See
  6196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6197. // for more information.
  6198. func (c *AccountsContainersWorkspacesGetProposalCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesGetProposalCall {
  6199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6200. return c
  6201. }
  6202. // IfNoneMatch sets the optional parameter which makes the operation
  6203. // fail if the object's ETag matches the given value. This is useful for
  6204. // getting updates only after the object has changed since the last
  6205. // request. Use googleapi.IsNotModified to check whether the response
  6206. // error from Do is the result of In-None-Match.
  6207. func (c *AccountsContainersWorkspacesGetProposalCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesGetProposalCall {
  6208. c.ifNoneMatch_ = entityTag
  6209. return c
  6210. }
  6211. // Context sets the context to be used in this call's Do method. Any
  6212. // pending HTTP request will be aborted if the provided context is
  6213. // canceled.
  6214. func (c *AccountsContainersWorkspacesGetProposalCall) Context(ctx context.Context) *AccountsContainersWorkspacesGetProposalCall {
  6215. c.ctx_ = ctx
  6216. return c
  6217. }
  6218. // Header returns an http.Header that can be modified by the caller to
  6219. // add HTTP headers to the request.
  6220. func (c *AccountsContainersWorkspacesGetProposalCall) Header() http.Header {
  6221. if c.header_ == nil {
  6222. c.header_ = make(http.Header)
  6223. }
  6224. return c.header_
  6225. }
  6226. func (c *AccountsContainersWorkspacesGetProposalCall) doRequest(alt string) (*http.Response, error) {
  6227. reqHeaders := make(http.Header)
  6228. for k, v := range c.header_ {
  6229. reqHeaders[k] = v
  6230. }
  6231. reqHeaders.Set("User-Agent", c.s.userAgent())
  6232. if c.ifNoneMatch_ != "" {
  6233. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6234. }
  6235. var body io.Reader = nil
  6236. c.urlParams_.Set("alt", alt)
  6237. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  6238. urls += "?" + c.urlParams_.Encode()
  6239. req, _ := http.NewRequest("GET", urls, body)
  6240. req.Header = reqHeaders
  6241. googleapi.Expand(req.URL, map[string]string{
  6242. "path": c.path,
  6243. })
  6244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6245. }
  6246. // Do executes the "tagmanager.accounts.containers.workspaces.getProposal" call.
  6247. // Exactly one of *WorkspaceProposal or error will be non-nil. Any
  6248. // non-2xx status code is an error. Response headers are in either
  6249. // *WorkspaceProposal.ServerResponse.Header or (if a response was
  6250. // returned at all) in error.(*googleapi.Error).Header. Use
  6251. // googleapi.IsNotModified to check whether the returned error was
  6252. // because http.StatusNotModified was returned.
  6253. func (c *AccountsContainersWorkspacesGetProposalCall) Do(opts ...googleapi.CallOption) (*WorkspaceProposal, error) {
  6254. gensupport.SetOptions(c.urlParams_, opts...)
  6255. res, err := c.doRequest("json")
  6256. if res != nil && res.StatusCode == http.StatusNotModified {
  6257. if res.Body != nil {
  6258. res.Body.Close()
  6259. }
  6260. return nil, &googleapi.Error{
  6261. Code: res.StatusCode,
  6262. Header: res.Header,
  6263. }
  6264. }
  6265. if err != nil {
  6266. return nil, err
  6267. }
  6268. defer googleapi.CloseBody(res)
  6269. if err := googleapi.CheckResponse(res); err != nil {
  6270. return nil, err
  6271. }
  6272. ret := &WorkspaceProposal{
  6273. ServerResponse: googleapi.ServerResponse{
  6274. Header: res.Header,
  6275. HTTPStatusCode: res.StatusCode,
  6276. },
  6277. }
  6278. target := &ret
  6279. if err := gensupport.DecodeResponse(target, res); err != nil {
  6280. return nil, err
  6281. }
  6282. return ret, nil
  6283. // {
  6284. // "description": "Gets a GTM Workspace Proposal.",
  6285. // "httpMethod": "GET",
  6286. // "id": "tagmanager.accounts.containers.workspaces.getProposal",
  6287. // "parameterOrder": [
  6288. // "path"
  6289. // ],
  6290. // "parameters": {
  6291. // "path": {
  6292. // "description": "GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal",
  6293. // "location": "path",
  6294. // "required": true,
  6295. // "type": "string"
  6296. // }
  6297. // },
  6298. // "path": "{+path}",
  6299. // "response": {
  6300. // "$ref": "WorkspaceProposal"
  6301. // }
  6302. // }
  6303. }
  6304. // method id "tagmanager.accounts.containers.workspaces.getStatus":
  6305. type AccountsContainersWorkspacesGetStatusCall struct {
  6306. s *Service
  6307. path string
  6308. urlParams_ gensupport.URLParams
  6309. ifNoneMatch_ string
  6310. ctx_ context.Context
  6311. header_ http.Header
  6312. }
  6313. // GetStatus: Finds conflicting and modified entities in the workspace.
  6314. func (r *AccountsContainersWorkspacesService) GetStatus(path string) *AccountsContainersWorkspacesGetStatusCall {
  6315. c := &AccountsContainersWorkspacesGetStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6316. c.path = path
  6317. return c
  6318. }
  6319. // Fields allows partial responses to be retrieved. See
  6320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6321. // for more information.
  6322. func (c *AccountsContainersWorkspacesGetStatusCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesGetStatusCall {
  6323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6324. return c
  6325. }
  6326. // IfNoneMatch sets the optional parameter which makes the operation
  6327. // fail if the object's ETag matches the given value. This is useful for
  6328. // getting updates only after the object has changed since the last
  6329. // request. Use googleapi.IsNotModified to check whether the response
  6330. // error from Do is the result of In-None-Match.
  6331. func (c *AccountsContainersWorkspacesGetStatusCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesGetStatusCall {
  6332. c.ifNoneMatch_ = entityTag
  6333. return c
  6334. }
  6335. // Context sets the context to be used in this call's Do method. Any
  6336. // pending HTTP request will be aborted if the provided context is
  6337. // canceled.
  6338. func (c *AccountsContainersWorkspacesGetStatusCall) Context(ctx context.Context) *AccountsContainersWorkspacesGetStatusCall {
  6339. c.ctx_ = ctx
  6340. return c
  6341. }
  6342. // Header returns an http.Header that can be modified by the caller to
  6343. // add HTTP headers to the request.
  6344. func (c *AccountsContainersWorkspacesGetStatusCall) Header() http.Header {
  6345. if c.header_ == nil {
  6346. c.header_ = make(http.Header)
  6347. }
  6348. return c.header_
  6349. }
  6350. func (c *AccountsContainersWorkspacesGetStatusCall) doRequest(alt string) (*http.Response, error) {
  6351. reqHeaders := make(http.Header)
  6352. for k, v := range c.header_ {
  6353. reqHeaders[k] = v
  6354. }
  6355. reqHeaders.Set("User-Agent", c.s.userAgent())
  6356. if c.ifNoneMatch_ != "" {
  6357. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6358. }
  6359. var body io.Reader = nil
  6360. c.urlParams_.Set("alt", alt)
  6361. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}/status")
  6362. urls += "?" + c.urlParams_.Encode()
  6363. req, _ := http.NewRequest("GET", urls, body)
  6364. req.Header = reqHeaders
  6365. googleapi.Expand(req.URL, map[string]string{
  6366. "path": c.path,
  6367. })
  6368. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6369. }
  6370. // Do executes the "tagmanager.accounts.containers.workspaces.getStatus" call.
  6371. // Exactly one of *GetWorkspaceStatusResponse or error will be non-nil.
  6372. // Any non-2xx status code is an error. Response headers are in either
  6373. // *GetWorkspaceStatusResponse.ServerResponse.Header or (if a response
  6374. // was returned at all) in error.(*googleapi.Error).Header. Use
  6375. // googleapi.IsNotModified to check whether the returned error was
  6376. // because http.StatusNotModified was returned.
  6377. func (c *AccountsContainersWorkspacesGetStatusCall) Do(opts ...googleapi.CallOption) (*GetWorkspaceStatusResponse, error) {
  6378. gensupport.SetOptions(c.urlParams_, opts...)
  6379. res, err := c.doRequest("json")
  6380. if res != nil && res.StatusCode == http.StatusNotModified {
  6381. if res.Body != nil {
  6382. res.Body.Close()
  6383. }
  6384. return nil, &googleapi.Error{
  6385. Code: res.StatusCode,
  6386. Header: res.Header,
  6387. }
  6388. }
  6389. if err != nil {
  6390. return nil, err
  6391. }
  6392. defer googleapi.CloseBody(res)
  6393. if err := googleapi.CheckResponse(res); err != nil {
  6394. return nil, err
  6395. }
  6396. ret := &GetWorkspaceStatusResponse{
  6397. ServerResponse: googleapi.ServerResponse{
  6398. Header: res.Header,
  6399. HTTPStatusCode: res.StatusCode,
  6400. },
  6401. }
  6402. target := &ret
  6403. if err := gensupport.DecodeResponse(target, res); err != nil {
  6404. return nil, err
  6405. }
  6406. return ret, nil
  6407. // {
  6408. // "description": "Finds conflicting and modified entities in the workspace.",
  6409. // "httpMethod": "GET",
  6410. // "id": "tagmanager.accounts.containers.workspaces.getStatus",
  6411. // "parameterOrder": [
  6412. // "path"
  6413. // ],
  6414. // "parameters": {
  6415. // "path": {
  6416. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6417. // "location": "path",
  6418. // "required": true,
  6419. // "type": "string"
  6420. // }
  6421. // },
  6422. // "path": "{+path}/status",
  6423. // "response": {
  6424. // "$ref": "GetWorkspaceStatusResponse"
  6425. // },
  6426. // "scopes": [
  6427. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6428. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6429. // ]
  6430. // }
  6431. }
  6432. // method id "tagmanager.accounts.containers.workspaces.list":
  6433. type AccountsContainersWorkspacesListCall struct {
  6434. s *Service
  6435. parent string
  6436. urlParams_ gensupport.URLParams
  6437. ifNoneMatch_ string
  6438. ctx_ context.Context
  6439. header_ http.Header
  6440. }
  6441. // List: Lists all Workspaces that belong to a GTM Container.
  6442. func (r *AccountsContainersWorkspacesService) List(parent string) *AccountsContainersWorkspacesListCall {
  6443. c := &AccountsContainersWorkspacesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6444. c.parent = parent
  6445. return c
  6446. }
  6447. // PageToken sets the optional parameter "pageToken": Continuation token
  6448. // for fetching the next page of results.
  6449. func (c *AccountsContainersWorkspacesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesListCall {
  6450. c.urlParams_.Set("pageToken", pageToken)
  6451. return c
  6452. }
  6453. // Fields allows partial responses to be retrieved. See
  6454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6455. // for more information.
  6456. func (c *AccountsContainersWorkspacesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesListCall {
  6457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6458. return c
  6459. }
  6460. // IfNoneMatch sets the optional parameter which makes the operation
  6461. // fail if the object's ETag matches the given value. This is useful for
  6462. // getting updates only after the object has changed since the last
  6463. // request. Use googleapi.IsNotModified to check whether the response
  6464. // error from Do is the result of In-None-Match.
  6465. func (c *AccountsContainersWorkspacesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesListCall {
  6466. c.ifNoneMatch_ = entityTag
  6467. return c
  6468. }
  6469. // Context sets the context to be used in this call's Do method. Any
  6470. // pending HTTP request will be aborted if the provided context is
  6471. // canceled.
  6472. func (c *AccountsContainersWorkspacesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesListCall {
  6473. c.ctx_ = ctx
  6474. return c
  6475. }
  6476. // Header returns an http.Header that can be modified by the caller to
  6477. // add HTTP headers to the request.
  6478. func (c *AccountsContainersWorkspacesListCall) Header() http.Header {
  6479. if c.header_ == nil {
  6480. c.header_ = make(http.Header)
  6481. }
  6482. return c.header_
  6483. }
  6484. func (c *AccountsContainersWorkspacesListCall) doRequest(alt string) (*http.Response, error) {
  6485. reqHeaders := make(http.Header)
  6486. for k, v := range c.header_ {
  6487. reqHeaders[k] = v
  6488. }
  6489. reqHeaders.Set("User-Agent", c.s.userAgent())
  6490. if c.ifNoneMatch_ != "" {
  6491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6492. }
  6493. var body io.Reader = nil
  6494. c.urlParams_.Set("alt", alt)
  6495. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/workspaces")
  6496. urls += "?" + c.urlParams_.Encode()
  6497. req, _ := http.NewRequest("GET", urls, body)
  6498. req.Header = reqHeaders
  6499. googleapi.Expand(req.URL, map[string]string{
  6500. "parent": c.parent,
  6501. })
  6502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6503. }
  6504. // Do executes the "tagmanager.accounts.containers.workspaces.list" call.
  6505. // Exactly one of *ListWorkspacesResponse or error will be non-nil. Any
  6506. // non-2xx status code is an error. Response headers are in either
  6507. // *ListWorkspacesResponse.ServerResponse.Header or (if a response was
  6508. // returned at all) in error.(*googleapi.Error).Header. Use
  6509. // googleapi.IsNotModified to check whether the returned error was
  6510. // because http.StatusNotModified was returned.
  6511. func (c *AccountsContainersWorkspacesListCall) Do(opts ...googleapi.CallOption) (*ListWorkspacesResponse, error) {
  6512. gensupport.SetOptions(c.urlParams_, opts...)
  6513. res, err := c.doRequest("json")
  6514. if res != nil && res.StatusCode == http.StatusNotModified {
  6515. if res.Body != nil {
  6516. res.Body.Close()
  6517. }
  6518. return nil, &googleapi.Error{
  6519. Code: res.StatusCode,
  6520. Header: res.Header,
  6521. }
  6522. }
  6523. if err != nil {
  6524. return nil, err
  6525. }
  6526. defer googleapi.CloseBody(res)
  6527. if err := googleapi.CheckResponse(res); err != nil {
  6528. return nil, err
  6529. }
  6530. ret := &ListWorkspacesResponse{
  6531. ServerResponse: googleapi.ServerResponse{
  6532. Header: res.Header,
  6533. HTTPStatusCode: res.StatusCode,
  6534. },
  6535. }
  6536. target := &ret
  6537. if err := gensupport.DecodeResponse(target, res); err != nil {
  6538. return nil, err
  6539. }
  6540. return ret, nil
  6541. // {
  6542. // "description": "Lists all Workspaces that belong to a GTM Container.",
  6543. // "httpMethod": "GET",
  6544. // "id": "tagmanager.accounts.containers.workspaces.list",
  6545. // "parameterOrder": [
  6546. // "parent"
  6547. // ],
  6548. // "parameters": {
  6549. // "pageToken": {
  6550. // "description": "Continuation token for fetching the next page of results.",
  6551. // "location": "query",
  6552. // "type": "string"
  6553. // },
  6554. // "parent": {
  6555. // "description": "GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id}",
  6556. // "location": "path",
  6557. // "required": true,
  6558. // "type": "string"
  6559. // }
  6560. // },
  6561. // "path": "{+parent}/workspaces",
  6562. // "response": {
  6563. // "$ref": "ListWorkspacesResponse"
  6564. // },
  6565. // "scopes": [
  6566. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  6567. // "https://www.googleapis.com/auth/tagmanager.readonly"
  6568. // ]
  6569. // }
  6570. }
  6571. // Pages invokes f for each page of results.
  6572. // A non-nil error returned from f will halt the iteration.
  6573. // The provided context supersedes any context provided to the Context method.
  6574. func (c *AccountsContainersWorkspacesListCall) Pages(ctx context.Context, f func(*ListWorkspacesResponse) error) error {
  6575. c.ctx_ = ctx
  6576. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6577. for {
  6578. x, err := c.Do()
  6579. if err != nil {
  6580. return err
  6581. }
  6582. if err := f(x); err != nil {
  6583. return err
  6584. }
  6585. if x.NextPageToken == "" {
  6586. return nil
  6587. }
  6588. c.PageToken(x.NextPageToken)
  6589. }
  6590. }
  6591. // method id "tagmanager.accounts.containers.workspaces.quick_preview":
  6592. type AccountsContainersWorkspacesQuickPreviewCall struct {
  6593. s *Service
  6594. path string
  6595. urlParams_ gensupport.URLParams
  6596. ctx_ context.Context
  6597. header_ http.Header
  6598. }
  6599. // QuickPreview: Quick previews a workspace by creating a fake container
  6600. // version from all entities in the provided workspace.
  6601. func (r *AccountsContainersWorkspacesService) QuickPreview(path string) *AccountsContainersWorkspacesQuickPreviewCall {
  6602. c := &AccountsContainersWorkspacesQuickPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6603. c.path = path
  6604. return c
  6605. }
  6606. // Fields allows partial responses to be retrieved. See
  6607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6608. // for more information.
  6609. func (c *AccountsContainersWorkspacesQuickPreviewCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesQuickPreviewCall {
  6610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6611. return c
  6612. }
  6613. // Context sets the context to be used in this call's Do method. Any
  6614. // pending HTTP request will be aborted if the provided context is
  6615. // canceled.
  6616. func (c *AccountsContainersWorkspacesQuickPreviewCall) Context(ctx context.Context) *AccountsContainersWorkspacesQuickPreviewCall {
  6617. c.ctx_ = ctx
  6618. return c
  6619. }
  6620. // Header returns an http.Header that can be modified by the caller to
  6621. // add HTTP headers to the request.
  6622. func (c *AccountsContainersWorkspacesQuickPreviewCall) Header() http.Header {
  6623. if c.header_ == nil {
  6624. c.header_ = make(http.Header)
  6625. }
  6626. return c.header_
  6627. }
  6628. func (c *AccountsContainersWorkspacesQuickPreviewCall) doRequest(alt string) (*http.Response, error) {
  6629. reqHeaders := make(http.Header)
  6630. for k, v := range c.header_ {
  6631. reqHeaders[k] = v
  6632. }
  6633. reqHeaders.Set("User-Agent", c.s.userAgent())
  6634. var body io.Reader = nil
  6635. c.urlParams_.Set("alt", alt)
  6636. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:quick_preview")
  6637. urls += "?" + c.urlParams_.Encode()
  6638. req, _ := http.NewRequest("POST", urls, body)
  6639. req.Header = reqHeaders
  6640. googleapi.Expand(req.URL, map[string]string{
  6641. "path": c.path,
  6642. })
  6643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6644. }
  6645. // Do executes the "tagmanager.accounts.containers.workspaces.quick_preview" call.
  6646. // Exactly one of *QuickPreviewResponse or error will be non-nil. Any
  6647. // non-2xx status code is an error. Response headers are in either
  6648. // *QuickPreviewResponse.ServerResponse.Header or (if a response was
  6649. // returned at all) in error.(*googleapi.Error).Header. Use
  6650. // googleapi.IsNotModified to check whether the returned error was
  6651. // because http.StatusNotModified was returned.
  6652. func (c *AccountsContainersWorkspacesQuickPreviewCall) Do(opts ...googleapi.CallOption) (*QuickPreviewResponse, error) {
  6653. gensupport.SetOptions(c.urlParams_, opts...)
  6654. res, err := c.doRequest("json")
  6655. if res != nil && res.StatusCode == http.StatusNotModified {
  6656. if res.Body != nil {
  6657. res.Body.Close()
  6658. }
  6659. return nil, &googleapi.Error{
  6660. Code: res.StatusCode,
  6661. Header: res.Header,
  6662. }
  6663. }
  6664. if err != nil {
  6665. return nil, err
  6666. }
  6667. defer googleapi.CloseBody(res)
  6668. if err := googleapi.CheckResponse(res); err != nil {
  6669. return nil, err
  6670. }
  6671. ret := &QuickPreviewResponse{
  6672. ServerResponse: googleapi.ServerResponse{
  6673. Header: res.Header,
  6674. HTTPStatusCode: res.StatusCode,
  6675. },
  6676. }
  6677. target := &ret
  6678. if err := gensupport.DecodeResponse(target, res); err != nil {
  6679. return nil, err
  6680. }
  6681. return ret, nil
  6682. // {
  6683. // "description": "Quick previews a workspace by creating a fake container version from all entities in the provided workspace.",
  6684. // "httpMethod": "POST",
  6685. // "id": "tagmanager.accounts.containers.workspaces.quick_preview",
  6686. // "parameterOrder": [
  6687. // "path"
  6688. // ],
  6689. // "parameters": {
  6690. // "path": {
  6691. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6692. // "location": "path",
  6693. // "required": true,
  6694. // "type": "string"
  6695. // }
  6696. // },
  6697. // "path": "{+path}:quick_preview",
  6698. // "response": {
  6699. // "$ref": "QuickPreviewResponse"
  6700. // },
  6701. // "scopes": [
  6702. // "https://www.googleapis.com/auth/tagmanager.edit.containerversions"
  6703. // ]
  6704. // }
  6705. }
  6706. // method id "tagmanager.accounts.containers.workspaces.resolve_conflict":
  6707. type AccountsContainersWorkspacesResolveConflictCall struct {
  6708. s *Service
  6709. path string
  6710. entity *Entity
  6711. urlParams_ gensupport.URLParams
  6712. ctx_ context.Context
  6713. header_ http.Header
  6714. }
  6715. // ResolveConflict: Resolves a merge conflict for a workspace entity by
  6716. // updating it to the resolved entity passed in the request.
  6717. func (r *AccountsContainersWorkspacesService) ResolveConflict(path string, entity *Entity) *AccountsContainersWorkspacesResolveConflictCall {
  6718. c := &AccountsContainersWorkspacesResolveConflictCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6719. c.path = path
  6720. c.entity = entity
  6721. return c
  6722. }
  6723. // Fingerprint sets the optional parameter "fingerprint": When provided,
  6724. // this fingerprint must match the fingerprint of the
  6725. // entity_in_workspace in the merge conflict.
  6726. func (c *AccountsContainersWorkspacesResolveConflictCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesResolveConflictCall {
  6727. c.urlParams_.Set("fingerprint", fingerprint)
  6728. return c
  6729. }
  6730. // Fields allows partial responses to be retrieved. See
  6731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6732. // for more information.
  6733. func (c *AccountsContainersWorkspacesResolveConflictCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesResolveConflictCall {
  6734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6735. return c
  6736. }
  6737. // Context sets the context to be used in this call's Do method. Any
  6738. // pending HTTP request will be aborted if the provided context is
  6739. // canceled.
  6740. func (c *AccountsContainersWorkspacesResolveConflictCall) Context(ctx context.Context) *AccountsContainersWorkspacesResolveConflictCall {
  6741. c.ctx_ = ctx
  6742. return c
  6743. }
  6744. // Header returns an http.Header that can be modified by the caller to
  6745. // add HTTP headers to the request.
  6746. func (c *AccountsContainersWorkspacesResolveConflictCall) Header() http.Header {
  6747. if c.header_ == nil {
  6748. c.header_ = make(http.Header)
  6749. }
  6750. return c.header_
  6751. }
  6752. func (c *AccountsContainersWorkspacesResolveConflictCall) doRequest(alt string) (*http.Response, error) {
  6753. reqHeaders := make(http.Header)
  6754. for k, v := range c.header_ {
  6755. reqHeaders[k] = v
  6756. }
  6757. reqHeaders.Set("User-Agent", c.s.userAgent())
  6758. var body io.Reader = nil
  6759. body, err := googleapi.WithoutDataWrapper.JSONReader(c.entity)
  6760. if err != nil {
  6761. return nil, err
  6762. }
  6763. reqHeaders.Set("Content-Type", "application/json")
  6764. c.urlParams_.Set("alt", alt)
  6765. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:resolve_conflict")
  6766. urls += "?" + c.urlParams_.Encode()
  6767. req, _ := http.NewRequest("POST", urls, body)
  6768. req.Header = reqHeaders
  6769. googleapi.Expand(req.URL, map[string]string{
  6770. "path": c.path,
  6771. })
  6772. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6773. }
  6774. // Do executes the "tagmanager.accounts.containers.workspaces.resolve_conflict" call.
  6775. func (c *AccountsContainersWorkspacesResolveConflictCall) Do(opts ...googleapi.CallOption) error {
  6776. gensupport.SetOptions(c.urlParams_, opts...)
  6777. res, err := c.doRequest("json")
  6778. if err != nil {
  6779. return err
  6780. }
  6781. defer googleapi.CloseBody(res)
  6782. if err := googleapi.CheckResponse(res); err != nil {
  6783. return err
  6784. }
  6785. return nil
  6786. // {
  6787. // "description": "Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request.",
  6788. // "httpMethod": "POST",
  6789. // "id": "tagmanager.accounts.containers.workspaces.resolve_conflict",
  6790. // "parameterOrder": [
  6791. // "path"
  6792. // ],
  6793. // "parameters": {
  6794. // "fingerprint": {
  6795. // "description": "When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict.",
  6796. // "location": "query",
  6797. // "type": "string"
  6798. // },
  6799. // "path": {
  6800. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6801. // "location": "path",
  6802. // "required": true,
  6803. // "type": "string"
  6804. // }
  6805. // },
  6806. // "path": "{+path}:resolve_conflict",
  6807. // "request": {
  6808. // "$ref": "Entity"
  6809. // },
  6810. // "scopes": [
  6811. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6812. // ]
  6813. // }
  6814. }
  6815. // method id "tagmanager.accounts.containers.workspaces.sync":
  6816. type AccountsContainersWorkspacesSyncCall struct {
  6817. s *Service
  6818. path string
  6819. urlParams_ gensupport.URLParams
  6820. ctx_ context.Context
  6821. header_ http.Header
  6822. }
  6823. // Sync: Syncs a workspace to the latest container version by updating
  6824. // all unmodified workspace entities and displaying conflicts for
  6825. // modified entities.
  6826. func (r *AccountsContainersWorkspacesService) Sync(path string) *AccountsContainersWorkspacesSyncCall {
  6827. c := &AccountsContainersWorkspacesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6828. c.path = path
  6829. return c
  6830. }
  6831. // Fields allows partial responses to be retrieved. See
  6832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6833. // for more information.
  6834. func (c *AccountsContainersWorkspacesSyncCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesSyncCall {
  6835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6836. return c
  6837. }
  6838. // Context sets the context to be used in this call's Do method. Any
  6839. // pending HTTP request will be aborted if the provided context is
  6840. // canceled.
  6841. func (c *AccountsContainersWorkspacesSyncCall) Context(ctx context.Context) *AccountsContainersWorkspacesSyncCall {
  6842. c.ctx_ = ctx
  6843. return c
  6844. }
  6845. // Header returns an http.Header that can be modified by the caller to
  6846. // add HTTP headers to the request.
  6847. func (c *AccountsContainersWorkspacesSyncCall) Header() http.Header {
  6848. if c.header_ == nil {
  6849. c.header_ = make(http.Header)
  6850. }
  6851. return c.header_
  6852. }
  6853. func (c *AccountsContainersWorkspacesSyncCall) doRequest(alt string) (*http.Response, error) {
  6854. reqHeaders := make(http.Header)
  6855. for k, v := range c.header_ {
  6856. reqHeaders[k] = v
  6857. }
  6858. reqHeaders.Set("User-Agent", c.s.userAgent())
  6859. var body io.Reader = nil
  6860. c.urlParams_.Set("alt", alt)
  6861. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:sync")
  6862. urls += "?" + c.urlParams_.Encode()
  6863. req, _ := http.NewRequest("POST", urls, body)
  6864. req.Header = reqHeaders
  6865. googleapi.Expand(req.URL, map[string]string{
  6866. "path": c.path,
  6867. })
  6868. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6869. }
  6870. // Do executes the "tagmanager.accounts.containers.workspaces.sync" call.
  6871. // Exactly one of *SyncWorkspaceResponse or error will be non-nil. Any
  6872. // non-2xx status code is an error. Response headers are in either
  6873. // *SyncWorkspaceResponse.ServerResponse.Header or (if a response was
  6874. // returned at all) in error.(*googleapi.Error).Header. Use
  6875. // googleapi.IsNotModified to check whether the returned error was
  6876. // because http.StatusNotModified was returned.
  6877. func (c *AccountsContainersWorkspacesSyncCall) Do(opts ...googleapi.CallOption) (*SyncWorkspaceResponse, error) {
  6878. gensupport.SetOptions(c.urlParams_, opts...)
  6879. res, err := c.doRequest("json")
  6880. if res != nil && res.StatusCode == http.StatusNotModified {
  6881. if res.Body != nil {
  6882. res.Body.Close()
  6883. }
  6884. return nil, &googleapi.Error{
  6885. Code: res.StatusCode,
  6886. Header: res.Header,
  6887. }
  6888. }
  6889. if err != nil {
  6890. return nil, err
  6891. }
  6892. defer googleapi.CloseBody(res)
  6893. if err := googleapi.CheckResponse(res); err != nil {
  6894. return nil, err
  6895. }
  6896. ret := &SyncWorkspaceResponse{
  6897. ServerResponse: googleapi.ServerResponse{
  6898. Header: res.Header,
  6899. HTTPStatusCode: res.StatusCode,
  6900. },
  6901. }
  6902. target := &ret
  6903. if err := gensupport.DecodeResponse(target, res); err != nil {
  6904. return nil, err
  6905. }
  6906. return ret, nil
  6907. // {
  6908. // "description": "Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities.",
  6909. // "httpMethod": "POST",
  6910. // "id": "tagmanager.accounts.containers.workspaces.sync",
  6911. // "parameterOrder": [
  6912. // "path"
  6913. // ],
  6914. // "parameters": {
  6915. // "path": {
  6916. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  6917. // "location": "path",
  6918. // "required": true,
  6919. // "type": "string"
  6920. // }
  6921. // },
  6922. // "path": "{+path}:sync",
  6923. // "response": {
  6924. // "$ref": "SyncWorkspaceResponse"
  6925. // },
  6926. // "scopes": [
  6927. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  6928. // ]
  6929. // }
  6930. }
  6931. // method id "tagmanager.accounts.containers.workspaces.update":
  6932. type AccountsContainersWorkspacesUpdateCall struct {
  6933. s *Service
  6934. path string
  6935. workspace *Workspace
  6936. urlParams_ gensupport.URLParams
  6937. ctx_ context.Context
  6938. header_ http.Header
  6939. }
  6940. // Update: Updates a Workspace.
  6941. func (r *AccountsContainersWorkspacesService) Update(path string, workspace *Workspace) *AccountsContainersWorkspacesUpdateCall {
  6942. c := &AccountsContainersWorkspacesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6943. c.path = path
  6944. c.workspace = workspace
  6945. return c
  6946. }
  6947. // Fingerprint sets the optional parameter "fingerprint": When provided,
  6948. // this fingerprint must match the fingerprint of the workspace in
  6949. // storage.
  6950. func (c *AccountsContainersWorkspacesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesUpdateCall {
  6951. c.urlParams_.Set("fingerprint", fingerprint)
  6952. return c
  6953. }
  6954. // Fields allows partial responses to be retrieved. See
  6955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6956. // for more information.
  6957. func (c *AccountsContainersWorkspacesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesUpdateCall {
  6958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6959. return c
  6960. }
  6961. // Context sets the context to be used in this call's Do method. Any
  6962. // pending HTTP request will be aborted if the provided context is
  6963. // canceled.
  6964. func (c *AccountsContainersWorkspacesUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesUpdateCall {
  6965. c.ctx_ = ctx
  6966. return c
  6967. }
  6968. // Header returns an http.Header that can be modified by the caller to
  6969. // add HTTP headers to the request.
  6970. func (c *AccountsContainersWorkspacesUpdateCall) Header() http.Header {
  6971. if c.header_ == nil {
  6972. c.header_ = make(http.Header)
  6973. }
  6974. return c.header_
  6975. }
  6976. func (c *AccountsContainersWorkspacesUpdateCall) doRequest(alt string) (*http.Response, error) {
  6977. reqHeaders := make(http.Header)
  6978. for k, v := range c.header_ {
  6979. reqHeaders[k] = v
  6980. }
  6981. reqHeaders.Set("User-Agent", c.s.userAgent())
  6982. var body io.Reader = nil
  6983. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workspace)
  6984. if err != nil {
  6985. return nil, err
  6986. }
  6987. reqHeaders.Set("Content-Type", "application/json")
  6988. c.urlParams_.Set("alt", alt)
  6989. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  6990. urls += "?" + c.urlParams_.Encode()
  6991. req, _ := http.NewRequest("PUT", urls, body)
  6992. req.Header = reqHeaders
  6993. googleapi.Expand(req.URL, map[string]string{
  6994. "path": c.path,
  6995. })
  6996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6997. }
  6998. // Do executes the "tagmanager.accounts.containers.workspaces.update" call.
  6999. // Exactly one of *Workspace or error will be non-nil. Any non-2xx
  7000. // status code is an error. Response headers are in either
  7001. // *Workspace.ServerResponse.Header or (if a response was returned at
  7002. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7003. // to check whether the returned error was because
  7004. // http.StatusNotModified was returned.
  7005. func (c *AccountsContainersWorkspacesUpdateCall) Do(opts ...googleapi.CallOption) (*Workspace, error) {
  7006. gensupport.SetOptions(c.urlParams_, opts...)
  7007. res, err := c.doRequest("json")
  7008. if res != nil && res.StatusCode == http.StatusNotModified {
  7009. if res.Body != nil {
  7010. res.Body.Close()
  7011. }
  7012. return nil, &googleapi.Error{
  7013. Code: res.StatusCode,
  7014. Header: res.Header,
  7015. }
  7016. }
  7017. if err != nil {
  7018. return nil, err
  7019. }
  7020. defer googleapi.CloseBody(res)
  7021. if err := googleapi.CheckResponse(res); err != nil {
  7022. return nil, err
  7023. }
  7024. ret := &Workspace{
  7025. ServerResponse: googleapi.ServerResponse{
  7026. Header: res.Header,
  7027. HTTPStatusCode: res.StatusCode,
  7028. },
  7029. }
  7030. target := &ret
  7031. if err := gensupport.DecodeResponse(target, res); err != nil {
  7032. return nil, err
  7033. }
  7034. return ret, nil
  7035. // {
  7036. // "description": "Updates a Workspace.",
  7037. // "httpMethod": "PUT",
  7038. // "id": "tagmanager.accounts.containers.workspaces.update",
  7039. // "parameterOrder": [
  7040. // "path"
  7041. // ],
  7042. // "parameters": {
  7043. // "fingerprint": {
  7044. // "description": "When provided, this fingerprint must match the fingerprint of the workspace in storage.",
  7045. // "location": "query",
  7046. // "type": "string"
  7047. // },
  7048. // "path": {
  7049. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  7050. // "location": "path",
  7051. // "required": true,
  7052. // "type": "string"
  7053. // }
  7054. // },
  7055. // "path": "{+path}",
  7056. // "request": {
  7057. // "$ref": "Workspace"
  7058. // },
  7059. // "response": {
  7060. // "$ref": "Workspace"
  7061. // },
  7062. // "scopes": [
  7063. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  7064. // ]
  7065. // }
  7066. }
  7067. // method id "tagmanager.accounts.containers.workspaces.updateProposal":
  7068. type AccountsContainersWorkspacesUpdateProposalCall struct {
  7069. s *Service
  7070. path string
  7071. updateworkspaceproposalrequest *UpdateWorkspaceProposalRequest
  7072. urlParams_ gensupport.URLParams
  7073. ctx_ context.Context
  7074. header_ http.Header
  7075. }
  7076. // UpdateProposal: Updates a GTM Workspace Proposal.
  7077. func (r *AccountsContainersWorkspacesService) UpdateProposal(path string, updateworkspaceproposalrequest *UpdateWorkspaceProposalRequest) *AccountsContainersWorkspacesUpdateProposalCall {
  7078. c := &AccountsContainersWorkspacesUpdateProposalCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7079. c.path = path
  7080. c.updateworkspaceproposalrequest = updateworkspaceproposalrequest
  7081. return c
  7082. }
  7083. // Fields allows partial responses to be retrieved. See
  7084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7085. // for more information.
  7086. func (c *AccountsContainersWorkspacesUpdateProposalCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesUpdateProposalCall {
  7087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7088. return c
  7089. }
  7090. // Context sets the context to be used in this call's Do method. Any
  7091. // pending HTTP request will be aborted if the provided context is
  7092. // canceled.
  7093. func (c *AccountsContainersWorkspacesUpdateProposalCall) Context(ctx context.Context) *AccountsContainersWorkspacesUpdateProposalCall {
  7094. c.ctx_ = ctx
  7095. return c
  7096. }
  7097. // Header returns an http.Header that can be modified by the caller to
  7098. // add HTTP headers to the request.
  7099. func (c *AccountsContainersWorkspacesUpdateProposalCall) Header() http.Header {
  7100. if c.header_ == nil {
  7101. c.header_ = make(http.Header)
  7102. }
  7103. return c.header_
  7104. }
  7105. func (c *AccountsContainersWorkspacesUpdateProposalCall) doRequest(alt string) (*http.Response, error) {
  7106. reqHeaders := make(http.Header)
  7107. for k, v := range c.header_ {
  7108. reqHeaders[k] = v
  7109. }
  7110. reqHeaders.Set("User-Agent", c.s.userAgent())
  7111. var body io.Reader = nil
  7112. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateworkspaceproposalrequest)
  7113. if err != nil {
  7114. return nil, err
  7115. }
  7116. reqHeaders.Set("Content-Type", "application/json")
  7117. c.urlParams_.Set("alt", alt)
  7118. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  7119. urls += "?" + c.urlParams_.Encode()
  7120. req, _ := http.NewRequest("PUT", urls, body)
  7121. req.Header = reqHeaders
  7122. googleapi.Expand(req.URL, map[string]string{
  7123. "path": c.path,
  7124. })
  7125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7126. }
  7127. // Do executes the "tagmanager.accounts.containers.workspaces.updateProposal" call.
  7128. // Exactly one of *WorkspaceProposal or error will be non-nil. Any
  7129. // non-2xx status code is an error. Response headers are in either
  7130. // *WorkspaceProposal.ServerResponse.Header or (if a response was
  7131. // returned at all) in error.(*googleapi.Error).Header. Use
  7132. // googleapi.IsNotModified to check whether the returned error was
  7133. // because http.StatusNotModified was returned.
  7134. func (c *AccountsContainersWorkspacesUpdateProposalCall) Do(opts ...googleapi.CallOption) (*WorkspaceProposal, error) {
  7135. gensupport.SetOptions(c.urlParams_, opts...)
  7136. res, err := c.doRequest("json")
  7137. if res != nil && res.StatusCode == http.StatusNotModified {
  7138. if res.Body != nil {
  7139. res.Body.Close()
  7140. }
  7141. return nil, &googleapi.Error{
  7142. Code: res.StatusCode,
  7143. Header: res.Header,
  7144. }
  7145. }
  7146. if err != nil {
  7147. return nil, err
  7148. }
  7149. defer googleapi.CloseBody(res)
  7150. if err := googleapi.CheckResponse(res); err != nil {
  7151. return nil, err
  7152. }
  7153. ret := &WorkspaceProposal{
  7154. ServerResponse: googleapi.ServerResponse{
  7155. Header: res.Header,
  7156. HTTPStatusCode: res.StatusCode,
  7157. },
  7158. }
  7159. target := &ret
  7160. if err := gensupport.DecodeResponse(target, res); err != nil {
  7161. return nil, err
  7162. }
  7163. return ret, nil
  7164. // {
  7165. // "description": "Updates a GTM Workspace Proposal.",
  7166. // "httpMethod": "PUT",
  7167. // "id": "tagmanager.accounts.containers.workspaces.updateProposal",
  7168. // "parameterOrder": [
  7169. // "path"
  7170. // ],
  7171. // "parameters": {
  7172. // "path": {
  7173. // "description": "GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal",
  7174. // "location": "path",
  7175. // "required": true,
  7176. // "type": "string"
  7177. // }
  7178. // },
  7179. // "path": "{+path}",
  7180. // "request": {
  7181. // "$ref": "UpdateWorkspaceProposalRequest"
  7182. // },
  7183. // "response": {
  7184. // "$ref": "WorkspaceProposal"
  7185. // }
  7186. // }
  7187. }
  7188. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.create":
  7189. type AccountsContainersWorkspacesBuiltInVariablesCreateCall struct {
  7190. s *Service
  7191. parent string
  7192. urlParams_ gensupport.URLParams
  7193. ctx_ context.Context
  7194. header_ http.Header
  7195. }
  7196. // Create: Creates one or more GTM Built-In Variables.
  7197. func (r *AccountsContainersWorkspacesBuiltInVariablesService) Create(parent string) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7198. c := &AccountsContainersWorkspacesBuiltInVariablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7199. c.parent = parent
  7200. return c
  7201. }
  7202. // Type sets the optional parameter "type": The types of built-in
  7203. // variables to enable.
  7204. //
  7205. // Possible values:
  7206. // "advertiserId"
  7207. // "advertisingTrackingEnabled"
  7208. // "ampBrowserLanguage"
  7209. // "ampCanonicalHost"
  7210. // "ampCanonicalPath"
  7211. // "ampCanonicalUrl"
  7212. // "ampClientId"
  7213. // "ampClientMaxScrollX"
  7214. // "ampClientMaxScrollY"
  7215. // "ampClientScreenHeight"
  7216. // "ampClientScreenWidth"
  7217. // "ampClientScrollX"
  7218. // "ampClientScrollY"
  7219. // "ampClientTimestamp"
  7220. // "ampClientTimezone"
  7221. // "ampGtmEvent"
  7222. // "ampPageDownloadTime"
  7223. // "ampPageLoadTime"
  7224. // "ampPageViewId"
  7225. // "ampReferrer"
  7226. // "ampTitle"
  7227. // "ampTotalEngagedTime"
  7228. // "appId"
  7229. // "appName"
  7230. // "appVersionCode"
  7231. // "appVersionName"
  7232. // "builtInVariableTypeUnspecified"
  7233. // "clickClasses"
  7234. // "clickElement"
  7235. // "clickId"
  7236. // "clickTarget"
  7237. // "clickText"
  7238. // "clickUrl"
  7239. // "containerId"
  7240. // "containerVersion"
  7241. // "debugMode"
  7242. // "deviceName"
  7243. // "elementVisibilityFirstTime"
  7244. // "elementVisibilityRatio"
  7245. // "elementVisibilityRecentTime"
  7246. // "elementVisibilityTime"
  7247. // "environmentName"
  7248. // "errorLine"
  7249. // "errorMessage"
  7250. // "errorUrl"
  7251. // "event"
  7252. // "eventName"
  7253. // "firebaseEventParameterCampaign"
  7254. // "firebaseEventParameterCampaignAclid"
  7255. // "firebaseEventParameterCampaignAnid"
  7256. // "firebaseEventParameterCampaignClickTimestamp"
  7257. // "firebaseEventParameterCampaignContent"
  7258. // "firebaseEventParameterCampaignCp1"
  7259. // "firebaseEventParameterCampaignGclid"
  7260. // "firebaseEventParameterCampaignSource"
  7261. // "firebaseEventParameterCampaignTerm"
  7262. // "firebaseEventParameterCurrency"
  7263. // "firebaseEventParameterDynamicLinkAcceptTime"
  7264. // "firebaseEventParameterDynamicLinkLinkid"
  7265. // "firebaseEventParameterNotificationMessageDeviceTime"
  7266. // "firebaseEventParameterNotificationMessageId"
  7267. // "firebaseEventParameterNotificationMessageName"
  7268. // "firebaseEventParameterNotificationMessageTime"
  7269. // "firebaseEventParameterNotificationTopic"
  7270. // "firebaseEventParameterPreviousAppVersion"
  7271. // "firebaseEventParameterPreviousOsVersion"
  7272. // "firebaseEventParameterPrice"
  7273. // "firebaseEventParameterProductId"
  7274. // "firebaseEventParameterQuantity"
  7275. // "firebaseEventParameterValue"
  7276. // "formClasses"
  7277. // "formElement"
  7278. // "formId"
  7279. // "formTarget"
  7280. // "formText"
  7281. // "formUrl"
  7282. // "historySource"
  7283. // "htmlId"
  7284. // "language"
  7285. // "newHistoryFragment"
  7286. // "newHistoryState"
  7287. // "oldHistoryFragment"
  7288. // "oldHistoryState"
  7289. // "osVersion"
  7290. // "pageHostname"
  7291. // "pagePath"
  7292. // "pageUrl"
  7293. // "platform"
  7294. // "randomNumber"
  7295. // "referrer"
  7296. // "resolution"
  7297. // "scrollDepthDirection"
  7298. // "scrollDepthThreshold"
  7299. // "scrollDepthUnits"
  7300. // "sdkVersion"
  7301. // "videoCurrentTime"
  7302. // "videoDuration"
  7303. // "videoPercent"
  7304. // "videoProvider"
  7305. // "videoStatus"
  7306. // "videoTitle"
  7307. // "videoUrl"
  7308. // "videoVisible"
  7309. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Type(type_ ...string) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7310. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  7311. return c
  7312. }
  7313. // Fields allows partial responses to be retrieved. See
  7314. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7315. // for more information.
  7316. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7317. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7318. return c
  7319. }
  7320. // Context sets the context to be used in this call's Do method. Any
  7321. // pending HTTP request will be aborted if the provided context is
  7322. // canceled.
  7323. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesCreateCall {
  7324. c.ctx_ = ctx
  7325. return c
  7326. }
  7327. // Header returns an http.Header that can be modified by the caller to
  7328. // add HTTP headers to the request.
  7329. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Header() http.Header {
  7330. if c.header_ == nil {
  7331. c.header_ = make(http.Header)
  7332. }
  7333. return c.header_
  7334. }
  7335. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) doRequest(alt string) (*http.Response, error) {
  7336. reqHeaders := make(http.Header)
  7337. for k, v := range c.header_ {
  7338. reqHeaders[k] = v
  7339. }
  7340. reqHeaders.Set("User-Agent", c.s.userAgent())
  7341. var body io.Reader = nil
  7342. c.urlParams_.Set("alt", alt)
  7343. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/built_in_variables")
  7344. urls += "?" + c.urlParams_.Encode()
  7345. req, _ := http.NewRequest("POST", urls, body)
  7346. req.Header = reqHeaders
  7347. googleapi.Expand(req.URL, map[string]string{
  7348. "parent": c.parent,
  7349. })
  7350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7351. }
  7352. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.create" call.
  7353. // Exactly one of *CreateBuiltInVariableResponse or error will be
  7354. // non-nil. Any non-2xx status code is an error. Response headers are in
  7355. // either *CreateBuiltInVariableResponse.ServerResponse.Header or (if a
  7356. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7357. // googleapi.IsNotModified to check whether the returned error was
  7358. // because http.StatusNotModified was returned.
  7359. func (c *AccountsContainersWorkspacesBuiltInVariablesCreateCall) Do(opts ...googleapi.CallOption) (*CreateBuiltInVariableResponse, error) {
  7360. gensupport.SetOptions(c.urlParams_, opts...)
  7361. res, err := c.doRequest("json")
  7362. if res != nil && res.StatusCode == http.StatusNotModified {
  7363. if res.Body != nil {
  7364. res.Body.Close()
  7365. }
  7366. return nil, &googleapi.Error{
  7367. Code: res.StatusCode,
  7368. Header: res.Header,
  7369. }
  7370. }
  7371. if err != nil {
  7372. return nil, err
  7373. }
  7374. defer googleapi.CloseBody(res)
  7375. if err := googleapi.CheckResponse(res); err != nil {
  7376. return nil, err
  7377. }
  7378. ret := &CreateBuiltInVariableResponse{
  7379. ServerResponse: googleapi.ServerResponse{
  7380. Header: res.Header,
  7381. HTTPStatusCode: res.StatusCode,
  7382. },
  7383. }
  7384. target := &ret
  7385. if err := gensupport.DecodeResponse(target, res); err != nil {
  7386. return nil, err
  7387. }
  7388. return ret, nil
  7389. // {
  7390. // "description": "Creates one or more GTM Built-In Variables.",
  7391. // "httpMethod": "POST",
  7392. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.create",
  7393. // "parameterOrder": [
  7394. // "parent"
  7395. // ],
  7396. // "parameters": {
  7397. // "parent": {
  7398. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  7399. // "location": "path",
  7400. // "required": true,
  7401. // "type": "string"
  7402. // },
  7403. // "type": {
  7404. // "description": "The types of built-in variables to enable.",
  7405. // "enum": [
  7406. // "advertiserId",
  7407. // "advertisingTrackingEnabled",
  7408. // "ampBrowserLanguage",
  7409. // "ampCanonicalHost",
  7410. // "ampCanonicalPath",
  7411. // "ampCanonicalUrl",
  7412. // "ampClientId",
  7413. // "ampClientMaxScrollX",
  7414. // "ampClientMaxScrollY",
  7415. // "ampClientScreenHeight",
  7416. // "ampClientScreenWidth",
  7417. // "ampClientScrollX",
  7418. // "ampClientScrollY",
  7419. // "ampClientTimestamp",
  7420. // "ampClientTimezone",
  7421. // "ampGtmEvent",
  7422. // "ampPageDownloadTime",
  7423. // "ampPageLoadTime",
  7424. // "ampPageViewId",
  7425. // "ampReferrer",
  7426. // "ampTitle",
  7427. // "ampTotalEngagedTime",
  7428. // "appId",
  7429. // "appName",
  7430. // "appVersionCode",
  7431. // "appVersionName",
  7432. // "builtInVariableTypeUnspecified",
  7433. // "clickClasses",
  7434. // "clickElement",
  7435. // "clickId",
  7436. // "clickTarget",
  7437. // "clickText",
  7438. // "clickUrl",
  7439. // "containerId",
  7440. // "containerVersion",
  7441. // "debugMode",
  7442. // "deviceName",
  7443. // "elementVisibilityFirstTime",
  7444. // "elementVisibilityRatio",
  7445. // "elementVisibilityRecentTime",
  7446. // "elementVisibilityTime",
  7447. // "environmentName",
  7448. // "errorLine",
  7449. // "errorMessage",
  7450. // "errorUrl",
  7451. // "event",
  7452. // "eventName",
  7453. // "firebaseEventParameterCampaign",
  7454. // "firebaseEventParameterCampaignAclid",
  7455. // "firebaseEventParameterCampaignAnid",
  7456. // "firebaseEventParameterCampaignClickTimestamp",
  7457. // "firebaseEventParameterCampaignContent",
  7458. // "firebaseEventParameterCampaignCp1",
  7459. // "firebaseEventParameterCampaignGclid",
  7460. // "firebaseEventParameterCampaignSource",
  7461. // "firebaseEventParameterCampaignTerm",
  7462. // "firebaseEventParameterCurrency",
  7463. // "firebaseEventParameterDynamicLinkAcceptTime",
  7464. // "firebaseEventParameterDynamicLinkLinkid",
  7465. // "firebaseEventParameterNotificationMessageDeviceTime",
  7466. // "firebaseEventParameterNotificationMessageId",
  7467. // "firebaseEventParameterNotificationMessageName",
  7468. // "firebaseEventParameterNotificationMessageTime",
  7469. // "firebaseEventParameterNotificationTopic",
  7470. // "firebaseEventParameterPreviousAppVersion",
  7471. // "firebaseEventParameterPreviousOsVersion",
  7472. // "firebaseEventParameterPrice",
  7473. // "firebaseEventParameterProductId",
  7474. // "firebaseEventParameterQuantity",
  7475. // "firebaseEventParameterValue",
  7476. // "formClasses",
  7477. // "formElement",
  7478. // "formId",
  7479. // "formTarget",
  7480. // "formText",
  7481. // "formUrl",
  7482. // "historySource",
  7483. // "htmlId",
  7484. // "language",
  7485. // "newHistoryFragment",
  7486. // "newHistoryState",
  7487. // "oldHistoryFragment",
  7488. // "oldHistoryState",
  7489. // "osVersion",
  7490. // "pageHostname",
  7491. // "pagePath",
  7492. // "pageUrl",
  7493. // "platform",
  7494. // "randomNumber",
  7495. // "referrer",
  7496. // "resolution",
  7497. // "scrollDepthDirection",
  7498. // "scrollDepthThreshold",
  7499. // "scrollDepthUnits",
  7500. // "sdkVersion",
  7501. // "videoCurrentTime",
  7502. // "videoDuration",
  7503. // "videoPercent",
  7504. // "videoProvider",
  7505. // "videoStatus",
  7506. // "videoTitle",
  7507. // "videoUrl",
  7508. // "videoVisible"
  7509. // ],
  7510. // "enumDescriptions": [
  7511. // "",
  7512. // "",
  7513. // "",
  7514. // "",
  7515. // "",
  7516. // "",
  7517. // "",
  7518. // "",
  7519. // "",
  7520. // "",
  7521. // "",
  7522. // "",
  7523. // "",
  7524. // "",
  7525. // "",
  7526. // "",
  7527. // "",
  7528. // "",
  7529. // "",
  7530. // "",
  7531. // "",
  7532. // "",
  7533. // "",
  7534. // "",
  7535. // "",
  7536. // "",
  7537. // "",
  7538. // "",
  7539. // "",
  7540. // "",
  7541. // "",
  7542. // "",
  7543. // "",
  7544. // "",
  7545. // "",
  7546. // "",
  7547. // "",
  7548. // "",
  7549. // "",
  7550. // "",
  7551. // "",
  7552. // "",
  7553. // "",
  7554. // "",
  7555. // "",
  7556. // "",
  7557. // "",
  7558. // "",
  7559. // "",
  7560. // "",
  7561. // "",
  7562. // "",
  7563. // "",
  7564. // "",
  7565. // "",
  7566. // "",
  7567. // "",
  7568. // "",
  7569. // "",
  7570. // "",
  7571. // "",
  7572. // "",
  7573. // "",
  7574. // "",
  7575. // "",
  7576. // "",
  7577. // "",
  7578. // "",
  7579. // "",
  7580. // "",
  7581. // "",
  7582. // "",
  7583. // "",
  7584. // "",
  7585. // "",
  7586. // "",
  7587. // "",
  7588. // "",
  7589. // "",
  7590. // "",
  7591. // "",
  7592. // "",
  7593. // "",
  7594. // "",
  7595. // "",
  7596. // "",
  7597. // "",
  7598. // "",
  7599. // "",
  7600. // "",
  7601. // "",
  7602. // "",
  7603. // "",
  7604. // "",
  7605. // "",
  7606. // "",
  7607. // "",
  7608. // "",
  7609. // "",
  7610. // "",
  7611. // "",
  7612. // "",
  7613. // ""
  7614. // ],
  7615. // "location": "query",
  7616. // "repeated": true,
  7617. // "type": "string"
  7618. // }
  7619. // },
  7620. // "path": "{+parent}/built_in_variables",
  7621. // "response": {
  7622. // "$ref": "CreateBuiltInVariableResponse"
  7623. // },
  7624. // "scopes": [
  7625. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  7626. // ]
  7627. // }
  7628. }
  7629. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.delete":
  7630. type AccountsContainersWorkspacesBuiltInVariablesDeleteCall struct {
  7631. s *Service
  7632. path string
  7633. urlParams_ gensupport.URLParams
  7634. ctx_ context.Context
  7635. header_ http.Header
  7636. }
  7637. // Delete: Deletes one or more GTM Built-In Variables.
  7638. func (r *AccountsContainersWorkspacesBuiltInVariablesService) Delete(path string) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7639. c := &AccountsContainersWorkspacesBuiltInVariablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7640. c.path = path
  7641. return c
  7642. }
  7643. // Type sets the optional parameter "type": The types of built-in
  7644. // variables to delete.
  7645. //
  7646. // Possible values:
  7647. // "advertiserId"
  7648. // "advertisingTrackingEnabled"
  7649. // "ampBrowserLanguage"
  7650. // "ampCanonicalHost"
  7651. // "ampCanonicalPath"
  7652. // "ampCanonicalUrl"
  7653. // "ampClientId"
  7654. // "ampClientMaxScrollX"
  7655. // "ampClientMaxScrollY"
  7656. // "ampClientScreenHeight"
  7657. // "ampClientScreenWidth"
  7658. // "ampClientScrollX"
  7659. // "ampClientScrollY"
  7660. // "ampClientTimestamp"
  7661. // "ampClientTimezone"
  7662. // "ampGtmEvent"
  7663. // "ampPageDownloadTime"
  7664. // "ampPageLoadTime"
  7665. // "ampPageViewId"
  7666. // "ampReferrer"
  7667. // "ampTitle"
  7668. // "ampTotalEngagedTime"
  7669. // "appId"
  7670. // "appName"
  7671. // "appVersionCode"
  7672. // "appVersionName"
  7673. // "builtInVariableTypeUnspecified"
  7674. // "clickClasses"
  7675. // "clickElement"
  7676. // "clickId"
  7677. // "clickTarget"
  7678. // "clickText"
  7679. // "clickUrl"
  7680. // "containerId"
  7681. // "containerVersion"
  7682. // "debugMode"
  7683. // "deviceName"
  7684. // "elementVisibilityFirstTime"
  7685. // "elementVisibilityRatio"
  7686. // "elementVisibilityRecentTime"
  7687. // "elementVisibilityTime"
  7688. // "environmentName"
  7689. // "errorLine"
  7690. // "errorMessage"
  7691. // "errorUrl"
  7692. // "event"
  7693. // "eventName"
  7694. // "firebaseEventParameterCampaign"
  7695. // "firebaseEventParameterCampaignAclid"
  7696. // "firebaseEventParameterCampaignAnid"
  7697. // "firebaseEventParameterCampaignClickTimestamp"
  7698. // "firebaseEventParameterCampaignContent"
  7699. // "firebaseEventParameterCampaignCp1"
  7700. // "firebaseEventParameterCampaignGclid"
  7701. // "firebaseEventParameterCampaignSource"
  7702. // "firebaseEventParameterCampaignTerm"
  7703. // "firebaseEventParameterCurrency"
  7704. // "firebaseEventParameterDynamicLinkAcceptTime"
  7705. // "firebaseEventParameterDynamicLinkLinkid"
  7706. // "firebaseEventParameterNotificationMessageDeviceTime"
  7707. // "firebaseEventParameterNotificationMessageId"
  7708. // "firebaseEventParameterNotificationMessageName"
  7709. // "firebaseEventParameterNotificationMessageTime"
  7710. // "firebaseEventParameterNotificationTopic"
  7711. // "firebaseEventParameterPreviousAppVersion"
  7712. // "firebaseEventParameterPreviousOsVersion"
  7713. // "firebaseEventParameterPrice"
  7714. // "firebaseEventParameterProductId"
  7715. // "firebaseEventParameterQuantity"
  7716. // "firebaseEventParameterValue"
  7717. // "formClasses"
  7718. // "formElement"
  7719. // "formId"
  7720. // "formTarget"
  7721. // "formText"
  7722. // "formUrl"
  7723. // "historySource"
  7724. // "htmlId"
  7725. // "language"
  7726. // "newHistoryFragment"
  7727. // "newHistoryState"
  7728. // "oldHistoryFragment"
  7729. // "oldHistoryState"
  7730. // "osVersion"
  7731. // "pageHostname"
  7732. // "pagePath"
  7733. // "pageUrl"
  7734. // "platform"
  7735. // "randomNumber"
  7736. // "referrer"
  7737. // "resolution"
  7738. // "scrollDepthDirection"
  7739. // "scrollDepthThreshold"
  7740. // "scrollDepthUnits"
  7741. // "sdkVersion"
  7742. // "videoCurrentTime"
  7743. // "videoDuration"
  7744. // "videoPercent"
  7745. // "videoProvider"
  7746. // "videoStatus"
  7747. // "videoTitle"
  7748. // "videoUrl"
  7749. // "videoVisible"
  7750. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Type(type_ ...string) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7751. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  7752. return c
  7753. }
  7754. // Fields allows partial responses to be retrieved. See
  7755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7756. // for more information.
  7757. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7759. return c
  7760. }
  7761. // Context sets the context to be used in this call's Do method. Any
  7762. // pending HTTP request will be aborted if the provided context is
  7763. // canceled.
  7764. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesDeleteCall {
  7765. c.ctx_ = ctx
  7766. return c
  7767. }
  7768. // Header returns an http.Header that can be modified by the caller to
  7769. // add HTTP headers to the request.
  7770. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Header() http.Header {
  7771. if c.header_ == nil {
  7772. c.header_ = make(http.Header)
  7773. }
  7774. return c.header_
  7775. }
  7776. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7777. reqHeaders := make(http.Header)
  7778. for k, v := range c.header_ {
  7779. reqHeaders[k] = v
  7780. }
  7781. reqHeaders.Set("User-Agent", c.s.userAgent())
  7782. var body io.Reader = nil
  7783. c.urlParams_.Set("alt", alt)
  7784. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  7785. urls += "?" + c.urlParams_.Encode()
  7786. req, _ := http.NewRequest("DELETE", urls, body)
  7787. req.Header = reqHeaders
  7788. googleapi.Expand(req.URL, map[string]string{
  7789. "path": c.path,
  7790. })
  7791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7792. }
  7793. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.delete" call.
  7794. func (c *AccountsContainersWorkspacesBuiltInVariablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  7795. gensupport.SetOptions(c.urlParams_, opts...)
  7796. res, err := c.doRequest("json")
  7797. if err != nil {
  7798. return err
  7799. }
  7800. defer googleapi.CloseBody(res)
  7801. if err := googleapi.CheckResponse(res); err != nil {
  7802. return err
  7803. }
  7804. return nil
  7805. // {
  7806. // "description": "Deletes one or more GTM Built-In Variables.",
  7807. // "httpMethod": "DELETE",
  7808. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.delete",
  7809. // "parameterOrder": [
  7810. // "path"
  7811. // ],
  7812. // "parameters": {
  7813. // "path": {
  7814. // "description": "GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables",
  7815. // "location": "path",
  7816. // "required": true,
  7817. // "type": "string"
  7818. // },
  7819. // "type": {
  7820. // "description": "The types of built-in variables to delete.",
  7821. // "enum": [
  7822. // "advertiserId",
  7823. // "advertisingTrackingEnabled",
  7824. // "ampBrowserLanguage",
  7825. // "ampCanonicalHost",
  7826. // "ampCanonicalPath",
  7827. // "ampCanonicalUrl",
  7828. // "ampClientId",
  7829. // "ampClientMaxScrollX",
  7830. // "ampClientMaxScrollY",
  7831. // "ampClientScreenHeight",
  7832. // "ampClientScreenWidth",
  7833. // "ampClientScrollX",
  7834. // "ampClientScrollY",
  7835. // "ampClientTimestamp",
  7836. // "ampClientTimezone",
  7837. // "ampGtmEvent",
  7838. // "ampPageDownloadTime",
  7839. // "ampPageLoadTime",
  7840. // "ampPageViewId",
  7841. // "ampReferrer",
  7842. // "ampTitle",
  7843. // "ampTotalEngagedTime",
  7844. // "appId",
  7845. // "appName",
  7846. // "appVersionCode",
  7847. // "appVersionName",
  7848. // "builtInVariableTypeUnspecified",
  7849. // "clickClasses",
  7850. // "clickElement",
  7851. // "clickId",
  7852. // "clickTarget",
  7853. // "clickText",
  7854. // "clickUrl",
  7855. // "containerId",
  7856. // "containerVersion",
  7857. // "debugMode",
  7858. // "deviceName",
  7859. // "elementVisibilityFirstTime",
  7860. // "elementVisibilityRatio",
  7861. // "elementVisibilityRecentTime",
  7862. // "elementVisibilityTime",
  7863. // "environmentName",
  7864. // "errorLine",
  7865. // "errorMessage",
  7866. // "errorUrl",
  7867. // "event",
  7868. // "eventName",
  7869. // "firebaseEventParameterCampaign",
  7870. // "firebaseEventParameterCampaignAclid",
  7871. // "firebaseEventParameterCampaignAnid",
  7872. // "firebaseEventParameterCampaignClickTimestamp",
  7873. // "firebaseEventParameterCampaignContent",
  7874. // "firebaseEventParameterCampaignCp1",
  7875. // "firebaseEventParameterCampaignGclid",
  7876. // "firebaseEventParameterCampaignSource",
  7877. // "firebaseEventParameterCampaignTerm",
  7878. // "firebaseEventParameterCurrency",
  7879. // "firebaseEventParameterDynamicLinkAcceptTime",
  7880. // "firebaseEventParameterDynamicLinkLinkid",
  7881. // "firebaseEventParameterNotificationMessageDeviceTime",
  7882. // "firebaseEventParameterNotificationMessageId",
  7883. // "firebaseEventParameterNotificationMessageName",
  7884. // "firebaseEventParameterNotificationMessageTime",
  7885. // "firebaseEventParameterNotificationTopic",
  7886. // "firebaseEventParameterPreviousAppVersion",
  7887. // "firebaseEventParameterPreviousOsVersion",
  7888. // "firebaseEventParameterPrice",
  7889. // "firebaseEventParameterProductId",
  7890. // "firebaseEventParameterQuantity",
  7891. // "firebaseEventParameterValue",
  7892. // "formClasses",
  7893. // "formElement",
  7894. // "formId",
  7895. // "formTarget",
  7896. // "formText",
  7897. // "formUrl",
  7898. // "historySource",
  7899. // "htmlId",
  7900. // "language",
  7901. // "newHistoryFragment",
  7902. // "newHistoryState",
  7903. // "oldHistoryFragment",
  7904. // "oldHistoryState",
  7905. // "osVersion",
  7906. // "pageHostname",
  7907. // "pagePath",
  7908. // "pageUrl",
  7909. // "platform",
  7910. // "randomNumber",
  7911. // "referrer",
  7912. // "resolution",
  7913. // "scrollDepthDirection",
  7914. // "scrollDepthThreshold",
  7915. // "scrollDepthUnits",
  7916. // "sdkVersion",
  7917. // "videoCurrentTime",
  7918. // "videoDuration",
  7919. // "videoPercent",
  7920. // "videoProvider",
  7921. // "videoStatus",
  7922. // "videoTitle",
  7923. // "videoUrl",
  7924. // "videoVisible"
  7925. // ],
  7926. // "enumDescriptions": [
  7927. // "",
  7928. // "",
  7929. // "",
  7930. // "",
  7931. // "",
  7932. // "",
  7933. // "",
  7934. // "",
  7935. // "",
  7936. // "",
  7937. // "",
  7938. // "",
  7939. // "",
  7940. // "",
  7941. // "",
  7942. // "",
  7943. // "",
  7944. // "",
  7945. // "",
  7946. // "",
  7947. // "",
  7948. // "",
  7949. // "",
  7950. // "",
  7951. // "",
  7952. // "",
  7953. // "",
  7954. // "",
  7955. // "",
  7956. // "",
  7957. // "",
  7958. // "",
  7959. // "",
  7960. // "",
  7961. // "",
  7962. // "",
  7963. // "",
  7964. // "",
  7965. // "",
  7966. // "",
  7967. // "",
  7968. // "",
  7969. // "",
  7970. // "",
  7971. // "",
  7972. // "",
  7973. // "",
  7974. // "",
  7975. // "",
  7976. // "",
  7977. // "",
  7978. // "",
  7979. // "",
  7980. // "",
  7981. // "",
  7982. // "",
  7983. // "",
  7984. // "",
  7985. // "",
  7986. // "",
  7987. // "",
  7988. // "",
  7989. // "",
  7990. // "",
  7991. // "",
  7992. // "",
  7993. // "",
  7994. // "",
  7995. // "",
  7996. // "",
  7997. // "",
  7998. // "",
  7999. // "",
  8000. // "",
  8001. // "",
  8002. // "",
  8003. // "",
  8004. // "",
  8005. // "",
  8006. // "",
  8007. // "",
  8008. // "",
  8009. // "",
  8010. // "",
  8011. // "",
  8012. // "",
  8013. // "",
  8014. // "",
  8015. // "",
  8016. // "",
  8017. // "",
  8018. // "",
  8019. // "",
  8020. // "",
  8021. // "",
  8022. // "",
  8023. // "",
  8024. // "",
  8025. // "",
  8026. // "",
  8027. // "",
  8028. // "",
  8029. // ""
  8030. // ],
  8031. // "location": "query",
  8032. // "repeated": true,
  8033. // "type": "string"
  8034. // }
  8035. // },
  8036. // "path": "{+path}",
  8037. // "scopes": [
  8038. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8039. // ]
  8040. // }
  8041. }
  8042. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.list":
  8043. type AccountsContainersWorkspacesBuiltInVariablesListCall struct {
  8044. s *Service
  8045. parent string
  8046. urlParams_ gensupport.URLParams
  8047. ifNoneMatch_ string
  8048. ctx_ context.Context
  8049. header_ http.Header
  8050. }
  8051. // List: Lists all the enabled Built-In Variables of a GTM Container.
  8052. func (r *AccountsContainersWorkspacesBuiltInVariablesService) List(parent string) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  8053. c := &AccountsContainersWorkspacesBuiltInVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8054. c.parent = parent
  8055. return c
  8056. }
  8057. // PageToken sets the optional parameter "pageToken": Continuation token
  8058. // for fetching the next page of results.
  8059. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  8060. c.urlParams_.Set("pageToken", pageToken)
  8061. return c
  8062. }
  8063. // Fields allows partial responses to be retrieved. See
  8064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8065. // for more information.
  8066. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  8067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8068. return c
  8069. }
  8070. // IfNoneMatch sets the optional parameter which makes the operation
  8071. // fail if the object's ETag matches the given value. This is useful for
  8072. // getting updates only after the object has changed since the last
  8073. // request. Use googleapi.IsNotModified to check whether the response
  8074. // error from Do is the result of In-None-Match.
  8075. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  8076. c.ifNoneMatch_ = entityTag
  8077. return c
  8078. }
  8079. // Context sets the context to be used in this call's Do method. Any
  8080. // pending HTTP request will be aborted if the provided context is
  8081. // canceled.
  8082. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesListCall {
  8083. c.ctx_ = ctx
  8084. return c
  8085. }
  8086. // Header returns an http.Header that can be modified by the caller to
  8087. // add HTTP headers to the request.
  8088. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Header() http.Header {
  8089. if c.header_ == nil {
  8090. c.header_ = make(http.Header)
  8091. }
  8092. return c.header_
  8093. }
  8094. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) doRequest(alt string) (*http.Response, error) {
  8095. reqHeaders := make(http.Header)
  8096. for k, v := range c.header_ {
  8097. reqHeaders[k] = v
  8098. }
  8099. reqHeaders.Set("User-Agent", c.s.userAgent())
  8100. if c.ifNoneMatch_ != "" {
  8101. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8102. }
  8103. var body io.Reader = nil
  8104. c.urlParams_.Set("alt", alt)
  8105. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/built_in_variables")
  8106. urls += "?" + c.urlParams_.Encode()
  8107. req, _ := http.NewRequest("GET", urls, body)
  8108. req.Header = reqHeaders
  8109. googleapi.Expand(req.URL, map[string]string{
  8110. "parent": c.parent,
  8111. })
  8112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8113. }
  8114. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.list" call.
  8115. // Exactly one of *ListEnabledBuiltInVariablesResponse or error will be
  8116. // non-nil. Any non-2xx status code is an error. Response headers are in
  8117. // either *ListEnabledBuiltInVariablesResponse.ServerResponse.Header or
  8118. // (if a response was returned at all) in
  8119. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8120. // whether the returned error was because http.StatusNotModified was
  8121. // returned.
  8122. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Do(opts ...googleapi.CallOption) (*ListEnabledBuiltInVariablesResponse, error) {
  8123. gensupport.SetOptions(c.urlParams_, opts...)
  8124. res, err := c.doRequest("json")
  8125. if res != nil && res.StatusCode == http.StatusNotModified {
  8126. if res.Body != nil {
  8127. res.Body.Close()
  8128. }
  8129. return nil, &googleapi.Error{
  8130. Code: res.StatusCode,
  8131. Header: res.Header,
  8132. }
  8133. }
  8134. if err != nil {
  8135. return nil, err
  8136. }
  8137. defer googleapi.CloseBody(res)
  8138. if err := googleapi.CheckResponse(res); err != nil {
  8139. return nil, err
  8140. }
  8141. ret := &ListEnabledBuiltInVariablesResponse{
  8142. ServerResponse: googleapi.ServerResponse{
  8143. Header: res.Header,
  8144. HTTPStatusCode: res.StatusCode,
  8145. },
  8146. }
  8147. target := &ret
  8148. if err := gensupport.DecodeResponse(target, res); err != nil {
  8149. return nil, err
  8150. }
  8151. return ret, nil
  8152. // {
  8153. // "description": "Lists all the enabled Built-In Variables of a GTM Container.",
  8154. // "httpMethod": "GET",
  8155. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.list",
  8156. // "parameterOrder": [
  8157. // "parent"
  8158. // ],
  8159. // "parameters": {
  8160. // "pageToken": {
  8161. // "description": "Continuation token for fetching the next page of results.",
  8162. // "location": "query",
  8163. // "type": "string"
  8164. // },
  8165. // "parent": {
  8166. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  8167. // "location": "path",
  8168. // "required": true,
  8169. // "type": "string"
  8170. // }
  8171. // },
  8172. // "path": "{+parent}/built_in_variables",
  8173. // "response": {
  8174. // "$ref": "ListEnabledBuiltInVariablesResponse"
  8175. // },
  8176. // "scopes": [
  8177. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  8178. // "https://www.googleapis.com/auth/tagmanager.readonly"
  8179. // ]
  8180. // }
  8181. }
  8182. // Pages invokes f for each page of results.
  8183. // A non-nil error returned from f will halt the iteration.
  8184. // The provided context supersedes any context provided to the Context method.
  8185. func (c *AccountsContainersWorkspacesBuiltInVariablesListCall) Pages(ctx context.Context, f func(*ListEnabledBuiltInVariablesResponse) error) error {
  8186. c.ctx_ = ctx
  8187. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8188. for {
  8189. x, err := c.Do()
  8190. if err != nil {
  8191. return err
  8192. }
  8193. if err := f(x); err != nil {
  8194. return err
  8195. }
  8196. if x.NextPageToken == "" {
  8197. return nil
  8198. }
  8199. c.PageToken(x.NextPageToken)
  8200. }
  8201. }
  8202. // method id "tagmanager.accounts.containers.workspaces.built_in_variables.revert":
  8203. type AccountsContainersWorkspacesBuiltInVariablesRevertCall struct {
  8204. s *Service
  8205. path string
  8206. urlParams_ gensupport.URLParams
  8207. ctx_ context.Context
  8208. header_ http.Header
  8209. }
  8210. // Revert: Reverts changes to a GTM Built-In Variables in a GTM
  8211. // Workspace.
  8212. func (r *AccountsContainersWorkspacesBuiltInVariablesService) Revert(path string) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8213. c := &AccountsContainersWorkspacesBuiltInVariablesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8214. c.path = path
  8215. return c
  8216. }
  8217. // Type sets the optional parameter "type": The type of built-in
  8218. // variable to revert.
  8219. //
  8220. // Possible values:
  8221. // "advertiserId"
  8222. // "advertisingTrackingEnabled"
  8223. // "ampBrowserLanguage"
  8224. // "ampCanonicalHost"
  8225. // "ampCanonicalPath"
  8226. // "ampCanonicalUrl"
  8227. // "ampClientId"
  8228. // "ampClientMaxScrollX"
  8229. // "ampClientMaxScrollY"
  8230. // "ampClientScreenHeight"
  8231. // "ampClientScreenWidth"
  8232. // "ampClientScrollX"
  8233. // "ampClientScrollY"
  8234. // "ampClientTimestamp"
  8235. // "ampClientTimezone"
  8236. // "ampGtmEvent"
  8237. // "ampPageDownloadTime"
  8238. // "ampPageLoadTime"
  8239. // "ampPageViewId"
  8240. // "ampReferrer"
  8241. // "ampTitle"
  8242. // "ampTotalEngagedTime"
  8243. // "appId"
  8244. // "appName"
  8245. // "appVersionCode"
  8246. // "appVersionName"
  8247. // "builtInVariableTypeUnspecified"
  8248. // "clickClasses"
  8249. // "clickElement"
  8250. // "clickId"
  8251. // "clickTarget"
  8252. // "clickText"
  8253. // "clickUrl"
  8254. // "containerId"
  8255. // "containerVersion"
  8256. // "debugMode"
  8257. // "deviceName"
  8258. // "elementVisibilityFirstTime"
  8259. // "elementVisibilityRatio"
  8260. // "elementVisibilityRecentTime"
  8261. // "elementVisibilityTime"
  8262. // "environmentName"
  8263. // "errorLine"
  8264. // "errorMessage"
  8265. // "errorUrl"
  8266. // "event"
  8267. // "eventName"
  8268. // "firebaseEventParameterCampaign"
  8269. // "firebaseEventParameterCampaignAclid"
  8270. // "firebaseEventParameterCampaignAnid"
  8271. // "firebaseEventParameterCampaignClickTimestamp"
  8272. // "firebaseEventParameterCampaignContent"
  8273. // "firebaseEventParameterCampaignCp1"
  8274. // "firebaseEventParameterCampaignGclid"
  8275. // "firebaseEventParameterCampaignSource"
  8276. // "firebaseEventParameterCampaignTerm"
  8277. // "firebaseEventParameterCurrency"
  8278. // "firebaseEventParameterDynamicLinkAcceptTime"
  8279. // "firebaseEventParameterDynamicLinkLinkid"
  8280. // "firebaseEventParameterNotificationMessageDeviceTime"
  8281. // "firebaseEventParameterNotificationMessageId"
  8282. // "firebaseEventParameterNotificationMessageName"
  8283. // "firebaseEventParameterNotificationMessageTime"
  8284. // "firebaseEventParameterNotificationTopic"
  8285. // "firebaseEventParameterPreviousAppVersion"
  8286. // "firebaseEventParameterPreviousOsVersion"
  8287. // "firebaseEventParameterPrice"
  8288. // "firebaseEventParameterProductId"
  8289. // "firebaseEventParameterQuantity"
  8290. // "firebaseEventParameterValue"
  8291. // "formClasses"
  8292. // "formElement"
  8293. // "formId"
  8294. // "formTarget"
  8295. // "formText"
  8296. // "formUrl"
  8297. // "historySource"
  8298. // "htmlId"
  8299. // "language"
  8300. // "newHistoryFragment"
  8301. // "newHistoryState"
  8302. // "oldHistoryFragment"
  8303. // "oldHistoryState"
  8304. // "osVersion"
  8305. // "pageHostname"
  8306. // "pagePath"
  8307. // "pageUrl"
  8308. // "platform"
  8309. // "randomNumber"
  8310. // "referrer"
  8311. // "resolution"
  8312. // "scrollDepthDirection"
  8313. // "scrollDepthThreshold"
  8314. // "scrollDepthUnits"
  8315. // "sdkVersion"
  8316. // "videoCurrentTime"
  8317. // "videoDuration"
  8318. // "videoPercent"
  8319. // "videoProvider"
  8320. // "videoStatus"
  8321. // "videoTitle"
  8322. // "videoUrl"
  8323. // "videoVisible"
  8324. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Type(type_ string) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8325. c.urlParams_.Set("type", type_)
  8326. return c
  8327. }
  8328. // Fields allows partial responses to be retrieved. See
  8329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8330. // for more information.
  8331. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8333. return c
  8334. }
  8335. // Context sets the context to be used in this call's Do method. Any
  8336. // pending HTTP request will be aborted if the provided context is
  8337. // canceled.
  8338. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesBuiltInVariablesRevertCall {
  8339. c.ctx_ = ctx
  8340. return c
  8341. }
  8342. // Header returns an http.Header that can be modified by the caller to
  8343. // add HTTP headers to the request.
  8344. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Header() http.Header {
  8345. if c.header_ == nil {
  8346. c.header_ = make(http.Header)
  8347. }
  8348. return c.header_
  8349. }
  8350. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) doRequest(alt string) (*http.Response, error) {
  8351. reqHeaders := make(http.Header)
  8352. for k, v := range c.header_ {
  8353. reqHeaders[k] = v
  8354. }
  8355. reqHeaders.Set("User-Agent", c.s.userAgent())
  8356. var body io.Reader = nil
  8357. c.urlParams_.Set("alt", alt)
  8358. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}/built_in_variables:revert")
  8359. urls += "?" + c.urlParams_.Encode()
  8360. req, _ := http.NewRequest("POST", urls, body)
  8361. req.Header = reqHeaders
  8362. googleapi.Expand(req.URL, map[string]string{
  8363. "path": c.path,
  8364. })
  8365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8366. }
  8367. // Do executes the "tagmanager.accounts.containers.workspaces.built_in_variables.revert" call.
  8368. // Exactly one of *RevertBuiltInVariableResponse or error will be
  8369. // non-nil. Any non-2xx status code is an error. Response headers are in
  8370. // either *RevertBuiltInVariableResponse.ServerResponse.Header or (if a
  8371. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8372. // googleapi.IsNotModified to check whether the returned error was
  8373. // because http.StatusNotModified was returned.
  8374. func (c *AccountsContainersWorkspacesBuiltInVariablesRevertCall) Do(opts ...googleapi.CallOption) (*RevertBuiltInVariableResponse, error) {
  8375. gensupport.SetOptions(c.urlParams_, opts...)
  8376. res, err := c.doRequest("json")
  8377. if res != nil && res.StatusCode == http.StatusNotModified {
  8378. if res.Body != nil {
  8379. res.Body.Close()
  8380. }
  8381. return nil, &googleapi.Error{
  8382. Code: res.StatusCode,
  8383. Header: res.Header,
  8384. }
  8385. }
  8386. if err != nil {
  8387. return nil, err
  8388. }
  8389. defer googleapi.CloseBody(res)
  8390. if err := googleapi.CheckResponse(res); err != nil {
  8391. return nil, err
  8392. }
  8393. ret := &RevertBuiltInVariableResponse{
  8394. ServerResponse: googleapi.ServerResponse{
  8395. Header: res.Header,
  8396. HTTPStatusCode: res.StatusCode,
  8397. },
  8398. }
  8399. target := &ret
  8400. if err := gensupport.DecodeResponse(target, res); err != nil {
  8401. return nil, err
  8402. }
  8403. return ret, nil
  8404. // {
  8405. // "description": "Reverts changes to a GTM Built-In Variables in a GTM Workspace.",
  8406. // "httpMethod": "POST",
  8407. // "id": "tagmanager.accounts.containers.workspaces.built_in_variables.revert",
  8408. // "parameterOrder": [
  8409. // "path"
  8410. // ],
  8411. // "parameters": {
  8412. // "path": {
  8413. // "description": "GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables",
  8414. // "location": "path",
  8415. // "required": true,
  8416. // "type": "string"
  8417. // },
  8418. // "type": {
  8419. // "description": "The type of built-in variable to revert.",
  8420. // "enum": [
  8421. // "advertiserId",
  8422. // "advertisingTrackingEnabled",
  8423. // "ampBrowserLanguage",
  8424. // "ampCanonicalHost",
  8425. // "ampCanonicalPath",
  8426. // "ampCanonicalUrl",
  8427. // "ampClientId",
  8428. // "ampClientMaxScrollX",
  8429. // "ampClientMaxScrollY",
  8430. // "ampClientScreenHeight",
  8431. // "ampClientScreenWidth",
  8432. // "ampClientScrollX",
  8433. // "ampClientScrollY",
  8434. // "ampClientTimestamp",
  8435. // "ampClientTimezone",
  8436. // "ampGtmEvent",
  8437. // "ampPageDownloadTime",
  8438. // "ampPageLoadTime",
  8439. // "ampPageViewId",
  8440. // "ampReferrer",
  8441. // "ampTitle",
  8442. // "ampTotalEngagedTime",
  8443. // "appId",
  8444. // "appName",
  8445. // "appVersionCode",
  8446. // "appVersionName",
  8447. // "builtInVariableTypeUnspecified",
  8448. // "clickClasses",
  8449. // "clickElement",
  8450. // "clickId",
  8451. // "clickTarget",
  8452. // "clickText",
  8453. // "clickUrl",
  8454. // "containerId",
  8455. // "containerVersion",
  8456. // "debugMode",
  8457. // "deviceName",
  8458. // "elementVisibilityFirstTime",
  8459. // "elementVisibilityRatio",
  8460. // "elementVisibilityRecentTime",
  8461. // "elementVisibilityTime",
  8462. // "environmentName",
  8463. // "errorLine",
  8464. // "errorMessage",
  8465. // "errorUrl",
  8466. // "event",
  8467. // "eventName",
  8468. // "firebaseEventParameterCampaign",
  8469. // "firebaseEventParameterCampaignAclid",
  8470. // "firebaseEventParameterCampaignAnid",
  8471. // "firebaseEventParameterCampaignClickTimestamp",
  8472. // "firebaseEventParameterCampaignContent",
  8473. // "firebaseEventParameterCampaignCp1",
  8474. // "firebaseEventParameterCampaignGclid",
  8475. // "firebaseEventParameterCampaignSource",
  8476. // "firebaseEventParameterCampaignTerm",
  8477. // "firebaseEventParameterCurrency",
  8478. // "firebaseEventParameterDynamicLinkAcceptTime",
  8479. // "firebaseEventParameterDynamicLinkLinkid",
  8480. // "firebaseEventParameterNotificationMessageDeviceTime",
  8481. // "firebaseEventParameterNotificationMessageId",
  8482. // "firebaseEventParameterNotificationMessageName",
  8483. // "firebaseEventParameterNotificationMessageTime",
  8484. // "firebaseEventParameterNotificationTopic",
  8485. // "firebaseEventParameterPreviousAppVersion",
  8486. // "firebaseEventParameterPreviousOsVersion",
  8487. // "firebaseEventParameterPrice",
  8488. // "firebaseEventParameterProductId",
  8489. // "firebaseEventParameterQuantity",
  8490. // "firebaseEventParameterValue",
  8491. // "formClasses",
  8492. // "formElement",
  8493. // "formId",
  8494. // "formTarget",
  8495. // "formText",
  8496. // "formUrl",
  8497. // "historySource",
  8498. // "htmlId",
  8499. // "language",
  8500. // "newHistoryFragment",
  8501. // "newHistoryState",
  8502. // "oldHistoryFragment",
  8503. // "oldHistoryState",
  8504. // "osVersion",
  8505. // "pageHostname",
  8506. // "pagePath",
  8507. // "pageUrl",
  8508. // "platform",
  8509. // "randomNumber",
  8510. // "referrer",
  8511. // "resolution",
  8512. // "scrollDepthDirection",
  8513. // "scrollDepthThreshold",
  8514. // "scrollDepthUnits",
  8515. // "sdkVersion",
  8516. // "videoCurrentTime",
  8517. // "videoDuration",
  8518. // "videoPercent",
  8519. // "videoProvider",
  8520. // "videoStatus",
  8521. // "videoTitle",
  8522. // "videoUrl",
  8523. // "videoVisible"
  8524. // ],
  8525. // "enumDescriptions": [
  8526. // "",
  8527. // "",
  8528. // "",
  8529. // "",
  8530. // "",
  8531. // "",
  8532. // "",
  8533. // "",
  8534. // "",
  8535. // "",
  8536. // "",
  8537. // "",
  8538. // "",
  8539. // "",
  8540. // "",
  8541. // "",
  8542. // "",
  8543. // "",
  8544. // "",
  8545. // "",
  8546. // "",
  8547. // "",
  8548. // "",
  8549. // "",
  8550. // "",
  8551. // "",
  8552. // "",
  8553. // "",
  8554. // "",
  8555. // "",
  8556. // "",
  8557. // "",
  8558. // "",
  8559. // "",
  8560. // "",
  8561. // "",
  8562. // "",
  8563. // "",
  8564. // "",
  8565. // "",
  8566. // "",
  8567. // "",
  8568. // "",
  8569. // "",
  8570. // "",
  8571. // "",
  8572. // "",
  8573. // "",
  8574. // "",
  8575. // "",
  8576. // "",
  8577. // "",
  8578. // "",
  8579. // "",
  8580. // "",
  8581. // "",
  8582. // "",
  8583. // "",
  8584. // "",
  8585. // "",
  8586. // "",
  8587. // "",
  8588. // "",
  8589. // "",
  8590. // "",
  8591. // "",
  8592. // "",
  8593. // "",
  8594. // "",
  8595. // "",
  8596. // "",
  8597. // "",
  8598. // "",
  8599. // "",
  8600. // "",
  8601. // "",
  8602. // "",
  8603. // "",
  8604. // "",
  8605. // "",
  8606. // "",
  8607. // "",
  8608. // "",
  8609. // "",
  8610. // "",
  8611. // "",
  8612. // "",
  8613. // "",
  8614. // "",
  8615. // "",
  8616. // "",
  8617. // "",
  8618. // "",
  8619. // "",
  8620. // "",
  8621. // "",
  8622. // "",
  8623. // "",
  8624. // "",
  8625. // "",
  8626. // "",
  8627. // "",
  8628. // ""
  8629. // ],
  8630. // "location": "query",
  8631. // "type": "string"
  8632. // }
  8633. // },
  8634. // "path": "{+path}/built_in_variables:revert",
  8635. // "response": {
  8636. // "$ref": "RevertBuiltInVariableResponse"
  8637. // },
  8638. // "scopes": [
  8639. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8640. // ]
  8641. // }
  8642. }
  8643. // method id "tagmanager.accounts.containers.workspaces.folders.create":
  8644. type AccountsContainersWorkspacesFoldersCreateCall struct {
  8645. s *Service
  8646. parent string
  8647. folder *Folder
  8648. urlParams_ gensupport.URLParams
  8649. ctx_ context.Context
  8650. header_ http.Header
  8651. }
  8652. // Create: Creates a GTM Folder.
  8653. func (r *AccountsContainersWorkspacesFoldersService) Create(parent string, folder *Folder) *AccountsContainersWorkspacesFoldersCreateCall {
  8654. c := &AccountsContainersWorkspacesFoldersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8655. c.parent = parent
  8656. c.folder = folder
  8657. return c
  8658. }
  8659. // Fields allows partial responses to be retrieved. See
  8660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8661. // for more information.
  8662. func (c *AccountsContainersWorkspacesFoldersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersCreateCall {
  8663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8664. return c
  8665. }
  8666. // Context sets the context to be used in this call's Do method. Any
  8667. // pending HTTP request will be aborted if the provided context is
  8668. // canceled.
  8669. func (c *AccountsContainersWorkspacesFoldersCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersCreateCall {
  8670. c.ctx_ = ctx
  8671. return c
  8672. }
  8673. // Header returns an http.Header that can be modified by the caller to
  8674. // add HTTP headers to the request.
  8675. func (c *AccountsContainersWorkspacesFoldersCreateCall) Header() http.Header {
  8676. if c.header_ == nil {
  8677. c.header_ = make(http.Header)
  8678. }
  8679. return c.header_
  8680. }
  8681. func (c *AccountsContainersWorkspacesFoldersCreateCall) doRequest(alt string) (*http.Response, error) {
  8682. reqHeaders := make(http.Header)
  8683. for k, v := range c.header_ {
  8684. reqHeaders[k] = v
  8685. }
  8686. reqHeaders.Set("User-Agent", c.s.userAgent())
  8687. var body io.Reader = nil
  8688. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  8689. if err != nil {
  8690. return nil, err
  8691. }
  8692. reqHeaders.Set("Content-Type", "application/json")
  8693. c.urlParams_.Set("alt", alt)
  8694. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/folders")
  8695. urls += "?" + c.urlParams_.Encode()
  8696. req, _ := http.NewRequest("POST", urls, body)
  8697. req.Header = reqHeaders
  8698. googleapi.Expand(req.URL, map[string]string{
  8699. "parent": c.parent,
  8700. })
  8701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8702. }
  8703. // Do executes the "tagmanager.accounts.containers.workspaces.folders.create" call.
  8704. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  8705. // code is an error. Response headers are in either
  8706. // *Folder.ServerResponse.Header or (if a response was returned at all)
  8707. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8708. // check whether the returned error was because http.StatusNotModified
  8709. // was returned.
  8710. func (c *AccountsContainersWorkspacesFoldersCreateCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  8711. gensupport.SetOptions(c.urlParams_, opts...)
  8712. res, err := c.doRequest("json")
  8713. if res != nil && res.StatusCode == http.StatusNotModified {
  8714. if res.Body != nil {
  8715. res.Body.Close()
  8716. }
  8717. return nil, &googleapi.Error{
  8718. Code: res.StatusCode,
  8719. Header: res.Header,
  8720. }
  8721. }
  8722. if err != nil {
  8723. return nil, err
  8724. }
  8725. defer googleapi.CloseBody(res)
  8726. if err := googleapi.CheckResponse(res); err != nil {
  8727. return nil, err
  8728. }
  8729. ret := &Folder{
  8730. ServerResponse: googleapi.ServerResponse{
  8731. Header: res.Header,
  8732. HTTPStatusCode: res.StatusCode,
  8733. },
  8734. }
  8735. target := &ret
  8736. if err := gensupport.DecodeResponse(target, res); err != nil {
  8737. return nil, err
  8738. }
  8739. return ret, nil
  8740. // {
  8741. // "description": "Creates a GTM Folder.",
  8742. // "httpMethod": "POST",
  8743. // "id": "tagmanager.accounts.containers.workspaces.folders.create",
  8744. // "parameterOrder": [
  8745. // "parent"
  8746. // ],
  8747. // "parameters": {
  8748. // "parent": {
  8749. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  8750. // "location": "path",
  8751. // "required": true,
  8752. // "type": "string"
  8753. // }
  8754. // },
  8755. // "path": "{+parent}/folders",
  8756. // "request": {
  8757. // "$ref": "Folder"
  8758. // },
  8759. // "response": {
  8760. // "$ref": "Folder"
  8761. // },
  8762. // "scopes": [
  8763. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8764. // ]
  8765. // }
  8766. }
  8767. // method id "tagmanager.accounts.containers.workspaces.folders.delete":
  8768. type AccountsContainersWorkspacesFoldersDeleteCall struct {
  8769. s *Service
  8770. path string
  8771. urlParams_ gensupport.URLParams
  8772. ctx_ context.Context
  8773. header_ http.Header
  8774. }
  8775. // Delete: Deletes a GTM Folder.
  8776. func (r *AccountsContainersWorkspacesFoldersService) Delete(path string) *AccountsContainersWorkspacesFoldersDeleteCall {
  8777. c := &AccountsContainersWorkspacesFoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8778. c.path = path
  8779. return c
  8780. }
  8781. // Fields allows partial responses to be retrieved. See
  8782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8783. // for more information.
  8784. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersDeleteCall {
  8785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8786. return c
  8787. }
  8788. // Context sets the context to be used in this call's Do method. Any
  8789. // pending HTTP request will be aborted if the provided context is
  8790. // canceled.
  8791. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersDeleteCall {
  8792. c.ctx_ = ctx
  8793. return c
  8794. }
  8795. // Header returns an http.Header that can be modified by the caller to
  8796. // add HTTP headers to the request.
  8797. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Header() http.Header {
  8798. if c.header_ == nil {
  8799. c.header_ = make(http.Header)
  8800. }
  8801. return c.header_
  8802. }
  8803. func (c *AccountsContainersWorkspacesFoldersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8804. reqHeaders := make(http.Header)
  8805. for k, v := range c.header_ {
  8806. reqHeaders[k] = v
  8807. }
  8808. reqHeaders.Set("User-Agent", c.s.userAgent())
  8809. var body io.Reader = nil
  8810. c.urlParams_.Set("alt", alt)
  8811. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  8812. urls += "?" + c.urlParams_.Encode()
  8813. req, _ := http.NewRequest("DELETE", urls, body)
  8814. req.Header = reqHeaders
  8815. googleapi.Expand(req.URL, map[string]string{
  8816. "path": c.path,
  8817. })
  8818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8819. }
  8820. // Do executes the "tagmanager.accounts.containers.workspaces.folders.delete" call.
  8821. func (c *AccountsContainersWorkspacesFoldersDeleteCall) Do(opts ...googleapi.CallOption) error {
  8822. gensupport.SetOptions(c.urlParams_, opts...)
  8823. res, err := c.doRequest("json")
  8824. if err != nil {
  8825. return err
  8826. }
  8827. defer googleapi.CloseBody(res)
  8828. if err := googleapi.CheckResponse(res); err != nil {
  8829. return err
  8830. }
  8831. return nil
  8832. // {
  8833. // "description": "Deletes a GTM Folder.",
  8834. // "httpMethod": "DELETE",
  8835. // "id": "tagmanager.accounts.containers.workspaces.folders.delete",
  8836. // "parameterOrder": [
  8837. // "path"
  8838. // ],
  8839. // "parameters": {
  8840. // "path": {
  8841. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  8842. // "location": "path",
  8843. // "required": true,
  8844. // "type": "string"
  8845. // }
  8846. // },
  8847. // "path": "{+path}",
  8848. // "scopes": [
  8849. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  8850. // ]
  8851. // }
  8852. }
  8853. // method id "tagmanager.accounts.containers.workspaces.folders.entities":
  8854. type AccountsContainersWorkspacesFoldersEntitiesCall struct {
  8855. s *Service
  8856. path string
  8857. urlParams_ gensupport.URLParams
  8858. ctx_ context.Context
  8859. header_ http.Header
  8860. }
  8861. // Entities: List all entities in a GTM Folder.
  8862. func (r *AccountsContainersWorkspacesFoldersService) Entities(path string) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8863. c := &AccountsContainersWorkspacesFoldersEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8864. c.path = path
  8865. return c
  8866. }
  8867. // PageToken sets the optional parameter "pageToken": Continuation token
  8868. // for fetching the next page of results.
  8869. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) PageToken(pageToken string) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8870. c.urlParams_.Set("pageToken", pageToken)
  8871. return c
  8872. }
  8873. // Fields allows partial responses to be retrieved. See
  8874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8875. // for more information.
  8876. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8878. return c
  8879. }
  8880. // Context sets the context to be used in this call's Do method. Any
  8881. // pending HTTP request will be aborted if the provided context is
  8882. // canceled.
  8883. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersEntitiesCall {
  8884. c.ctx_ = ctx
  8885. return c
  8886. }
  8887. // Header returns an http.Header that can be modified by the caller to
  8888. // add HTTP headers to the request.
  8889. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Header() http.Header {
  8890. if c.header_ == nil {
  8891. c.header_ = make(http.Header)
  8892. }
  8893. return c.header_
  8894. }
  8895. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) doRequest(alt string) (*http.Response, error) {
  8896. reqHeaders := make(http.Header)
  8897. for k, v := range c.header_ {
  8898. reqHeaders[k] = v
  8899. }
  8900. reqHeaders.Set("User-Agent", c.s.userAgent())
  8901. var body io.Reader = nil
  8902. c.urlParams_.Set("alt", alt)
  8903. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:entities")
  8904. urls += "?" + c.urlParams_.Encode()
  8905. req, _ := http.NewRequest("POST", urls, body)
  8906. req.Header = reqHeaders
  8907. googleapi.Expand(req.URL, map[string]string{
  8908. "path": c.path,
  8909. })
  8910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8911. }
  8912. // Do executes the "tagmanager.accounts.containers.workspaces.folders.entities" call.
  8913. // Exactly one of *FolderEntities or error will be non-nil. Any non-2xx
  8914. // status code is an error. Response headers are in either
  8915. // *FolderEntities.ServerResponse.Header or (if a response was returned
  8916. // at all) in error.(*googleapi.Error).Header. Use
  8917. // googleapi.IsNotModified to check whether the returned error was
  8918. // because http.StatusNotModified was returned.
  8919. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Do(opts ...googleapi.CallOption) (*FolderEntities, error) {
  8920. gensupport.SetOptions(c.urlParams_, opts...)
  8921. res, err := c.doRequest("json")
  8922. if res != nil && res.StatusCode == http.StatusNotModified {
  8923. if res.Body != nil {
  8924. res.Body.Close()
  8925. }
  8926. return nil, &googleapi.Error{
  8927. Code: res.StatusCode,
  8928. Header: res.Header,
  8929. }
  8930. }
  8931. if err != nil {
  8932. return nil, err
  8933. }
  8934. defer googleapi.CloseBody(res)
  8935. if err := googleapi.CheckResponse(res); err != nil {
  8936. return nil, err
  8937. }
  8938. ret := &FolderEntities{
  8939. ServerResponse: googleapi.ServerResponse{
  8940. Header: res.Header,
  8941. HTTPStatusCode: res.StatusCode,
  8942. },
  8943. }
  8944. target := &ret
  8945. if err := gensupport.DecodeResponse(target, res); err != nil {
  8946. return nil, err
  8947. }
  8948. return ret, nil
  8949. // {
  8950. // "description": "List all entities in a GTM Folder.",
  8951. // "httpMethod": "POST",
  8952. // "id": "tagmanager.accounts.containers.workspaces.folders.entities",
  8953. // "parameterOrder": [
  8954. // "path"
  8955. // ],
  8956. // "parameters": {
  8957. // "pageToken": {
  8958. // "description": "Continuation token for fetching the next page of results.",
  8959. // "location": "query",
  8960. // "type": "string"
  8961. // },
  8962. // "path": {
  8963. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  8964. // "location": "path",
  8965. // "required": true,
  8966. // "type": "string"
  8967. // }
  8968. // },
  8969. // "path": "{+path}:entities",
  8970. // "response": {
  8971. // "$ref": "FolderEntities"
  8972. // },
  8973. // "scopes": [
  8974. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  8975. // "https://www.googleapis.com/auth/tagmanager.readonly"
  8976. // ]
  8977. // }
  8978. }
  8979. // Pages invokes f for each page of results.
  8980. // A non-nil error returned from f will halt the iteration.
  8981. // The provided context supersedes any context provided to the Context method.
  8982. func (c *AccountsContainersWorkspacesFoldersEntitiesCall) Pages(ctx context.Context, f func(*FolderEntities) error) error {
  8983. c.ctx_ = ctx
  8984. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8985. for {
  8986. x, err := c.Do()
  8987. if err != nil {
  8988. return err
  8989. }
  8990. if err := f(x); err != nil {
  8991. return err
  8992. }
  8993. if x.NextPageToken == "" {
  8994. return nil
  8995. }
  8996. c.PageToken(x.NextPageToken)
  8997. }
  8998. }
  8999. // method id "tagmanager.accounts.containers.workspaces.folders.get":
  9000. type AccountsContainersWorkspacesFoldersGetCall struct {
  9001. s *Service
  9002. path string
  9003. urlParams_ gensupport.URLParams
  9004. ifNoneMatch_ string
  9005. ctx_ context.Context
  9006. header_ http.Header
  9007. }
  9008. // Get: Gets a GTM Folder.
  9009. func (r *AccountsContainersWorkspacesFoldersService) Get(path string) *AccountsContainersWorkspacesFoldersGetCall {
  9010. c := &AccountsContainersWorkspacesFoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9011. c.path = path
  9012. return c
  9013. }
  9014. // Fields allows partial responses to be retrieved. See
  9015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9016. // for more information.
  9017. func (c *AccountsContainersWorkspacesFoldersGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersGetCall {
  9018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9019. return c
  9020. }
  9021. // IfNoneMatch sets the optional parameter which makes the operation
  9022. // fail if the object's ETag matches the given value. This is useful for
  9023. // getting updates only after the object has changed since the last
  9024. // request. Use googleapi.IsNotModified to check whether the response
  9025. // error from Do is the result of In-None-Match.
  9026. func (c *AccountsContainersWorkspacesFoldersGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesFoldersGetCall {
  9027. c.ifNoneMatch_ = entityTag
  9028. return c
  9029. }
  9030. // Context sets the context to be used in this call's Do method. Any
  9031. // pending HTTP request will be aborted if the provided context is
  9032. // canceled.
  9033. func (c *AccountsContainersWorkspacesFoldersGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersGetCall {
  9034. c.ctx_ = ctx
  9035. return c
  9036. }
  9037. // Header returns an http.Header that can be modified by the caller to
  9038. // add HTTP headers to the request.
  9039. func (c *AccountsContainersWorkspacesFoldersGetCall) Header() http.Header {
  9040. if c.header_ == nil {
  9041. c.header_ = make(http.Header)
  9042. }
  9043. return c.header_
  9044. }
  9045. func (c *AccountsContainersWorkspacesFoldersGetCall) doRequest(alt string) (*http.Response, error) {
  9046. reqHeaders := make(http.Header)
  9047. for k, v := range c.header_ {
  9048. reqHeaders[k] = v
  9049. }
  9050. reqHeaders.Set("User-Agent", c.s.userAgent())
  9051. if c.ifNoneMatch_ != "" {
  9052. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9053. }
  9054. var body io.Reader = nil
  9055. c.urlParams_.Set("alt", alt)
  9056. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  9057. urls += "?" + c.urlParams_.Encode()
  9058. req, _ := http.NewRequest("GET", urls, body)
  9059. req.Header = reqHeaders
  9060. googleapi.Expand(req.URL, map[string]string{
  9061. "path": c.path,
  9062. })
  9063. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9064. }
  9065. // Do executes the "tagmanager.accounts.containers.workspaces.folders.get" call.
  9066. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  9067. // code is an error. Response headers are in either
  9068. // *Folder.ServerResponse.Header or (if a response was returned at all)
  9069. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9070. // check whether the returned error was because http.StatusNotModified
  9071. // was returned.
  9072. func (c *AccountsContainersWorkspacesFoldersGetCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  9073. gensupport.SetOptions(c.urlParams_, opts...)
  9074. res, err := c.doRequest("json")
  9075. if res != nil && res.StatusCode == http.StatusNotModified {
  9076. if res.Body != nil {
  9077. res.Body.Close()
  9078. }
  9079. return nil, &googleapi.Error{
  9080. Code: res.StatusCode,
  9081. Header: res.Header,
  9082. }
  9083. }
  9084. if err != nil {
  9085. return nil, err
  9086. }
  9087. defer googleapi.CloseBody(res)
  9088. if err := googleapi.CheckResponse(res); err != nil {
  9089. return nil, err
  9090. }
  9091. ret := &Folder{
  9092. ServerResponse: googleapi.ServerResponse{
  9093. Header: res.Header,
  9094. HTTPStatusCode: res.StatusCode,
  9095. },
  9096. }
  9097. target := &ret
  9098. if err := gensupport.DecodeResponse(target, res); err != nil {
  9099. return nil, err
  9100. }
  9101. return ret, nil
  9102. // {
  9103. // "description": "Gets a GTM Folder.",
  9104. // "httpMethod": "GET",
  9105. // "id": "tagmanager.accounts.containers.workspaces.folders.get",
  9106. // "parameterOrder": [
  9107. // "path"
  9108. // ],
  9109. // "parameters": {
  9110. // "path": {
  9111. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9112. // "location": "path",
  9113. // "required": true,
  9114. // "type": "string"
  9115. // }
  9116. // },
  9117. // "path": "{+path}",
  9118. // "response": {
  9119. // "$ref": "Folder"
  9120. // },
  9121. // "scopes": [
  9122. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  9123. // "https://www.googleapis.com/auth/tagmanager.readonly"
  9124. // ]
  9125. // }
  9126. }
  9127. // method id "tagmanager.accounts.containers.workspaces.folders.list":
  9128. type AccountsContainersWorkspacesFoldersListCall struct {
  9129. s *Service
  9130. parent string
  9131. urlParams_ gensupport.URLParams
  9132. ifNoneMatch_ string
  9133. ctx_ context.Context
  9134. header_ http.Header
  9135. }
  9136. // List: Lists all GTM Folders of a Container.
  9137. func (r *AccountsContainersWorkspacesFoldersService) List(parent string) *AccountsContainersWorkspacesFoldersListCall {
  9138. c := &AccountsContainersWorkspacesFoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9139. c.parent = parent
  9140. return c
  9141. }
  9142. // PageToken sets the optional parameter "pageToken": Continuation token
  9143. // for fetching the next page of results.
  9144. func (c *AccountsContainersWorkspacesFoldersListCall) PageToken(pageToken string) *AccountsContainersWorkspacesFoldersListCall {
  9145. c.urlParams_.Set("pageToken", pageToken)
  9146. return c
  9147. }
  9148. // Fields allows partial responses to be retrieved. See
  9149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9150. // for more information.
  9151. func (c *AccountsContainersWorkspacesFoldersListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersListCall {
  9152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9153. return c
  9154. }
  9155. // IfNoneMatch sets the optional parameter which makes the operation
  9156. // fail if the object's ETag matches the given value. This is useful for
  9157. // getting updates only after the object has changed since the last
  9158. // request. Use googleapi.IsNotModified to check whether the response
  9159. // error from Do is the result of In-None-Match.
  9160. func (c *AccountsContainersWorkspacesFoldersListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesFoldersListCall {
  9161. c.ifNoneMatch_ = entityTag
  9162. return c
  9163. }
  9164. // Context sets the context to be used in this call's Do method. Any
  9165. // pending HTTP request will be aborted if the provided context is
  9166. // canceled.
  9167. func (c *AccountsContainersWorkspacesFoldersListCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersListCall {
  9168. c.ctx_ = ctx
  9169. return c
  9170. }
  9171. // Header returns an http.Header that can be modified by the caller to
  9172. // add HTTP headers to the request.
  9173. func (c *AccountsContainersWorkspacesFoldersListCall) Header() http.Header {
  9174. if c.header_ == nil {
  9175. c.header_ = make(http.Header)
  9176. }
  9177. return c.header_
  9178. }
  9179. func (c *AccountsContainersWorkspacesFoldersListCall) doRequest(alt string) (*http.Response, error) {
  9180. reqHeaders := make(http.Header)
  9181. for k, v := range c.header_ {
  9182. reqHeaders[k] = v
  9183. }
  9184. reqHeaders.Set("User-Agent", c.s.userAgent())
  9185. if c.ifNoneMatch_ != "" {
  9186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9187. }
  9188. var body io.Reader = nil
  9189. c.urlParams_.Set("alt", alt)
  9190. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/folders")
  9191. urls += "?" + c.urlParams_.Encode()
  9192. req, _ := http.NewRequest("GET", urls, body)
  9193. req.Header = reqHeaders
  9194. googleapi.Expand(req.URL, map[string]string{
  9195. "parent": c.parent,
  9196. })
  9197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9198. }
  9199. // Do executes the "tagmanager.accounts.containers.workspaces.folders.list" call.
  9200. // Exactly one of *ListFoldersResponse or error will be non-nil. Any
  9201. // non-2xx status code is an error. Response headers are in either
  9202. // *ListFoldersResponse.ServerResponse.Header or (if a response was
  9203. // returned at all) in error.(*googleapi.Error).Header. Use
  9204. // googleapi.IsNotModified to check whether the returned error was
  9205. // because http.StatusNotModified was returned.
  9206. func (c *AccountsContainersWorkspacesFoldersListCall) Do(opts ...googleapi.CallOption) (*ListFoldersResponse, error) {
  9207. gensupport.SetOptions(c.urlParams_, opts...)
  9208. res, err := c.doRequest("json")
  9209. if res != nil && res.StatusCode == http.StatusNotModified {
  9210. if res.Body != nil {
  9211. res.Body.Close()
  9212. }
  9213. return nil, &googleapi.Error{
  9214. Code: res.StatusCode,
  9215. Header: res.Header,
  9216. }
  9217. }
  9218. if err != nil {
  9219. return nil, err
  9220. }
  9221. defer googleapi.CloseBody(res)
  9222. if err := googleapi.CheckResponse(res); err != nil {
  9223. return nil, err
  9224. }
  9225. ret := &ListFoldersResponse{
  9226. ServerResponse: googleapi.ServerResponse{
  9227. Header: res.Header,
  9228. HTTPStatusCode: res.StatusCode,
  9229. },
  9230. }
  9231. target := &ret
  9232. if err := gensupport.DecodeResponse(target, res); err != nil {
  9233. return nil, err
  9234. }
  9235. return ret, nil
  9236. // {
  9237. // "description": "Lists all GTM Folders of a Container.",
  9238. // "httpMethod": "GET",
  9239. // "id": "tagmanager.accounts.containers.workspaces.folders.list",
  9240. // "parameterOrder": [
  9241. // "parent"
  9242. // ],
  9243. // "parameters": {
  9244. // "pageToken": {
  9245. // "description": "Continuation token for fetching the next page of results.",
  9246. // "location": "query",
  9247. // "type": "string"
  9248. // },
  9249. // "parent": {
  9250. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  9251. // "location": "path",
  9252. // "required": true,
  9253. // "type": "string"
  9254. // }
  9255. // },
  9256. // "path": "{+parent}/folders",
  9257. // "response": {
  9258. // "$ref": "ListFoldersResponse"
  9259. // },
  9260. // "scopes": [
  9261. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  9262. // "https://www.googleapis.com/auth/tagmanager.readonly"
  9263. // ]
  9264. // }
  9265. }
  9266. // Pages invokes f for each page of results.
  9267. // A non-nil error returned from f will halt the iteration.
  9268. // The provided context supersedes any context provided to the Context method.
  9269. func (c *AccountsContainersWorkspacesFoldersListCall) Pages(ctx context.Context, f func(*ListFoldersResponse) error) error {
  9270. c.ctx_ = ctx
  9271. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9272. for {
  9273. x, err := c.Do()
  9274. if err != nil {
  9275. return err
  9276. }
  9277. if err := f(x); err != nil {
  9278. return err
  9279. }
  9280. if x.NextPageToken == "" {
  9281. return nil
  9282. }
  9283. c.PageToken(x.NextPageToken)
  9284. }
  9285. }
  9286. // method id "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder":
  9287. type AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall struct {
  9288. s *Service
  9289. path string
  9290. folder *Folder
  9291. urlParams_ gensupport.URLParams
  9292. ctx_ context.Context
  9293. header_ http.Header
  9294. }
  9295. // MoveEntitiesToFolder: Moves entities to a GTM Folder.
  9296. func (r *AccountsContainersWorkspacesFoldersService) MoveEntitiesToFolder(path string, folder *Folder) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9297. c := &AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9298. c.path = path
  9299. c.folder = folder
  9300. return c
  9301. }
  9302. // TagId sets the optional parameter "tagId": The tags to be moved to
  9303. // the folder.
  9304. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) TagId(tagId ...string) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9305. c.urlParams_.SetMulti("tagId", append([]string{}, tagId...))
  9306. return c
  9307. }
  9308. // TriggerId sets the optional parameter "triggerId": The triggers to be
  9309. // moved to the folder.
  9310. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) TriggerId(triggerId ...string) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9311. c.urlParams_.SetMulti("triggerId", append([]string{}, triggerId...))
  9312. return c
  9313. }
  9314. // VariableId sets the optional parameter "variableId": The variables to
  9315. // be moved to the folder.
  9316. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) VariableId(variableId ...string) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9317. c.urlParams_.SetMulti("variableId", append([]string{}, variableId...))
  9318. return c
  9319. }
  9320. // Fields allows partial responses to be retrieved. See
  9321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9322. // for more information.
  9323. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9325. return c
  9326. }
  9327. // Context sets the context to be used in this call's Do method. Any
  9328. // pending HTTP request will be aborted if the provided context is
  9329. // canceled.
  9330. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall {
  9331. c.ctx_ = ctx
  9332. return c
  9333. }
  9334. // Header returns an http.Header that can be modified by the caller to
  9335. // add HTTP headers to the request.
  9336. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Header() http.Header {
  9337. if c.header_ == nil {
  9338. c.header_ = make(http.Header)
  9339. }
  9340. return c.header_
  9341. }
  9342. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) doRequest(alt string) (*http.Response, error) {
  9343. reqHeaders := make(http.Header)
  9344. for k, v := range c.header_ {
  9345. reqHeaders[k] = v
  9346. }
  9347. reqHeaders.Set("User-Agent", c.s.userAgent())
  9348. var body io.Reader = nil
  9349. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  9350. if err != nil {
  9351. return nil, err
  9352. }
  9353. reqHeaders.Set("Content-Type", "application/json")
  9354. c.urlParams_.Set("alt", alt)
  9355. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:move_entities_to_folder")
  9356. urls += "?" + c.urlParams_.Encode()
  9357. req, _ := http.NewRequest("POST", urls, body)
  9358. req.Header = reqHeaders
  9359. googleapi.Expand(req.URL, map[string]string{
  9360. "path": c.path,
  9361. })
  9362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9363. }
  9364. // Do executes the "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder" call.
  9365. func (c *AccountsContainersWorkspacesFoldersMoveEntitiesToFolderCall) Do(opts ...googleapi.CallOption) error {
  9366. gensupport.SetOptions(c.urlParams_, opts...)
  9367. res, err := c.doRequest("json")
  9368. if err != nil {
  9369. return err
  9370. }
  9371. defer googleapi.CloseBody(res)
  9372. if err := googleapi.CheckResponse(res); err != nil {
  9373. return err
  9374. }
  9375. return nil
  9376. // {
  9377. // "description": "Moves entities to a GTM Folder.",
  9378. // "httpMethod": "POST",
  9379. // "id": "tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder",
  9380. // "parameterOrder": [
  9381. // "path"
  9382. // ],
  9383. // "parameters": {
  9384. // "path": {
  9385. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9386. // "location": "path",
  9387. // "required": true,
  9388. // "type": "string"
  9389. // },
  9390. // "tagId": {
  9391. // "description": "The tags to be moved to the folder.",
  9392. // "location": "query",
  9393. // "repeated": true,
  9394. // "type": "string"
  9395. // },
  9396. // "triggerId": {
  9397. // "description": "The triggers to be moved to the folder.",
  9398. // "location": "query",
  9399. // "repeated": true,
  9400. // "type": "string"
  9401. // },
  9402. // "variableId": {
  9403. // "description": "The variables to be moved to the folder.",
  9404. // "location": "query",
  9405. // "repeated": true,
  9406. // "type": "string"
  9407. // }
  9408. // },
  9409. // "path": "{+path}:move_entities_to_folder",
  9410. // "request": {
  9411. // "$ref": "Folder"
  9412. // },
  9413. // "scopes": [
  9414. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9415. // ]
  9416. // }
  9417. }
  9418. // method id "tagmanager.accounts.containers.workspaces.folders.revert":
  9419. type AccountsContainersWorkspacesFoldersRevertCall struct {
  9420. s *Service
  9421. path string
  9422. urlParams_ gensupport.URLParams
  9423. ctx_ context.Context
  9424. header_ http.Header
  9425. }
  9426. // Revert: Reverts changes to a GTM Folder in a GTM Workspace.
  9427. func (r *AccountsContainersWorkspacesFoldersService) Revert(path string) *AccountsContainersWorkspacesFoldersRevertCall {
  9428. c := &AccountsContainersWorkspacesFoldersRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9429. c.path = path
  9430. return c
  9431. }
  9432. // Fingerprint sets the optional parameter "fingerprint": When provided,
  9433. // this fingerprint must match the fingerprint of the tag in storage.
  9434. func (c *AccountsContainersWorkspacesFoldersRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesFoldersRevertCall {
  9435. c.urlParams_.Set("fingerprint", fingerprint)
  9436. return c
  9437. }
  9438. // Fields allows partial responses to be retrieved. See
  9439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9440. // for more information.
  9441. func (c *AccountsContainersWorkspacesFoldersRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersRevertCall {
  9442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9443. return c
  9444. }
  9445. // Context sets the context to be used in this call's Do method. Any
  9446. // pending HTTP request will be aborted if the provided context is
  9447. // canceled.
  9448. func (c *AccountsContainersWorkspacesFoldersRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersRevertCall {
  9449. c.ctx_ = ctx
  9450. return c
  9451. }
  9452. // Header returns an http.Header that can be modified by the caller to
  9453. // add HTTP headers to the request.
  9454. func (c *AccountsContainersWorkspacesFoldersRevertCall) Header() http.Header {
  9455. if c.header_ == nil {
  9456. c.header_ = make(http.Header)
  9457. }
  9458. return c.header_
  9459. }
  9460. func (c *AccountsContainersWorkspacesFoldersRevertCall) doRequest(alt string) (*http.Response, error) {
  9461. reqHeaders := make(http.Header)
  9462. for k, v := range c.header_ {
  9463. reqHeaders[k] = v
  9464. }
  9465. reqHeaders.Set("User-Agent", c.s.userAgent())
  9466. var body io.Reader = nil
  9467. c.urlParams_.Set("alt", alt)
  9468. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  9469. urls += "?" + c.urlParams_.Encode()
  9470. req, _ := http.NewRequest("POST", urls, body)
  9471. req.Header = reqHeaders
  9472. googleapi.Expand(req.URL, map[string]string{
  9473. "path": c.path,
  9474. })
  9475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9476. }
  9477. // Do executes the "tagmanager.accounts.containers.workspaces.folders.revert" call.
  9478. // Exactly one of *RevertFolderResponse or error will be non-nil. Any
  9479. // non-2xx status code is an error. Response headers are in either
  9480. // *RevertFolderResponse.ServerResponse.Header or (if a response was
  9481. // returned at all) in error.(*googleapi.Error).Header. Use
  9482. // googleapi.IsNotModified to check whether the returned error was
  9483. // because http.StatusNotModified was returned.
  9484. func (c *AccountsContainersWorkspacesFoldersRevertCall) Do(opts ...googleapi.CallOption) (*RevertFolderResponse, error) {
  9485. gensupport.SetOptions(c.urlParams_, opts...)
  9486. res, err := c.doRequest("json")
  9487. if res != nil && res.StatusCode == http.StatusNotModified {
  9488. if res.Body != nil {
  9489. res.Body.Close()
  9490. }
  9491. return nil, &googleapi.Error{
  9492. Code: res.StatusCode,
  9493. Header: res.Header,
  9494. }
  9495. }
  9496. if err != nil {
  9497. return nil, err
  9498. }
  9499. defer googleapi.CloseBody(res)
  9500. if err := googleapi.CheckResponse(res); err != nil {
  9501. return nil, err
  9502. }
  9503. ret := &RevertFolderResponse{
  9504. ServerResponse: googleapi.ServerResponse{
  9505. Header: res.Header,
  9506. HTTPStatusCode: res.StatusCode,
  9507. },
  9508. }
  9509. target := &ret
  9510. if err := gensupport.DecodeResponse(target, res); err != nil {
  9511. return nil, err
  9512. }
  9513. return ret, nil
  9514. // {
  9515. // "description": "Reverts changes to a GTM Folder in a GTM Workspace.",
  9516. // "httpMethod": "POST",
  9517. // "id": "tagmanager.accounts.containers.workspaces.folders.revert",
  9518. // "parameterOrder": [
  9519. // "path"
  9520. // ],
  9521. // "parameters": {
  9522. // "fingerprint": {
  9523. // "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.",
  9524. // "location": "query",
  9525. // "type": "string"
  9526. // },
  9527. // "path": {
  9528. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9529. // "location": "path",
  9530. // "required": true,
  9531. // "type": "string"
  9532. // }
  9533. // },
  9534. // "path": "{+path}:revert",
  9535. // "response": {
  9536. // "$ref": "RevertFolderResponse"
  9537. // },
  9538. // "scopes": [
  9539. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9540. // ]
  9541. // }
  9542. }
  9543. // method id "tagmanager.accounts.containers.workspaces.folders.update":
  9544. type AccountsContainersWorkspacesFoldersUpdateCall struct {
  9545. s *Service
  9546. path string
  9547. folder *Folder
  9548. urlParams_ gensupport.URLParams
  9549. ctx_ context.Context
  9550. header_ http.Header
  9551. }
  9552. // Update: Updates a GTM Folder.
  9553. func (r *AccountsContainersWorkspacesFoldersService) Update(path string, folder *Folder) *AccountsContainersWorkspacesFoldersUpdateCall {
  9554. c := &AccountsContainersWorkspacesFoldersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9555. c.path = path
  9556. c.folder = folder
  9557. return c
  9558. }
  9559. // Fingerprint sets the optional parameter "fingerprint": When provided,
  9560. // this fingerprint must match the fingerprint of the folder in storage.
  9561. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesFoldersUpdateCall {
  9562. c.urlParams_.Set("fingerprint", fingerprint)
  9563. return c
  9564. }
  9565. // Fields allows partial responses to be retrieved. See
  9566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9567. // for more information.
  9568. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesFoldersUpdateCall {
  9569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9570. return c
  9571. }
  9572. // Context sets the context to be used in this call's Do method. Any
  9573. // pending HTTP request will be aborted if the provided context is
  9574. // canceled.
  9575. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesFoldersUpdateCall {
  9576. c.ctx_ = ctx
  9577. return c
  9578. }
  9579. // Header returns an http.Header that can be modified by the caller to
  9580. // add HTTP headers to the request.
  9581. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Header() http.Header {
  9582. if c.header_ == nil {
  9583. c.header_ = make(http.Header)
  9584. }
  9585. return c.header_
  9586. }
  9587. func (c *AccountsContainersWorkspacesFoldersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9588. reqHeaders := make(http.Header)
  9589. for k, v := range c.header_ {
  9590. reqHeaders[k] = v
  9591. }
  9592. reqHeaders.Set("User-Agent", c.s.userAgent())
  9593. var body io.Reader = nil
  9594. body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder)
  9595. if err != nil {
  9596. return nil, err
  9597. }
  9598. reqHeaders.Set("Content-Type", "application/json")
  9599. c.urlParams_.Set("alt", alt)
  9600. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  9601. urls += "?" + c.urlParams_.Encode()
  9602. req, _ := http.NewRequest("PUT", urls, body)
  9603. req.Header = reqHeaders
  9604. googleapi.Expand(req.URL, map[string]string{
  9605. "path": c.path,
  9606. })
  9607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9608. }
  9609. // Do executes the "tagmanager.accounts.containers.workspaces.folders.update" call.
  9610. // Exactly one of *Folder or error will be non-nil. Any non-2xx status
  9611. // code is an error. Response headers are in either
  9612. // *Folder.ServerResponse.Header or (if a response was returned at all)
  9613. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9614. // check whether the returned error was because http.StatusNotModified
  9615. // was returned.
  9616. func (c *AccountsContainersWorkspacesFoldersUpdateCall) Do(opts ...googleapi.CallOption) (*Folder, error) {
  9617. gensupport.SetOptions(c.urlParams_, opts...)
  9618. res, err := c.doRequest("json")
  9619. if res != nil && res.StatusCode == http.StatusNotModified {
  9620. if res.Body != nil {
  9621. res.Body.Close()
  9622. }
  9623. return nil, &googleapi.Error{
  9624. Code: res.StatusCode,
  9625. Header: res.Header,
  9626. }
  9627. }
  9628. if err != nil {
  9629. return nil, err
  9630. }
  9631. defer googleapi.CloseBody(res)
  9632. if err := googleapi.CheckResponse(res); err != nil {
  9633. return nil, err
  9634. }
  9635. ret := &Folder{
  9636. ServerResponse: googleapi.ServerResponse{
  9637. Header: res.Header,
  9638. HTTPStatusCode: res.StatusCode,
  9639. },
  9640. }
  9641. target := &ret
  9642. if err := gensupport.DecodeResponse(target, res); err != nil {
  9643. return nil, err
  9644. }
  9645. return ret, nil
  9646. // {
  9647. // "description": "Updates a GTM Folder.",
  9648. // "httpMethod": "PUT",
  9649. // "id": "tagmanager.accounts.containers.workspaces.folders.update",
  9650. // "parameterOrder": [
  9651. // "path"
  9652. // ],
  9653. // "parameters": {
  9654. // "fingerprint": {
  9655. // "description": "When provided, this fingerprint must match the fingerprint of the folder in storage.",
  9656. // "location": "query",
  9657. // "type": "string"
  9658. // },
  9659. // "path": {
  9660. // "description": "GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id}",
  9661. // "location": "path",
  9662. // "required": true,
  9663. // "type": "string"
  9664. // }
  9665. // },
  9666. // "path": "{+path}",
  9667. // "request": {
  9668. // "$ref": "Folder"
  9669. // },
  9670. // "response": {
  9671. // "$ref": "Folder"
  9672. // },
  9673. // "scopes": [
  9674. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  9675. // ]
  9676. // }
  9677. }
  9678. // method id "tagmanager.accounts.containers.workspaces.proposal.create":
  9679. type AccountsContainersWorkspacesProposalCreateCall struct {
  9680. s *Service
  9681. parent string
  9682. createworkspaceproposalrequest *CreateWorkspaceProposalRequest
  9683. urlParams_ gensupport.URLParams
  9684. ctx_ context.Context
  9685. header_ http.Header
  9686. }
  9687. // Create: Creates a GTM Workspace Proposal.
  9688. func (r *AccountsContainersWorkspacesProposalService) Create(parent string, createworkspaceproposalrequest *CreateWorkspaceProposalRequest) *AccountsContainersWorkspacesProposalCreateCall {
  9689. c := &AccountsContainersWorkspacesProposalCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9690. c.parent = parent
  9691. c.createworkspaceproposalrequest = createworkspaceproposalrequest
  9692. return c
  9693. }
  9694. // Fields allows partial responses to be retrieved. See
  9695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9696. // for more information.
  9697. func (c *AccountsContainersWorkspacesProposalCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesProposalCreateCall {
  9698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9699. return c
  9700. }
  9701. // Context sets the context to be used in this call's Do method. Any
  9702. // pending HTTP request will be aborted if the provided context is
  9703. // canceled.
  9704. func (c *AccountsContainersWorkspacesProposalCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesProposalCreateCall {
  9705. c.ctx_ = ctx
  9706. return c
  9707. }
  9708. // Header returns an http.Header that can be modified by the caller to
  9709. // add HTTP headers to the request.
  9710. func (c *AccountsContainersWorkspacesProposalCreateCall) Header() http.Header {
  9711. if c.header_ == nil {
  9712. c.header_ = make(http.Header)
  9713. }
  9714. return c.header_
  9715. }
  9716. func (c *AccountsContainersWorkspacesProposalCreateCall) doRequest(alt string) (*http.Response, error) {
  9717. reqHeaders := make(http.Header)
  9718. for k, v := range c.header_ {
  9719. reqHeaders[k] = v
  9720. }
  9721. reqHeaders.Set("User-Agent", c.s.userAgent())
  9722. var body io.Reader = nil
  9723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createworkspaceproposalrequest)
  9724. if err != nil {
  9725. return nil, err
  9726. }
  9727. reqHeaders.Set("Content-Type", "application/json")
  9728. c.urlParams_.Set("alt", alt)
  9729. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/proposal")
  9730. urls += "?" + c.urlParams_.Encode()
  9731. req, _ := http.NewRequest("POST", urls, body)
  9732. req.Header = reqHeaders
  9733. googleapi.Expand(req.URL, map[string]string{
  9734. "parent": c.parent,
  9735. })
  9736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9737. }
  9738. // Do executes the "tagmanager.accounts.containers.workspaces.proposal.create" call.
  9739. // Exactly one of *WorkspaceProposal or error will be non-nil. Any
  9740. // non-2xx status code is an error. Response headers are in either
  9741. // *WorkspaceProposal.ServerResponse.Header or (if a response was
  9742. // returned at all) in error.(*googleapi.Error).Header. Use
  9743. // googleapi.IsNotModified to check whether the returned error was
  9744. // because http.StatusNotModified was returned.
  9745. func (c *AccountsContainersWorkspacesProposalCreateCall) Do(opts ...googleapi.CallOption) (*WorkspaceProposal, error) {
  9746. gensupport.SetOptions(c.urlParams_, opts...)
  9747. res, err := c.doRequest("json")
  9748. if res != nil && res.StatusCode == http.StatusNotModified {
  9749. if res.Body != nil {
  9750. res.Body.Close()
  9751. }
  9752. return nil, &googleapi.Error{
  9753. Code: res.StatusCode,
  9754. Header: res.Header,
  9755. }
  9756. }
  9757. if err != nil {
  9758. return nil, err
  9759. }
  9760. defer googleapi.CloseBody(res)
  9761. if err := googleapi.CheckResponse(res); err != nil {
  9762. return nil, err
  9763. }
  9764. ret := &WorkspaceProposal{
  9765. ServerResponse: googleapi.ServerResponse{
  9766. Header: res.Header,
  9767. HTTPStatusCode: res.StatusCode,
  9768. },
  9769. }
  9770. target := &ret
  9771. if err := gensupport.DecodeResponse(target, res); err != nil {
  9772. return nil, err
  9773. }
  9774. return ret, nil
  9775. // {
  9776. // "description": "Creates a GTM Workspace Proposal.",
  9777. // "httpMethod": "POST",
  9778. // "id": "tagmanager.accounts.containers.workspaces.proposal.create",
  9779. // "parameterOrder": [
  9780. // "parent"
  9781. // ],
  9782. // "parameters": {
  9783. // "parent": {
  9784. // "description": "GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid}",
  9785. // "location": "path",
  9786. // "required": true,
  9787. // "type": "string"
  9788. // }
  9789. // },
  9790. // "path": "{+parent}/proposal",
  9791. // "request": {
  9792. // "$ref": "CreateWorkspaceProposalRequest"
  9793. // },
  9794. // "response": {
  9795. // "$ref": "WorkspaceProposal"
  9796. // }
  9797. // }
  9798. }
  9799. // method id "tagmanager.accounts.containers.workspaces.proposal.delete":
  9800. type AccountsContainersWorkspacesProposalDeleteCall struct {
  9801. s *Service
  9802. path string
  9803. urlParams_ gensupport.URLParams
  9804. ctx_ context.Context
  9805. header_ http.Header
  9806. }
  9807. // Delete: Deletes a GTM Workspace Proposal.
  9808. func (r *AccountsContainersWorkspacesProposalService) Delete(path string) *AccountsContainersWorkspacesProposalDeleteCall {
  9809. c := &AccountsContainersWorkspacesProposalDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9810. c.path = path
  9811. return c
  9812. }
  9813. // Fields allows partial responses to be retrieved. See
  9814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9815. // for more information.
  9816. func (c *AccountsContainersWorkspacesProposalDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesProposalDeleteCall {
  9817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9818. return c
  9819. }
  9820. // Context sets the context to be used in this call's Do method. Any
  9821. // pending HTTP request will be aborted if the provided context is
  9822. // canceled.
  9823. func (c *AccountsContainersWorkspacesProposalDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesProposalDeleteCall {
  9824. c.ctx_ = ctx
  9825. return c
  9826. }
  9827. // Header returns an http.Header that can be modified by the caller to
  9828. // add HTTP headers to the request.
  9829. func (c *AccountsContainersWorkspacesProposalDeleteCall) Header() http.Header {
  9830. if c.header_ == nil {
  9831. c.header_ = make(http.Header)
  9832. }
  9833. return c.header_
  9834. }
  9835. func (c *AccountsContainersWorkspacesProposalDeleteCall) doRequest(alt string) (*http.Response, error) {
  9836. reqHeaders := make(http.Header)
  9837. for k, v := range c.header_ {
  9838. reqHeaders[k] = v
  9839. }
  9840. reqHeaders.Set("User-Agent", c.s.userAgent())
  9841. var body io.Reader = nil
  9842. c.urlParams_.Set("alt", alt)
  9843. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  9844. urls += "?" + c.urlParams_.Encode()
  9845. req, _ := http.NewRequest("DELETE", urls, body)
  9846. req.Header = reqHeaders
  9847. googleapi.Expand(req.URL, map[string]string{
  9848. "path": c.path,
  9849. })
  9850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9851. }
  9852. // Do executes the "tagmanager.accounts.containers.workspaces.proposal.delete" call.
  9853. func (c *AccountsContainersWorkspacesProposalDeleteCall) Do(opts ...googleapi.CallOption) error {
  9854. gensupport.SetOptions(c.urlParams_, opts...)
  9855. res, err := c.doRequest("json")
  9856. if err != nil {
  9857. return err
  9858. }
  9859. defer googleapi.CloseBody(res)
  9860. if err := googleapi.CheckResponse(res); err != nil {
  9861. return err
  9862. }
  9863. return nil
  9864. // {
  9865. // "description": "Deletes a GTM Workspace Proposal.",
  9866. // "httpMethod": "DELETE",
  9867. // "id": "tagmanager.accounts.containers.workspaces.proposal.delete",
  9868. // "parameterOrder": [
  9869. // "path"
  9870. // ],
  9871. // "parameters": {
  9872. // "path": {
  9873. // "description": "GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal",
  9874. // "location": "path",
  9875. // "required": true,
  9876. // "type": "string"
  9877. // }
  9878. // },
  9879. // "path": "{+path}"
  9880. // }
  9881. }
  9882. // method id "tagmanager.accounts.containers.workspaces.tags.create":
  9883. type AccountsContainersWorkspacesTagsCreateCall struct {
  9884. s *Service
  9885. parent string
  9886. tag *Tag
  9887. urlParams_ gensupport.URLParams
  9888. ctx_ context.Context
  9889. header_ http.Header
  9890. }
  9891. // Create: Creates a GTM Tag.
  9892. func (r *AccountsContainersWorkspacesTagsService) Create(parent string, tag *Tag) *AccountsContainersWorkspacesTagsCreateCall {
  9893. c := &AccountsContainersWorkspacesTagsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9894. c.parent = parent
  9895. c.tag = tag
  9896. return c
  9897. }
  9898. // Fields allows partial responses to be retrieved. See
  9899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9900. // for more information.
  9901. func (c *AccountsContainersWorkspacesTagsCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsCreateCall {
  9902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9903. return c
  9904. }
  9905. // Context sets the context to be used in this call's Do method. Any
  9906. // pending HTTP request will be aborted if the provided context is
  9907. // canceled.
  9908. func (c *AccountsContainersWorkspacesTagsCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsCreateCall {
  9909. c.ctx_ = ctx
  9910. return c
  9911. }
  9912. // Header returns an http.Header that can be modified by the caller to
  9913. // add HTTP headers to the request.
  9914. func (c *AccountsContainersWorkspacesTagsCreateCall) Header() http.Header {
  9915. if c.header_ == nil {
  9916. c.header_ = make(http.Header)
  9917. }
  9918. return c.header_
  9919. }
  9920. func (c *AccountsContainersWorkspacesTagsCreateCall) doRequest(alt string) (*http.Response, error) {
  9921. reqHeaders := make(http.Header)
  9922. for k, v := range c.header_ {
  9923. reqHeaders[k] = v
  9924. }
  9925. reqHeaders.Set("User-Agent", c.s.userAgent())
  9926. var body io.Reader = nil
  9927. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag)
  9928. if err != nil {
  9929. return nil, err
  9930. }
  9931. reqHeaders.Set("Content-Type", "application/json")
  9932. c.urlParams_.Set("alt", alt)
  9933. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/tags")
  9934. urls += "?" + c.urlParams_.Encode()
  9935. req, _ := http.NewRequest("POST", urls, body)
  9936. req.Header = reqHeaders
  9937. googleapi.Expand(req.URL, map[string]string{
  9938. "parent": c.parent,
  9939. })
  9940. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9941. }
  9942. // Do executes the "tagmanager.accounts.containers.workspaces.tags.create" call.
  9943. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  9944. // is an error. Response headers are in either
  9945. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  9946. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9947. // whether the returned error was because http.StatusNotModified was
  9948. // returned.
  9949. func (c *AccountsContainersWorkspacesTagsCreateCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  9950. gensupport.SetOptions(c.urlParams_, opts...)
  9951. res, err := c.doRequest("json")
  9952. if res != nil && res.StatusCode == http.StatusNotModified {
  9953. if res.Body != nil {
  9954. res.Body.Close()
  9955. }
  9956. return nil, &googleapi.Error{
  9957. Code: res.StatusCode,
  9958. Header: res.Header,
  9959. }
  9960. }
  9961. if err != nil {
  9962. return nil, err
  9963. }
  9964. defer googleapi.CloseBody(res)
  9965. if err := googleapi.CheckResponse(res); err != nil {
  9966. return nil, err
  9967. }
  9968. ret := &Tag{
  9969. ServerResponse: googleapi.ServerResponse{
  9970. Header: res.Header,
  9971. HTTPStatusCode: res.StatusCode,
  9972. },
  9973. }
  9974. target := &ret
  9975. if err := gensupport.DecodeResponse(target, res); err != nil {
  9976. return nil, err
  9977. }
  9978. return ret, nil
  9979. // {
  9980. // "description": "Creates a GTM Tag.",
  9981. // "httpMethod": "POST",
  9982. // "id": "tagmanager.accounts.containers.workspaces.tags.create",
  9983. // "parameterOrder": [
  9984. // "parent"
  9985. // ],
  9986. // "parameters": {
  9987. // "parent": {
  9988. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  9989. // "location": "path",
  9990. // "required": true,
  9991. // "type": "string"
  9992. // }
  9993. // },
  9994. // "path": "{+parent}/tags",
  9995. // "request": {
  9996. // "$ref": "Tag"
  9997. // },
  9998. // "response": {
  9999. // "$ref": "Tag"
  10000. // },
  10001. // "scopes": [
  10002. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10003. // ]
  10004. // }
  10005. }
  10006. // method id "tagmanager.accounts.containers.workspaces.tags.delete":
  10007. type AccountsContainersWorkspacesTagsDeleteCall struct {
  10008. s *Service
  10009. path string
  10010. urlParams_ gensupport.URLParams
  10011. ctx_ context.Context
  10012. header_ http.Header
  10013. }
  10014. // Delete: Deletes a GTM Tag.
  10015. func (r *AccountsContainersWorkspacesTagsService) Delete(path string) *AccountsContainersWorkspacesTagsDeleteCall {
  10016. c := &AccountsContainersWorkspacesTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10017. c.path = path
  10018. return c
  10019. }
  10020. // Fields allows partial responses to be retrieved. See
  10021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10022. // for more information.
  10023. func (c *AccountsContainersWorkspacesTagsDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsDeleteCall {
  10024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10025. return c
  10026. }
  10027. // Context sets the context to be used in this call's Do method. Any
  10028. // pending HTTP request will be aborted if the provided context is
  10029. // canceled.
  10030. func (c *AccountsContainersWorkspacesTagsDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsDeleteCall {
  10031. c.ctx_ = ctx
  10032. return c
  10033. }
  10034. // Header returns an http.Header that can be modified by the caller to
  10035. // add HTTP headers to the request.
  10036. func (c *AccountsContainersWorkspacesTagsDeleteCall) Header() http.Header {
  10037. if c.header_ == nil {
  10038. c.header_ = make(http.Header)
  10039. }
  10040. return c.header_
  10041. }
  10042. func (c *AccountsContainersWorkspacesTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10043. reqHeaders := make(http.Header)
  10044. for k, v := range c.header_ {
  10045. reqHeaders[k] = v
  10046. }
  10047. reqHeaders.Set("User-Agent", c.s.userAgent())
  10048. var body io.Reader = nil
  10049. c.urlParams_.Set("alt", alt)
  10050. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10051. urls += "?" + c.urlParams_.Encode()
  10052. req, _ := http.NewRequest("DELETE", urls, body)
  10053. req.Header = reqHeaders
  10054. googleapi.Expand(req.URL, map[string]string{
  10055. "path": c.path,
  10056. })
  10057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10058. }
  10059. // Do executes the "tagmanager.accounts.containers.workspaces.tags.delete" call.
  10060. func (c *AccountsContainersWorkspacesTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  10061. gensupport.SetOptions(c.urlParams_, opts...)
  10062. res, err := c.doRequest("json")
  10063. if err != nil {
  10064. return err
  10065. }
  10066. defer googleapi.CloseBody(res)
  10067. if err := googleapi.CheckResponse(res); err != nil {
  10068. return err
  10069. }
  10070. return nil
  10071. // {
  10072. // "description": "Deletes a GTM Tag.",
  10073. // "httpMethod": "DELETE",
  10074. // "id": "tagmanager.accounts.containers.workspaces.tags.delete",
  10075. // "parameterOrder": [
  10076. // "path"
  10077. // ],
  10078. // "parameters": {
  10079. // "path": {
  10080. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  10081. // "location": "path",
  10082. // "required": true,
  10083. // "type": "string"
  10084. // }
  10085. // },
  10086. // "path": "{+path}",
  10087. // "scopes": [
  10088. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10089. // ]
  10090. // }
  10091. }
  10092. // method id "tagmanager.accounts.containers.workspaces.tags.get":
  10093. type AccountsContainersWorkspacesTagsGetCall struct {
  10094. s *Service
  10095. path string
  10096. urlParams_ gensupport.URLParams
  10097. ifNoneMatch_ string
  10098. ctx_ context.Context
  10099. header_ http.Header
  10100. }
  10101. // Get: Gets a GTM Tag.
  10102. func (r *AccountsContainersWorkspacesTagsService) Get(path string) *AccountsContainersWorkspacesTagsGetCall {
  10103. c := &AccountsContainersWorkspacesTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10104. c.path = path
  10105. return c
  10106. }
  10107. // Fields allows partial responses to be retrieved. See
  10108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10109. // for more information.
  10110. func (c *AccountsContainersWorkspacesTagsGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsGetCall {
  10111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10112. return c
  10113. }
  10114. // IfNoneMatch sets the optional parameter which makes the operation
  10115. // fail if the object's ETag matches the given value. This is useful for
  10116. // getting updates only after the object has changed since the last
  10117. // request. Use googleapi.IsNotModified to check whether the response
  10118. // error from Do is the result of In-None-Match.
  10119. func (c *AccountsContainersWorkspacesTagsGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTagsGetCall {
  10120. c.ifNoneMatch_ = entityTag
  10121. return c
  10122. }
  10123. // Context sets the context to be used in this call's Do method. Any
  10124. // pending HTTP request will be aborted if the provided context is
  10125. // canceled.
  10126. func (c *AccountsContainersWorkspacesTagsGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsGetCall {
  10127. c.ctx_ = ctx
  10128. return c
  10129. }
  10130. // Header returns an http.Header that can be modified by the caller to
  10131. // add HTTP headers to the request.
  10132. func (c *AccountsContainersWorkspacesTagsGetCall) Header() http.Header {
  10133. if c.header_ == nil {
  10134. c.header_ = make(http.Header)
  10135. }
  10136. return c.header_
  10137. }
  10138. func (c *AccountsContainersWorkspacesTagsGetCall) doRequest(alt string) (*http.Response, error) {
  10139. reqHeaders := make(http.Header)
  10140. for k, v := range c.header_ {
  10141. reqHeaders[k] = v
  10142. }
  10143. reqHeaders.Set("User-Agent", c.s.userAgent())
  10144. if c.ifNoneMatch_ != "" {
  10145. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10146. }
  10147. var body io.Reader = nil
  10148. c.urlParams_.Set("alt", alt)
  10149. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10150. urls += "?" + c.urlParams_.Encode()
  10151. req, _ := http.NewRequest("GET", urls, body)
  10152. req.Header = reqHeaders
  10153. googleapi.Expand(req.URL, map[string]string{
  10154. "path": c.path,
  10155. })
  10156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10157. }
  10158. // Do executes the "tagmanager.accounts.containers.workspaces.tags.get" call.
  10159. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  10160. // is an error. Response headers are in either
  10161. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  10162. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10163. // whether the returned error was because http.StatusNotModified was
  10164. // returned.
  10165. func (c *AccountsContainersWorkspacesTagsGetCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  10166. gensupport.SetOptions(c.urlParams_, opts...)
  10167. res, err := c.doRequest("json")
  10168. if res != nil && res.StatusCode == http.StatusNotModified {
  10169. if res.Body != nil {
  10170. res.Body.Close()
  10171. }
  10172. return nil, &googleapi.Error{
  10173. Code: res.StatusCode,
  10174. Header: res.Header,
  10175. }
  10176. }
  10177. if err != nil {
  10178. return nil, err
  10179. }
  10180. defer googleapi.CloseBody(res)
  10181. if err := googleapi.CheckResponse(res); err != nil {
  10182. return nil, err
  10183. }
  10184. ret := &Tag{
  10185. ServerResponse: googleapi.ServerResponse{
  10186. Header: res.Header,
  10187. HTTPStatusCode: res.StatusCode,
  10188. },
  10189. }
  10190. target := &ret
  10191. if err := gensupport.DecodeResponse(target, res); err != nil {
  10192. return nil, err
  10193. }
  10194. return ret, nil
  10195. // {
  10196. // "description": "Gets a GTM Tag.",
  10197. // "httpMethod": "GET",
  10198. // "id": "tagmanager.accounts.containers.workspaces.tags.get",
  10199. // "parameterOrder": [
  10200. // "path"
  10201. // ],
  10202. // "parameters": {
  10203. // "path": {
  10204. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  10205. // "location": "path",
  10206. // "required": true,
  10207. // "type": "string"
  10208. // }
  10209. // },
  10210. // "path": "{+path}",
  10211. // "response": {
  10212. // "$ref": "Tag"
  10213. // },
  10214. // "scopes": [
  10215. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  10216. // "https://www.googleapis.com/auth/tagmanager.readonly"
  10217. // ]
  10218. // }
  10219. }
  10220. // method id "tagmanager.accounts.containers.workspaces.tags.list":
  10221. type AccountsContainersWorkspacesTagsListCall struct {
  10222. s *Service
  10223. parent string
  10224. urlParams_ gensupport.URLParams
  10225. ifNoneMatch_ string
  10226. ctx_ context.Context
  10227. header_ http.Header
  10228. }
  10229. // List: Lists all GTM Tags of a Container.
  10230. func (r *AccountsContainersWorkspacesTagsService) List(parent string) *AccountsContainersWorkspacesTagsListCall {
  10231. c := &AccountsContainersWorkspacesTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10232. c.parent = parent
  10233. return c
  10234. }
  10235. // PageToken sets the optional parameter "pageToken": Continuation token
  10236. // for fetching the next page of results.
  10237. func (c *AccountsContainersWorkspacesTagsListCall) PageToken(pageToken string) *AccountsContainersWorkspacesTagsListCall {
  10238. c.urlParams_.Set("pageToken", pageToken)
  10239. return c
  10240. }
  10241. // Fields allows partial responses to be retrieved. See
  10242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10243. // for more information.
  10244. func (c *AccountsContainersWorkspacesTagsListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsListCall {
  10245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10246. return c
  10247. }
  10248. // IfNoneMatch sets the optional parameter which makes the operation
  10249. // fail if the object's ETag matches the given value. This is useful for
  10250. // getting updates only after the object has changed since the last
  10251. // request. Use googleapi.IsNotModified to check whether the response
  10252. // error from Do is the result of In-None-Match.
  10253. func (c *AccountsContainersWorkspacesTagsListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTagsListCall {
  10254. c.ifNoneMatch_ = entityTag
  10255. return c
  10256. }
  10257. // Context sets the context to be used in this call's Do method. Any
  10258. // pending HTTP request will be aborted if the provided context is
  10259. // canceled.
  10260. func (c *AccountsContainersWorkspacesTagsListCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsListCall {
  10261. c.ctx_ = ctx
  10262. return c
  10263. }
  10264. // Header returns an http.Header that can be modified by the caller to
  10265. // add HTTP headers to the request.
  10266. func (c *AccountsContainersWorkspacesTagsListCall) Header() http.Header {
  10267. if c.header_ == nil {
  10268. c.header_ = make(http.Header)
  10269. }
  10270. return c.header_
  10271. }
  10272. func (c *AccountsContainersWorkspacesTagsListCall) doRequest(alt string) (*http.Response, error) {
  10273. reqHeaders := make(http.Header)
  10274. for k, v := range c.header_ {
  10275. reqHeaders[k] = v
  10276. }
  10277. reqHeaders.Set("User-Agent", c.s.userAgent())
  10278. if c.ifNoneMatch_ != "" {
  10279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10280. }
  10281. var body io.Reader = nil
  10282. c.urlParams_.Set("alt", alt)
  10283. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/tags")
  10284. urls += "?" + c.urlParams_.Encode()
  10285. req, _ := http.NewRequest("GET", urls, body)
  10286. req.Header = reqHeaders
  10287. googleapi.Expand(req.URL, map[string]string{
  10288. "parent": c.parent,
  10289. })
  10290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10291. }
  10292. // Do executes the "tagmanager.accounts.containers.workspaces.tags.list" call.
  10293. // Exactly one of *ListTagsResponse or error will be non-nil. Any
  10294. // non-2xx status code is an error. Response headers are in either
  10295. // *ListTagsResponse.ServerResponse.Header or (if a response was
  10296. // returned at all) in error.(*googleapi.Error).Header. Use
  10297. // googleapi.IsNotModified to check whether the returned error was
  10298. // because http.StatusNotModified was returned.
  10299. func (c *AccountsContainersWorkspacesTagsListCall) Do(opts ...googleapi.CallOption) (*ListTagsResponse, error) {
  10300. gensupport.SetOptions(c.urlParams_, opts...)
  10301. res, err := c.doRequest("json")
  10302. if res != nil && res.StatusCode == http.StatusNotModified {
  10303. if res.Body != nil {
  10304. res.Body.Close()
  10305. }
  10306. return nil, &googleapi.Error{
  10307. Code: res.StatusCode,
  10308. Header: res.Header,
  10309. }
  10310. }
  10311. if err != nil {
  10312. return nil, err
  10313. }
  10314. defer googleapi.CloseBody(res)
  10315. if err := googleapi.CheckResponse(res); err != nil {
  10316. return nil, err
  10317. }
  10318. ret := &ListTagsResponse{
  10319. ServerResponse: googleapi.ServerResponse{
  10320. Header: res.Header,
  10321. HTTPStatusCode: res.StatusCode,
  10322. },
  10323. }
  10324. target := &ret
  10325. if err := gensupport.DecodeResponse(target, res); err != nil {
  10326. return nil, err
  10327. }
  10328. return ret, nil
  10329. // {
  10330. // "description": "Lists all GTM Tags of a Container.",
  10331. // "httpMethod": "GET",
  10332. // "id": "tagmanager.accounts.containers.workspaces.tags.list",
  10333. // "parameterOrder": [
  10334. // "parent"
  10335. // ],
  10336. // "parameters": {
  10337. // "pageToken": {
  10338. // "description": "Continuation token for fetching the next page of results.",
  10339. // "location": "query",
  10340. // "type": "string"
  10341. // },
  10342. // "parent": {
  10343. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  10344. // "location": "path",
  10345. // "required": true,
  10346. // "type": "string"
  10347. // }
  10348. // },
  10349. // "path": "{+parent}/tags",
  10350. // "response": {
  10351. // "$ref": "ListTagsResponse"
  10352. // },
  10353. // "scopes": [
  10354. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  10355. // "https://www.googleapis.com/auth/tagmanager.readonly"
  10356. // ]
  10357. // }
  10358. }
  10359. // Pages invokes f for each page of results.
  10360. // A non-nil error returned from f will halt the iteration.
  10361. // The provided context supersedes any context provided to the Context method.
  10362. func (c *AccountsContainersWorkspacesTagsListCall) Pages(ctx context.Context, f func(*ListTagsResponse) error) error {
  10363. c.ctx_ = ctx
  10364. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10365. for {
  10366. x, err := c.Do()
  10367. if err != nil {
  10368. return err
  10369. }
  10370. if err := f(x); err != nil {
  10371. return err
  10372. }
  10373. if x.NextPageToken == "" {
  10374. return nil
  10375. }
  10376. c.PageToken(x.NextPageToken)
  10377. }
  10378. }
  10379. // method id "tagmanager.accounts.containers.workspaces.tags.revert":
  10380. type AccountsContainersWorkspacesTagsRevertCall struct {
  10381. s *Service
  10382. path string
  10383. urlParams_ gensupport.URLParams
  10384. ctx_ context.Context
  10385. header_ http.Header
  10386. }
  10387. // Revert: Reverts changes to a GTM Tag in a GTM Workspace.
  10388. func (r *AccountsContainersWorkspacesTagsService) Revert(path string) *AccountsContainersWorkspacesTagsRevertCall {
  10389. c := &AccountsContainersWorkspacesTagsRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10390. c.path = path
  10391. return c
  10392. }
  10393. // Fingerprint sets the optional parameter "fingerprint": When provided,
  10394. // this fingerprint must match the fingerprint of thetag in storage.
  10395. func (c *AccountsContainersWorkspacesTagsRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTagsRevertCall {
  10396. c.urlParams_.Set("fingerprint", fingerprint)
  10397. return c
  10398. }
  10399. // Fields allows partial responses to be retrieved. See
  10400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10401. // for more information.
  10402. func (c *AccountsContainersWorkspacesTagsRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsRevertCall {
  10403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10404. return c
  10405. }
  10406. // Context sets the context to be used in this call's Do method. Any
  10407. // pending HTTP request will be aborted if the provided context is
  10408. // canceled.
  10409. func (c *AccountsContainersWorkspacesTagsRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsRevertCall {
  10410. c.ctx_ = ctx
  10411. return c
  10412. }
  10413. // Header returns an http.Header that can be modified by the caller to
  10414. // add HTTP headers to the request.
  10415. func (c *AccountsContainersWorkspacesTagsRevertCall) Header() http.Header {
  10416. if c.header_ == nil {
  10417. c.header_ = make(http.Header)
  10418. }
  10419. return c.header_
  10420. }
  10421. func (c *AccountsContainersWorkspacesTagsRevertCall) doRequest(alt string) (*http.Response, error) {
  10422. reqHeaders := make(http.Header)
  10423. for k, v := range c.header_ {
  10424. reqHeaders[k] = v
  10425. }
  10426. reqHeaders.Set("User-Agent", c.s.userAgent())
  10427. var body io.Reader = nil
  10428. c.urlParams_.Set("alt", alt)
  10429. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  10430. urls += "?" + c.urlParams_.Encode()
  10431. req, _ := http.NewRequest("POST", urls, body)
  10432. req.Header = reqHeaders
  10433. googleapi.Expand(req.URL, map[string]string{
  10434. "path": c.path,
  10435. })
  10436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10437. }
  10438. // Do executes the "tagmanager.accounts.containers.workspaces.tags.revert" call.
  10439. // Exactly one of *RevertTagResponse or error will be non-nil. Any
  10440. // non-2xx status code is an error. Response headers are in either
  10441. // *RevertTagResponse.ServerResponse.Header or (if a response was
  10442. // returned at all) in error.(*googleapi.Error).Header. Use
  10443. // googleapi.IsNotModified to check whether the returned error was
  10444. // because http.StatusNotModified was returned.
  10445. func (c *AccountsContainersWorkspacesTagsRevertCall) Do(opts ...googleapi.CallOption) (*RevertTagResponse, error) {
  10446. gensupport.SetOptions(c.urlParams_, opts...)
  10447. res, err := c.doRequest("json")
  10448. if res != nil && res.StatusCode == http.StatusNotModified {
  10449. if res.Body != nil {
  10450. res.Body.Close()
  10451. }
  10452. return nil, &googleapi.Error{
  10453. Code: res.StatusCode,
  10454. Header: res.Header,
  10455. }
  10456. }
  10457. if err != nil {
  10458. return nil, err
  10459. }
  10460. defer googleapi.CloseBody(res)
  10461. if err := googleapi.CheckResponse(res); err != nil {
  10462. return nil, err
  10463. }
  10464. ret := &RevertTagResponse{
  10465. ServerResponse: googleapi.ServerResponse{
  10466. Header: res.Header,
  10467. HTTPStatusCode: res.StatusCode,
  10468. },
  10469. }
  10470. target := &ret
  10471. if err := gensupport.DecodeResponse(target, res); err != nil {
  10472. return nil, err
  10473. }
  10474. return ret, nil
  10475. // {
  10476. // "description": "Reverts changes to a GTM Tag in a GTM Workspace.",
  10477. // "httpMethod": "POST",
  10478. // "id": "tagmanager.accounts.containers.workspaces.tags.revert",
  10479. // "parameterOrder": [
  10480. // "path"
  10481. // ],
  10482. // "parameters": {
  10483. // "fingerprint": {
  10484. // "description": "When provided, this fingerprint must match the fingerprint of thetag in storage.",
  10485. // "location": "query",
  10486. // "type": "string"
  10487. // },
  10488. // "path": {
  10489. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  10490. // "location": "path",
  10491. // "required": true,
  10492. // "type": "string"
  10493. // }
  10494. // },
  10495. // "path": "{+path}:revert",
  10496. // "response": {
  10497. // "$ref": "RevertTagResponse"
  10498. // },
  10499. // "scopes": [
  10500. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10501. // ]
  10502. // }
  10503. }
  10504. // method id "tagmanager.accounts.containers.workspaces.tags.update":
  10505. type AccountsContainersWorkspacesTagsUpdateCall struct {
  10506. s *Service
  10507. path string
  10508. tag *Tag
  10509. urlParams_ gensupport.URLParams
  10510. ctx_ context.Context
  10511. header_ http.Header
  10512. }
  10513. // Update: Updates a GTM Tag.
  10514. func (r *AccountsContainersWorkspacesTagsService) Update(path string, tag *Tag) *AccountsContainersWorkspacesTagsUpdateCall {
  10515. c := &AccountsContainersWorkspacesTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10516. c.path = path
  10517. c.tag = tag
  10518. return c
  10519. }
  10520. // Fingerprint sets the optional parameter "fingerprint": When provided,
  10521. // this fingerprint must match the fingerprint of the tag in storage.
  10522. func (c *AccountsContainersWorkspacesTagsUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTagsUpdateCall {
  10523. c.urlParams_.Set("fingerprint", fingerprint)
  10524. return c
  10525. }
  10526. // Fields allows partial responses to be retrieved. See
  10527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10528. // for more information.
  10529. func (c *AccountsContainersWorkspacesTagsUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTagsUpdateCall {
  10530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10531. return c
  10532. }
  10533. // Context sets the context to be used in this call's Do method. Any
  10534. // pending HTTP request will be aborted if the provided context is
  10535. // canceled.
  10536. func (c *AccountsContainersWorkspacesTagsUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTagsUpdateCall {
  10537. c.ctx_ = ctx
  10538. return c
  10539. }
  10540. // Header returns an http.Header that can be modified by the caller to
  10541. // add HTTP headers to the request.
  10542. func (c *AccountsContainersWorkspacesTagsUpdateCall) Header() http.Header {
  10543. if c.header_ == nil {
  10544. c.header_ = make(http.Header)
  10545. }
  10546. return c.header_
  10547. }
  10548. func (c *AccountsContainersWorkspacesTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10549. reqHeaders := make(http.Header)
  10550. for k, v := range c.header_ {
  10551. reqHeaders[k] = v
  10552. }
  10553. reqHeaders.Set("User-Agent", c.s.userAgent())
  10554. var body io.Reader = nil
  10555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tag)
  10556. if err != nil {
  10557. return nil, err
  10558. }
  10559. reqHeaders.Set("Content-Type", "application/json")
  10560. c.urlParams_.Set("alt", alt)
  10561. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10562. urls += "?" + c.urlParams_.Encode()
  10563. req, _ := http.NewRequest("PUT", urls, body)
  10564. req.Header = reqHeaders
  10565. googleapi.Expand(req.URL, map[string]string{
  10566. "path": c.path,
  10567. })
  10568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10569. }
  10570. // Do executes the "tagmanager.accounts.containers.workspaces.tags.update" call.
  10571. // Exactly one of *Tag or error will be non-nil. Any non-2xx status code
  10572. // is an error. Response headers are in either
  10573. // *Tag.ServerResponse.Header or (if a response was returned at all) in
  10574. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10575. // whether the returned error was because http.StatusNotModified was
  10576. // returned.
  10577. func (c *AccountsContainersWorkspacesTagsUpdateCall) Do(opts ...googleapi.CallOption) (*Tag, error) {
  10578. gensupport.SetOptions(c.urlParams_, opts...)
  10579. res, err := c.doRequest("json")
  10580. if res != nil && res.StatusCode == http.StatusNotModified {
  10581. if res.Body != nil {
  10582. res.Body.Close()
  10583. }
  10584. return nil, &googleapi.Error{
  10585. Code: res.StatusCode,
  10586. Header: res.Header,
  10587. }
  10588. }
  10589. if err != nil {
  10590. return nil, err
  10591. }
  10592. defer googleapi.CloseBody(res)
  10593. if err := googleapi.CheckResponse(res); err != nil {
  10594. return nil, err
  10595. }
  10596. ret := &Tag{
  10597. ServerResponse: googleapi.ServerResponse{
  10598. Header: res.Header,
  10599. HTTPStatusCode: res.StatusCode,
  10600. },
  10601. }
  10602. target := &ret
  10603. if err := gensupport.DecodeResponse(target, res); err != nil {
  10604. return nil, err
  10605. }
  10606. return ret, nil
  10607. // {
  10608. // "description": "Updates a GTM Tag.",
  10609. // "httpMethod": "PUT",
  10610. // "id": "tagmanager.accounts.containers.workspaces.tags.update",
  10611. // "parameterOrder": [
  10612. // "path"
  10613. // ],
  10614. // "parameters": {
  10615. // "fingerprint": {
  10616. // "description": "When provided, this fingerprint must match the fingerprint of the tag in storage.",
  10617. // "location": "query",
  10618. // "type": "string"
  10619. // },
  10620. // "path": {
  10621. // "description": "GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id}",
  10622. // "location": "path",
  10623. // "required": true,
  10624. // "type": "string"
  10625. // }
  10626. // },
  10627. // "path": "{+path}",
  10628. // "request": {
  10629. // "$ref": "Tag"
  10630. // },
  10631. // "response": {
  10632. // "$ref": "Tag"
  10633. // },
  10634. // "scopes": [
  10635. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10636. // ]
  10637. // }
  10638. }
  10639. // method id "tagmanager.accounts.containers.workspaces.triggers.create":
  10640. type AccountsContainersWorkspacesTriggersCreateCall struct {
  10641. s *Service
  10642. parent string
  10643. trigger *Trigger
  10644. urlParams_ gensupport.URLParams
  10645. ctx_ context.Context
  10646. header_ http.Header
  10647. }
  10648. // Create: Creates a GTM Trigger.
  10649. func (r *AccountsContainersWorkspacesTriggersService) Create(parent string, trigger *Trigger) *AccountsContainersWorkspacesTriggersCreateCall {
  10650. c := &AccountsContainersWorkspacesTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10651. c.parent = parent
  10652. c.trigger = trigger
  10653. return c
  10654. }
  10655. // Fields allows partial responses to be retrieved. See
  10656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10657. // for more information.
  10658. func (c *AccountsContainersWorkspacesTriggersCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersCreateCall {
  10659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10660. return c
  10661. }
  10662. // Context sets the context to be used in this call's Do method. Any
  10663. // pending HTTP request will be aborted if the provided context is
  10664. // canceled.
  10665. func (c *AccountsContainersWorkspacesTriggersCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersCreateCall {
  10666. c.ctx_ = ctx
  10667. return c
  10668. }
  10669. // Header returns an http.Header that can be modified by the caller to
  10670. // add HTTP headers to the request.
  10671. func (c *AccountsContainersWorkspacesTriggersCreateCall) Header() http.Header {
  10672. if c.header_ == nil {
  10673. c.header_ = make(http.Header)
  10674. }
  10675. return c.header_
  10676. }
  10677. func (c *AccountsContainersWorkspacesTriggersCreateCall) doRequest(alt string) (*http.Response, error) {
  10678. reqHeaders := make(http.Header)
  10679. for k, v := range c.header_ {
  10680. reqHeaders[k] = v
  10681. }
  10682. reqHeaders.Set("User-Agent", c.s.userAgent())
  10683. var body io.Reader = nil
  10684. body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  10685. if err != nil {
  10686. return nil, err
  10687. }
  10688. reqHeaders.Set("Content-Type", "application/json")
  10689. c.urlParams_.Set("alt", alt)
  10690. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/triggers")
  10691. urls += "?" + c.urlParams_.Encode()
  10692. req, _ := http.NewRequest("POST", urls, body)
  10693. req.Header = reqHeaders
  10694. googleapi.Expand(req.URL, map[string]string{
  10695. "parent": c.parent,
  10696. })
  10697. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10698. }
  10699. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.create" call.
  10700. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  10701. // code is an error. Response headers are in either
  10702. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  10703. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10704. // check whether the returned error was because http.StatusNotModified
  10705. // was returned.
  10706. func (c *AccountsContainersWorkspacesTriggersCreateCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  10707. gensupport.SetOptions(c.urlParams_, opts...)
  10708. res, err := c.doRequest("json")
  10709. if res != nil && res.StatusCode == http.StatusNotModified {
  10710. if res.Body != nil {
  10711. res.Body.Close()
  10712. }
  10713. return nil, &googleapi.Error{
  10714. Code: res.StatusCode,
  10715. Header: res.Header,
  10716. }
  10717. }
  10718. if err != nil {
  10719. return nil, err
  10720. }
  10721. defer googleapi.CloseBody(res)
  10722. if err := googleapi.CheckResponse(res); err != nil {
  10723. return nil, err
  10724. }
  10725. ret := &Trigger{
  10726. ServerResponse: googleapi.ServerResponse{
  10727. Header: res.Header,
  10728. HTTPStatusCode: res.StatusCode,
  10729. },
  10730. }
  10731. target := &ret
  10732. if err := gensupport.DecodeResponse(target, res); err != nil {
  10733. return nil, err
  10734. }
  10735. return ret, nil
  10736. // {
  10737. // "description": "Creates a GTM Trigger.",
  10738. // "httpMethod": "POST",
  10739. // "id": "tagmanager.accounts.containers.workspaces.triggers.create",
  10740. // "parameterOrder": [
  10741. // "parent"
  10742. // ],
  10743. // "parameters": {
  10744. // "parent": {
  10745. // "description": "GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  10746. // "location": "path",
  10747. // "required": true,
  10748. // "type": "string"
  10749. // }
  10750. // },
  10751. // "path": "{+parent}/triggers",
  10752. // "request": {
  10753. // "$ref": "Trigger"
  10754. // },
  10755. // "response": {
  10756. // "$ref": "Trigger"
  10757. // },
  10758. // "scopes": [
  10759. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10760. // ]
  10761. // }
  10762. }
  10763. // method id "tagmanager.accounts.containers.workspaces.triggers.delete":
  10764. type AccountsContainersWorkspacesTriggersDeleteCall struct {
  10765. s *Service
  10766. path string
  10767. urlParams_ gensupport.URLParams
  10768. ctx_ context.Context
  10769. header_ http.Header
  10770. }
  10771. // Delete: Deletes a GTM Trigger.
  10772. func (r *AccountsContainersWorkspacesTriggersService) Delete(path string) *AccountsContainersWorkspacesTriggersDeleteCall {
  10773. c := &AccountsContainersWorkspacesTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10774. c.path = path
  10775. return c
  10776. }
  10777. // Fields allows partial responses to be retrieved. See
  10778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10779. // for more information.
  10780. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersDeleteCall {
  10781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10782. return c
  10783. }
  10784. // Context sets the context to be used in this call's Do method. Any
  10785. // pending HTTP request will be aborted if the provided context is
  10786. // canceled.
  10787. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersDeleteCall {
  10788. c.ctx_ = ctx
  10789. return c
  10790. }
  10791. // Header returns an http.Header that can be modified by the caller to
  10792. // add HTTP headers to the request.
  10793. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Header() http.Header {
  10794. if c.header_ == nil {
  10795. c.header_ = make(http.Header)
  10796. }
  10797. return c.header_
  10798. }
  10799. func (c *AccountsContainersWorkspacesTriggersDeleteCall) doRequest(alt string) (*http.Response, error) {
  10800. reqHeaders := make(http.Header)
  10801. for k, v := range c.header_ {
  10802. reqHeaders[k] = v
  10803. }
  10804. reqHeaders.Set("User-Agent", c.s.userAgent())
  10805. var body io.Reader = nil
  10806. c.urlParams_.Set("alt", alt)
  10807. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10808. urls += "?" + c.urlParams_.Encode()
  10809. req, _ := http.NewRequest("DELETE", urls, body)
  10810. req.Header = reqHeaders
  10811. googleapi.Expand(req.URL, map[string]string{
  10812. "path": c.path,
  10813. })
  10814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10815. }
  10816. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.delete" call.
  10817. func (c *AccountsContainersWorkspacesTriggersDeleteCall) Do(opts ...googleapi.CallOption) error {
  10818. gensupport.SetOptions(c.urlParams_, opts...)
  10819. res, err := c.doRequest("json")
  10820. if err != nil {
  10821. return err
  10822. }
  10823. defer googleapi.CloseBody(res)
  10824. if err := googleapi.CheckResponse(res); err != nil {
  10825. return err
  10826. }
  10827. return nil
  10828. // {
  10829. // "description": "Deletes a GTM Trigger.",
  10830. // "httpMethod": "DELETE",
  10831. // "id": "tagmanager.accounts.containers.workspaces.triggers.delete",
  10832. // "parameterOrder": [
  10833. // "path"
  10834. // ],
  10835. // "parameters": {
  10836. // "path": {
  10837. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  10838. // "location": "path",
  10839. // "required": true,
  10840. // "type": "string"
  10841. // }
  10842. // },
  10843. // "path": "{+path}",
  10844. // "scopes": [
  10845. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  10846. // ]
  10847. // }
  10848. }
  10849. // method id "tagmanager.accounts.containers.workspaces.triggers.get":
  10850. type AccountsContainersWorkspacesTriggersGetCall struct {
  10851. s *Service
  10852. path string
  10853. urlParams_ gensupport.URLParams
  10854. ifNoneMatch_ string
  10855. ctx_ context.Context
  10856. header_ http.Header
  10857. }
  10858. // Get: Gets a GTM Trigger.
  10859. func (r *AccountsContainersWorkspacesTriggersService) Get(path string) *AccountsContainersWorkspacesTriggersGetCall {
  10860. c := &AccountsContainersWorkspacesTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10861. c.path = path
  10862. return c
  10863. }
  10864. // Fields allows partial responses to be retrieved. See
  10865. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10866. // for more information.
  10867. func (c *AccountsContainersWorkspacesTriggersGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersGetCall {
  10868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10869. return c
  10870. }
  10871. // IfNoneMatch sets the optional parameter which makes the operation
  10872. // fail if the object's ETag matches the given value. This is useful for
  10873. // getting updates only after the object has changed since the last
  10874. // request. Use googleapi.IsNotModified to check whether the response
  10875. // error from Do is the result of In-None-Match.
  10876. func (c *AccountsContainersWorkspacesTriggersGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTriggersGetCall {
  10877. c.ifNoneMatch_ = entityTag
  10878. return c
  10879. }
  10880. // Context sets the context to be used in this call's Do method. Any
  10881. // pending HTTP request will be aborted if the provided context is
  10882. // canceled.
  10883. func (c *AccountsContainersWorkspacesTriggersGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersGetCall {
  10884. c.ctx_ = ctx
  10885. return c
  10886. }
  10887. // Header returns an http.Header that can be modified by the caller to
  10888. // add HTTP headers to the request.
  10889. func (c *AccountsContainersWorkspacesTriggersGetCall) Header() http.Header {
  10890. if c.header_ == nil {
  10891. c.header_ = make(http.Header)
  10892. }
  10893. return c.header_
  10894. }
  10895. func (c *AccountsContainersWorkspacesTriggersGetCall) doRequest(alt string) (*http.Response, error) {
  10896. reqHeaders := make(http.Header)
  10897. for k, v := range c.header_ {
  10898. reqHeaders[k] = v
  10899. }
  10900. reqHeaders.Set("User-Agent", c.s.userAgent())
  10901. if c.ifNoneMatch_ != "" {
  10902. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10903. }
  10904. var body io.Reader = nil
  10905. c.urlParams_.Set("alt", alt)
  10906. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  10907. urls += "?" + c.urlParams_.Encode()
  10908. req, _ := http.NewRequest("GET", urls, body)
  10909. req.Header = reqHeaders
  10910. googleapi.Expand(req.URL, map[string]string{
  10911. "path": c.path,
  10912. })
  10913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10914. }
  10915. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.get" call.
  10916. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  10917. // code is an error. Response headers are in either
  10918. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  10919. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10920. // check whether the returned error was because http.StatusNotModified
  10921. // was returned.
  10922. func (c *AccountsContainersWorkspacesTriggersGetCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  10923. gensupport.SetOptions(c.urlParams_, opts...)
  10924. res, err := c.doRequest("json")
  10925. if res != nil && res.StatusCode == http.StatusNotModified {
  10926. if res.Body != nil {
  10927. res.Body.Close()
  10928. }
  10929. return nil, &googleapi.Error{
  10930. Code: res.StatusCode,
  10931. Header: res.Header,
  10932. }
  10933. }
  10934. if err != nil {
  10935. return nil, err
  10936. }
  10937. defer googleapi.CloseBody(res)
  10938. if err := googleapi.CheckResponse(res); err != nil {
  10939. return nil, err
  10940. }
  10941. ret := &Trigger{
  10942. ServerResponse: googleapi.ServerResponse{
  10943. Header: res.Header,
  10944. HTTPStatusCode: res.StatusCode,
  10945. },
  10946. }
  10947. target := &ret
  10948. if err := gensupport.DecodeResponse(target, res); err != nil {
  10949. return nil, err
  10950. }
  10951. return ret, nil
  10952. // {
  10953. // "description": "Gets a GTM Trigger.",
  10954. // "httpMethod": "GET",
  10955. // "id": "tagmanager.accounts.containers.workspaces.triggers.get",
  10956. // "parameterOrder": [
  10957. // "path"
  10958. // ],
  10959. // "parameters": {
  10960. // "path": {
  10961. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  10962. // "location": "path",
  10963. // "required": true,
  10964. // "type": "string"
  10965. // }
  10966. // },
  10967. // "path": "{+path}",
  10968. // "response": {
  10969. // "$ref": "Trigger"
  10970. // },
  10971. // "scopes": [
  10972. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  10973. // "https://www.googleapis.com/auth/tagmanager.readonly"
  10974. // ]
  10975. // }
  10976. }
  10977. // method id "tagmanager.accounts.containers.workspaces.triggers.list":
  10978. type AccountsContainersWorkspacesTriggersListCall struct {
  10979. s *Service
  10980. parent string
  10981. urlParams_ gensupport.URLParams
  10982. ifNoneMatch_ string
  10983. ctx_ context.Context
  10984. header_ http.Header
  10985. }
  10986. // List: Lists all GTM Triggers of a Container.
  10987. func (r *AccountsContainersWorkspacesTriggersService) List(parent string) *AccountsContainersWorkspacesTriggersListCall {
  10988. c := &AccountsContainersWorkspacesTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10989. c.parent = parent
  10990. return c
  10991. }
  10992. // PageToken sets the optional parameter "pageToken": Continuation token
  10993. // for fetching the next page of results.
  10994. func (c *AccountsContainersWorkspacesTriggersListCall) PageToken(pageToken string) *AccountsContainersWorkspacesTriggersListCall {
  10995. c.urlParams_.Set("pageToken", pageToken)
  10996. return c
  10997. }
  10998. // Fields allows partial responses to be retrieved. See
  10999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11000. // for more information.
  11001. func (c *AccountsContainersWorkspacesTriggersListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersListCall {
  11002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11003. return c
  11004. }
  11005. // IfNoneMatch sets the optional parameter which makes the operation
  11006. // fail if the object's ETag matches the given value. This is useful for
  11007. // getting updates only after the object has changed since the last
  11008. // request. Use googleapi.IsNotModified to check whether the response
  11009. // error from Do is the result of In-None-Match.
  11010. func (c *AccountsContainersWorkspacesTriggersListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesTriggersListCall {
  11011. c.ifNoneMatch_ = entityTag
  11012. return c
  11013. }
  11014. // Context sets the context to be used in this call's Do method. Any
  11015. // pending HTTP request will be aborted if the provided context is
  11016. // canceled.
  11017. func (c *AccountsContainersWorkspacesTriggersListCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersListCall {
  11018. c.ctx_ = ctx
  11019. return c
  11020. }
  11021. // Header returns an http.Header that can be modified by the caller to
  11022. // add HTTP headers to the request.
  11023. func (c *AccountsContainersWorkspacesTriggersListCall) Header() http.Header {
  11024. if c.header_ == nil {
  11025. c.header_ = make(http.Header)
  11026. }
  11027. return c.header_
  11028. }
  11029. func (c *AccountsContainersWorkspacesTriggersListCall) doRequest(alt string) (*http.Response, error) {
  11030. reqHeaders := make(http.Header)
  11031. for k, v := range c.header_ {
  11032. reqHeaders[k] = v
  11033. }
  11034. reqHeaders.Set("User-Agent", c.s.userAgent())
  11035. if c.ifNoneMatch_ != "" {
  11036. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11037. }
  11038. var body io.Reader = nil
  11039. c.urlParams_.Set("alt", alt)
  11040. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/triggers")
  11041. urls += "?" + c.urlParams_.Encode()
  11042. req, _ := http.NewRequest("GET", urls, body)
  11043. req.Header = reqHeaders
  11044. googleapi.Expand(req.URL, map[string]string{
  11045. "parent": c.parent,
  11046. })
  11047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11048. }
  11049. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.list" call.
  11050. // Exactly one of *ListTriggersResponse or error will be non-nil. Any
  11051. // non-2xx status code is an error. Response headers are in either
  11052. // *ListTriggersResponse.ServerResponse.Header or (if a response was
  11053. // returned at all) in error.(*googleapi.Error).Header. Use
  11054. // googleapi.IsNotModified to check whether the returned error was
  11055. // because http.StatusNotModified was returned.
  11056. func (c *AccountsContainersWorkspacesTriggersListCall) Do(opts ...googleapi.CallOption) (*ListTriggersResponse, error) {
  11057. gensupport.SetOptions(c.urlParams_, opts...)
  11058. res, err := c.doRequest("json")
  11059. if res != nil && res.StatusCode == http.StatusNotModified {
  11060. if res.Body != nil {
  11061. res.Body.Close()
  11062. }
  11063. return nil, &googleapi.Error{
  11064. Code: res.StatusCode,
  11065. Header: res.Header,
  11066. }
  11067. }
  11068. if err != nil {
  11069. return nil, err
  11070. }
  11071. defer googleapi.CloseBody(res)
  11072. if err := googleapi.CheckResponse(res); err != nil {
  11073. return nil, err
  11074. }
  11075. ret := &ListTriggersResponse{
  11076. ServerResponse: googleapi.ServerResponse{
  11077. Header: res.Header,
  11078. HTTPStatusCode: res.StatusCode,
  11079. },
  11080. }
  11081. target := &ret
  11082. if err := gensupport.DecodeResponse(target, res); err != nil {
  11083. return nil, err
  11084. }
  11085. return ret, nil
  11086. // {
  11087. // "description": "Lists all GTM Triggers of a Container.",
  11088. // "httpMethod": "GET",
  11089. // "id": "tagmanager.accounts.containers.workspaces.triggers.list",
  11090. // "parameterOrder": [
  11091. // "parent"
  11092. // ],
  11093. // "parameters": {
  11094. // "pageToken": {
  11095. // "description": "Continuation token for fetching the next page of results.",
  11096. // "location": "query",
  11097. // "type": "string"
  11098. // },
  11099. // "parent": {
  11100. // "description": "GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  11101. // "location": "path",
  11102. // "required": true,
  11103. // "type": "string"
  11104. // }
  11105. // },
  11106. // "path": "{+parent}/triggers",
  11107. // "response": {
  11108. // "$ref": "ListTriggersResponse"
  11109. // },
  11110. // "scopes": [
  11111. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  11112. // "https://www.googleapis.com/auth/tagmanager.readonly"
  11113. // ]
  11114. // }
  11115. }
  11116. // Pages invokes f for each page of results.
  11117. // A non-nil error returned from f will halt the iteration.
  11118. // The provided context supersedes any context provided to the Context method.
  11119. func (c *AccountsContainersWorkspacesTriggersListCall) Pages(ctx context.Context, f func(*ListTriggersResponse) error) error {
  11120. c.ctx_ = ctx
  11121. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11122. for {
  11123. x, err := c.Do()
  11124. if err != nil {
  11125. return err
  11126. }
  11127. if err := f(x); err != nil {
  11128. return err
  11129. }
  11130. if x.NextPageToken == "" {
  11131. return nil
  11132. }
  11133. c.PageToken(x.NextPageToken)
  11134. }
  11135. }
  11136. // method id "tagmanager.accounts.containers.workspaces.triggers.revert":
  11137. type AccountsContainersWorkspacesTriggersRevertCall struct {
  11138. s *Service
  11139. path string
  11140. urlParams_ gensupport.URLParams
  11141. ctx_ context.Context
  11142. header_ http.Header
  11143. }
  11144. // Revert: Reverts changes to a GTM Trigger in a GTM Workspace.
  11145. func (r *AccountsContainersWorkspacesTriggersService) Revert(path string) *AccountsContainersWorkspacesTriggersRevertCall {
  11146. c := &AccountsContainersWorkspacesTriggersRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11147. c.path = path
  11148. return c
  11149. }
  11150. // Fingerprint sets the optional parameter "fingerprint": When provided,
  11151. // this fingerprint must match the fingerprint of the trigger in
  11152. // storage.
  11153. func (c *AccountsContainersWorkspacesTriggersRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTriggersRevertCall {
  11154. c.urlParams_.Set("fingerprint", fingerprint)
  11155. return c
  11156. }
  11157. // Fields allows partial responses to be retrieved. See
  11158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11159. // for more information.
  11160. func (c *AccountsContainersWorkspacesTriggersRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersRevertCall {
  11161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11162. return c
  11163. }
  11164. // Context sets the context to be used in this call's Do method. Any
  11165. // pending HTTP request will be aborted if the provided context is
  11166. // canceled.
  11167. func (c *AccountsContainersWorkspacesTriggersRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersRevertCall {
  11168. c.ctx_ = ctx
  11169. return c
  11170. }
  11171. // Header returns an http.Header that can be modified by the caller to
  11172. // add HTTP headers to the request.
  11173. func (c *AccountsContainersWorkspacesTriggersRevertCall) Header() http.Header {
  11174. if c.header_ == nil {
  11175. c.header_ = make(http.Header)
  11176. }
  11177. return c.header_
  11178. }
  11179. func (c *AccountsContainersWorkspacesTriggersRevertCall) doRequest(alt string) (*http.Response, error) {
  11180. reqHeaders := make(http.Header)
  11181. for k, v := range c.header_ {
  11182. reqHeaders[k] = v
  11183. }
  11184. reqHeaders.Set("User-Agent", c.s.userAgent())
  11185. var body io.Reader = nil
  11186. c.urlParams_.Set("alt", alt)
  11187. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  11188. urls += "?" + c.urlParams_.Encode()
  11189. req, _ := http.NewRequest("POST", urls, body)
  11190. req.Header = reqHeaders
  11191. googleapi.Expand(req.URL, map[string]string{
  11192. "path": c.path,
  11193. })
  11194. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11195. }
  11196. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.revert" call.
  11197. // Exactly one of *RevertTriggerResponse or error will be non-nil. Any
  11198. // non-2xx status code is an error. Response headers are in either
  11199. // *RevertTriggerResponse.ServerResponse.Header or (if a response was
  11200. // returned at all) in error.(*googleapi.Error).Header. Use
  11201. // googleapi.IsNotModified to check whether the returned error was
  11202. // because http.StatusNotModified was returned.
  11203. func (c *AccountsContainersWorkspacesTriggersRevertCall) Do(opts ...googleapi.CallOption) (*RevertTriggerResponse, error) {
  11204. gensupport.SetOptions(c.urlParams_, opts...)
  11205. res, err := c.doRequest("json")
  11206. if res != nil && res.StatusCode == http.StatusNotModified {
  11207. if res.Body != nil {
  11208. res.Body.Close()
  11209. }
  11210. return nil, &googleapi.Error{
  11211. Code: res.StatusCode,
  11212. Header: res.Header,
  11213. }
  11214. }
  11215. if err != nil {
  11216. return nil, err
  11217. }
  11218. defer googleapi.CloseBody(res)
  11219. if err := googleapi.CheckResponse(res); err != nil {
  11220. return nil, err
  11221. }
  11222. ret := &RevertTriggerResponse{
  11223. ServerResponse: googleapi.ServerResponse{
  11224. Header: res.Header,
  11225. HTTPStatusCode: res.StatusCode,
  11226. },
  11227. }
  11228. target := &ret
  11229. if err := gensupport.DecodeResponse(target, res); err != nil {
  11230. return nil, err
  11231. }
  11232. return ret, nil
  11233. // {
  11234. // "description": "Reverts changes to a GTM Trigger in a GTM Workspace.",
  11235. // "httpMethod": "POST",
  11236. // "id": "tagmanager.accounts.containers.workspaces.triggers.revert",
  11237. // "parameterOrder": [
  11238. // "path"
  11239. // ],
  11240. // "parameters": {
  11241. // "fingerprint": {
  11242. // "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.",
  11243. // "location": "query",
  11244. // "type": "string"
  11245. // },
  11246. // "path": {
  11247. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  11248. // "location": "path",
  11249. // "required": true,
  11250. // "type": "string"
  11251. // }
  11252. // },
  11253. // "path": "{+path}:revert",
  11254. // "response": {
  11255. // "$ref": "RevertTriggerResponse"
  11256. // },
  11257. // "scopes": [
  11258. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11259. // ]
  11260. // }
  11261. }
  11262. // method id "tagmanager.accounts.containers.workspaces.triggers.update":
  11263. type AccountsContainersWorkspacesTriggersUpdateCall struct {
  11264. s *Service
  11265. path string
  11266. trigger *Trigger
  11267. urlParams_ gensupport.URLParams
  11268. ctx_ context.Context
  11269. header_ http.Header
  11270. }
  11271. // Update: Updates a GTM Trigger.
  11272. func (r *AccountsContainersWorkspacesTriggersService) Update(path string, trigger *Trigger) *AccountsContainersWorkspacesTriggersUpdateCall {
  11273. c := &AccountsContainersWorkspacesTriggersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11274. c.path = path
  11275. c.trigger = trigger
  11276. return c
  11277. }
  11278. // Fingerprint sets the optional parameter "fingerprint": When provided,
  11279. // this fingerprint must match the fingerprint of the trigger in
  11280. // storage.
  11281. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesTriggersUpdateCall {
  11282. c.urlParams_.Set("fingerprint", fingerprint)
  11283. return c
  11284. }
  11285. // Fields allows partial responses to be retrieved. See
  11286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11287. // for more information.
  11288. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesTriggersUpdateCall {
  11289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11290. return c
  11291. }
  11292. // Context sets the context to be used in this call's Do method. Any
  11293. // pending HTTP request will be aborted if the provided context is
  11294. // canceled.
  11295. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesTriggersUpdateCall {
  11296. c.ctx_ = ctx
  11297. return c
  11298. }
  11299. // Header returns an http.Header that can be modified by the caller to
  11300. // add HTTP headers to the request.
  11301. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Header() http.Header {
  11302. if c.header_ == nil {
  11303. c.header_ = make(http.Header)
  11304. }
  11305. return c.header_
  11306. }
  11307. func (c *AccountsContainersWorkspacesTriggersUpdateCall) doRequest(alt string) (*http.Response, error) {
  11308. reqHeaders := make(http.Header)
  11309. for k, v := range c.header_ {
  11310. reqHeaders[k] = v
  11311. }
  11312. reqHeaders.Set("User-Agent", c.s.userAgent())
  11313. var body io.Reader = nil
  11314. body, err := googleapi.WithoutDataWrapper.JSONReader(c.trigger)
  11315. if err != nil {
  11316. return nil, err
  11317. }
  11318. reqHeaders.Set("Content-Type", "application/json")
  11319. c.urlParams_.Set("alt", alt)
  11320. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11321. urls += "?" + c.urlParams_.Encode()
  11322. req, _ := http.NewRequest("PUT", urls, body)
  11323. req.Header = reqHeaders
  11324. googleapi.Expand(req.URL, map[string]string{
  11325. "path": c.path,
  11326. })
  11327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11328. }
  11329. // Do executes the "tagmanager.accounts.containers.workspaces.triggers.update" call.
  11330. // Exactly one of *Trigger or error will be non-nil. Any non-2xx status
  11331. // code is an error. Response headers are in either
  11332. // *Trigger.ServerResponse.Header or (if a response was returned at all)
  11333. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11334. // check whether the returned error was because http.StatusNotModified
  11335. // was returned.
  11336. func (c *AccountsContainersWorkspacesTriggersUpdateCall) Do(opts ...googleapi.CallOption) (*Trigger, error) {
  11337. gensupport.SetOptions(c.urlParams_, opts...)
  11338. res, err := c.doRequest("json")
  11339. if res != nil && res.StatusCode == http.StatusNotModified {
  11340. if res.Body != nil {
  11341. res.Body.Close()
  11342. }
  11343. return nil, &googleapi.Error{
  11344. Code: res.StatusCode,
  11345. Header: res.Header,
  11346. }
  11347. }
  11348. if err != nil {
  11349. return nil, err
  11350. }
  11351. defer googleapi.CloseBody(res)
  11352. if err := googleapi.CheckResponse(res); err != nil {
  11353. return nil, err
  11354. }
  11355. ret := &Trigger{
  11356. ServerResponse: googleapi.ServerResponse{
  11357. Header: res.Header,
  11358. HTTPStatusCode: res.StatusCode,
  11359. },
  11360. }
  11361. target := &ret
  11362. if err := gensupport.DecodeResponse(target, res); err != nil {
  11363. return nil, err
  11364. }
  11365. return ret, nil
  11366. // {
  11367. // "description": "Updates a GTM Trigger.",
  11368. // "httpMethod": "PUT",
  11369. // "id": "tagmanager.accounts.containers.workspaces.triggers.update",
  11370. // "parameterOrder": [
  11371. // "path"
  11372. // ],
  11373. // "parameters": {
  11374. // "fingerprint": {
  11375. // "description": "When provided, this fingerprint must match the fingerprint of the trigger in storage.",
  11376. // "location": "query",
  11377. // "type": "string"
  11378. // },
  11379. // "path": {
  11380. // "description": "GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id}",
  11381. // "location": "path",
  11382. // "required": true,
  11383. // "type": "string"
  11384. // }
  11385. // },
  11386. // "path": "{+path}",
  11387. // "request": {
  11388. // "$ref": "Trigger"
  11389. // },
  11390. // "response": {
  11391. // "$ref": "Trigger"
  11392. // },
  11393. // "scopes": [
  11394. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11395. // ]
  11396. // }
  11397. }
  11398. // method id "tagmanager.accounts.containers.workspaces.variables.create":
  11399. type AccountsContainersWorkspacesVariablesCreateCall struct {
  11400. s *Service
  11401. parent string
  11402. variable *Variable
  11403. urlParams_ gensupport.URLParams
  11404. ctx_ context.Context
  11405. header_ http.Header
  11406. }
  11407. // Create: Creates a GTM Variable.
  11408. func (r *AccountsContainersWorkspacesVariablesService) Create(parent string, variable *Variable) *AccountsContainersWorkspacesVariablesCreateCall {
  11409. c := &AccountsContainersWorkspacesVariablesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11410. c.parent = parent
  11411. c.variable = variable
  11412. return c
  11413. }
  11414. // Fields allows partial responses to be retrieved. See
  11415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11416. // for more information.
  11417. func (c *AccountsContainersWorkspacesVariablesCreateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesCreateCall {
  11418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11419. return c
  11420. }
  11421. // Context sets the context to be used in this call's Do method. Any
  11422. // pending HTTP request will be aborted if the provided context is
  11423. // canceled.
  11424. func (c *AccountsContainersWorkspacesVariablesCreateCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesCreateCall {
  11425. c.ctx_ = ctx
  11426. return c
  11427. }
  11428. // Header returns an http.Header that can be modified by the caller to
  11429. // add HTTP headers to the request.
  11430. func (c *AccountsContainersWorkspacesVariablesCreateCall) Header() http.Header {
  11431. if c.header_ == nil {
  11432. c.header_ = make(http.Header)
  11433. }
  11434. return c.header_
  11435. }
  11436. func (c *AccountsContainersWorkspacesVariablesCreateCall) doRequest(alt string) (*http.Response, error) {
  11437. reqHeaders := make(http.Header)
  11438. for k, v := range c.header_ {
  11439. reqHeaders[k] = v
  11440. }
  11441. reqHeaders.Set("User-Agent", c.s.userAgent())
  11442. var body io.Reader = nil
  11443. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  11444. if err != nil {
  11445. return nil, err
  11446. }
  11447. reqHeaders.Set("Content-Type", "application/json")
  11448. c.urlParams_.Set("alt", alt)
  11449. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/variables")
  11450. urls += "?" + c.urlParams_.Encode()
  11451. req, _ := http.NewRequest("POST", urls, body)
  11452. req.Header = reqHeaders
  11453. googleapi.Expand(req.URL, map[string]string{
  11454. "parent": c.parent,
  11455. })
  11456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11457. }
  11458. // Do executes the "tagmanager.accounts.containers.workspaces.variables.create" call.
  11459. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  11460. // code is an error. Response headers are in either
  11461. // *Variable.ServerResponse.Header or (if a response was returned at
  11462. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11463. // to check whether the returned error was because
  11464. // http.StatusNotModified was returned.
  11465. func (c *AccountsContainersWorkspacesVariablesCreateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  11466. gensupport.SetOptions(c.urlParams_, opts...)
  11467. res, err := c.doRequest("json")
  11468. if res != nil && res.StatusCode == http.StatusNotModified {
  11469. if res.Body != nil {
  11470. res.Body.Close()
  11471. }
  11472. return nil, &googleapi.Error{
  11473. Code: res.StatusCode,
  11474. Header: res.Header,
  11475. }
  11476. }
  11477. if err != nil {
  11478. return nil, err
  11479. }
  11480. defer googleapi.CloseBody(res)
  11481. if err := googleapi.CheckResponse(res); err != nil {
  11482. return nil, err
  11483. }
  11484. ret := &Variable{
  11485. ServerResponse: googleapi.ServerResponse{
  11486. Header: res.Header,
  11487. HTTPStatusCode: res.StatusCode,
  11488. },
  11489. }
  11490. target := &ret
  11491. if err := gensupport.DecodeResponse(target, res); err != nil {
  11492. return nil, err
  11493. }
  11494. return ret, nil
  11495. // {
  11496. // "description": "Creates a GTM Variable.",
  11497. // "httpMethod": "POST",
  11498. // "id": "tagmanager.accounts.containers.workspaces.variables.create",
  11499. // "parameterOrder": [
  11500. // "parent"
  11501. // ],
  11502. // "parameters": {
  11503. // "parent": {
  11504. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  11505. // "location": "path",
  11506. // "required": true,
  11507. // "type": "string"
  11508. // }
  11509. // },
  11510. // "path": "{+parent}/variables",
  11511. // "request": {
  11512. // "$ref": "Variable"
  11513. // },
  11514. // "response": {
  11515. // "$ref": "Variable"
  11516. // },
  11517. // "scopes": [
  11518. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11519. // ]
  11520. // }
  11521. }
  11522. // method id "tagmanager.accounts.containers.workspaces.variables.delete":
  11523. type AccountsContainersWorkspacesVariablesDeleteCall struct {
  11524. s *Service
  11525. path string
  11526. urlParams_ gensupport.URLParams
  11527. ctx_ context.Context
  11528. header_ http.Header
  11529. }
  11530. // Delete: Deletes a GTM Variable.
  11531. func (r *AccountsContainersWorkspacesVariablesService) Delete(path string) *AccountsContainersWorkspacesVariablesDeleteCall {
  11532. c := &AccountsContainersWorkspacesVariablesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11533. c.path = path
  11534. return c
  11535. }
  11536. // Fields allows partial responses to be retrieved. See
  11537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11538. // for more information.
  11539. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesDeleteCall {
  11540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11541. return c
  11542. }
  11543. // Context sets the context to be used in this call's Do method. Any
  11544. // pending HTTP request will be aborted if the provided context is
  11545. // canceled.
  11546. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesDeleteCall {
  11547. c.ctx_ = ctx
  11548. return c
  11549. }
  11550. // Header returns an http.Header that can be modified by the caller to
  11551. // add HTTP headers to the request.
  11552. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Header() http.Header {
  11553. if c.header_ == nil {
  11554. c.header_ = make(http.Header)
  11555. }
  11556. return c.header_
  11557. }
  11558. func (c *AccountsContainersWorkspacesVariablesDeleteCall) doRequest(alt string) (*http.Response, error) {
  11559. reqHeaders := make(http.Header)
  11560. for k, v := range c.header_ {
  11561. reqHeaders[k] = v
  11562. }
  11563. reqHeaders.Set("User-Agent", c.s.userAgent())
  11564. var body io.Reader = nil
  11565. c.urlParams_.Set("alt", alt)
  11566. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11567. urls += "?" + c.urlParams_.Encode()
  11568. req, _ := http.NewRequest("DELETE", urls, body)
  11569. req.Header = reqHeaders
  11570. googleapi.Expand(req.URL, map[string]string{
  11571. "path": c.path,
  11572. })
  11573. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11574. }
  11575. // Do executes the "tagmanager.accounts.containers.workspaces.variables.delete" call.
  11576. func (c *AccountsContainersWorkspacesVariablesDeleteCall) Do(opts ...googleapi.CallOption) error {
  11577. gensupport.SetOptions(c.urlParams_, opts...)
  11578. res, err := c.doRequest("json")
  11579. if err != nil {
  11580. return err
  11581. }
  11582. defer googleapi.CloseBody(res)
  11583. if err := googleapi.CheckResponse(res); err != nil {
  11584. return err
  11585. }
  11586. return nil
  11587. // {
  11588. // "description": "Deletes a GTM Variable.",
  11589. // "httpMethod": "DELETE",
  11590. // "id": "tagmanager.accounts.containers.workspaces.variables.delete",
  11591. // "parameterOrder": [
  11592. // "path"
  11593. // ],
  11594. // "parameters": {
  11595. // "path": {
  11596. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  11597. // "location": "path",
  11598. // "required": true,
  11599. // "type": "string"
  11600. // }
  11601. // },
  11602. // "path": "{+path}",
  11603. // "scopes": [
  11604. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  11605. // ]
  11606. // }
  11607. }
  11608. // method id "tagmanager.accounts.containers.workspaces.variables.get":
  11609. type AccountsContainersWorkspacesVariablesGetCall struct {
  11610. s *Service
  11611. path string
  11612. urlParams_ gensupport.URLParams
  11613. ifNoneMatch_ string
  11614. ctx_ context.Context
  11615. header_ http.Header
  11616. }
  11617. // Get: Gets a GTM Variable.
  11618. func (r *AccountsContainersWorkspacesVariablesService) Get(path string) *AccountsContainersWorkspacesVariablesGetCall {
  11619. c := &AccountsContainersWorkspacesVariablesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11620. c.path = path
  11621. return c
  11622. }
  11623. // Fields allows partial responses to be retrieved. See
  11624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11625. // for more information.
  11626. func (c *AccountsContainersWorkspacesVariablesGetCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesGetCall {
  11627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11628. return c
  11629. }
  11630. // IfNoneMatch sets the optional parameter which makes the operation
  11631. // fail if the object's ETag matches the given value. This is useful for
  11632. // getting updates only after the object has changed since the last
  11633. // request. Use googleapi.IsNotModified to check whether the response
  11634. // error from Do is the result of In-None-Match.
  11635. func (c *AccountsContainersWorkspacesVariablesGetCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesVariablesGetCall {
  11636. c.ifNoneMatch_ = entityTag
  11637. return c
  11638. }
  11639. // Context sets the context to be used in this call's Do method. Any
  11640. // pending HTTP request will be aborted if the provided context is
  11641. // canceled.
  11642. func (c *AccountsContainersWorkspacesVariablesGetCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesGetCall {
  11643. c.ctx_ = ctx
  11644. return c
  11645. }
  11646. // Header returns an http.Header that can be modified by the caller to
  11647. // add HTTP headers to the request.
  11648. func (c *AccountsContainersWorkspacesVariablesGetCall) Header() http.Header {
  11649. if c.header_ == nil {
  11650. c.header_ = make(http.Header)
  11651. }
  11652. return c.header_
  11653. }
  11654. func (c *AccountsContainersWorkspacesVariablesGetCall) doRequest(alt string) (*http.Response, error) {
  11655. reqHeaders := make(http.Header)
  11656. for k, v := range c.header_ {
  11657. reqHeaders[k] = v
  11658. }
  11659. reqHeaders.Set("User-Agent", c.s.userAgent())
  11660. if c.ifNoneMatch_ != "" {
  11661. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11662. }
  11663. var body io.Reader = nil
  11664. c.urlParams_.Set("alt", alt)
  11665. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  11666. urls += "?" + c.urlParams_.Encode()
  11667. req, _ := http.NewRequest("GET", urls, body)
  11668. req.Header = reqHeaders
  11669. googleapi.Expand(req.URL, map[string]string{
  11670. "path": c.path,
  11671. })
  11672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11673. }
  11674. // Do executes the "tagmanager.accounts.containers.workspaces.variables.get" call.
  11675. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  11676. // code is an error. Response headers are in either
  11677. // *Variable.ServerResponse.Header or (if a response was returned at
  11678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11679. // to check whether the returned error was because
  11680. // http.StatusNotModified was returned.
  11681. func (c *AccountsContainersWorkspacesVariablesGetCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  11682. gensupport.SetOptions(c.urlParams_, opts...)
  11683. res, err := c.doRequest("json")
  11684. if res != nil && res.StatusCode == http.StatusNotModified {
  11685. if res.Body != nil {
  11686. res.Body.Close()
  11687. }
  11688. return nil, &googleapi.Error{
  11689. Code: res.StatusCode,
  11690. Header: res.Header,
  11691. }
  11692. }
  11693. if err != nil {
  11694. return nil, err
  11695. }
  11696. defer googleapi.CloseBody(res)
  11697. if err := googleapi.CheckResponse(res); err != nil {
  11698. return nil, err
  11699. }
  11700. ret := &Variable{
  11701. ServerResponse: googleapi.ServerResponse{
  11702. Header: res.Header,
  11703. HTTPStatusCode: res.StatusCode,
  11704. },
  11705. }
  11706. target := &ret
  11707. if err := gensupport.DecodeResponse(target, res); err != nil {
  11708. return nil, err
  11709. }
  11710. return ret, nil
  11711. // {
  11712. // "description": "Gets a GTM Variable.",
  11713. // "httpMethod": "GET",
  11714. // "id": "tagmanager.accounts.containers.workspaces.variables.get",
  11715. // "parameterOrder": [
  11716. // "path"
  11717. // ],
  11718. // "parameters": {
  11719. // "path": {
  11720. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  11721. // "location": "path",
  11722. // "required": true,
  11723. // "type": "string"
  11724. // }
  11725. // },
  11726. // "path": "{+path}",
  11727. // "response": {
  11728. // "$ref": "Variable"
  11729. // },
  11730. // "scopes": [
  11731. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  11732. // "https://www.googleapis.com/auth/tagmanager.readonly"
  11733. // ]
  11734. // }
  11735. }
  11736. // method id "tagmanager.accounts.containers.workspaces.variables.list":
  11737. type AccountsContainersWorkspacesVariablesListCall struct {
  11738. s *Service
  11739. parent string
  11740. urlParams_ gensupport.URLParams
  11741. ifNoneMatch_ string
  11742. ctx_ context.Context
  11743. header_ http.Header
  11744. }
  11745. // List: Lists all GTM Variables of a Container.
  11746. func (r *AccountsContainersWorkspacesVariablesService) List(parent string) *AccountsContainersWorkspacesVariablesListCall {
  11747. c := &AccountsContainersWorkspacesVariablesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11748. c.parent = parent
  11749. return c
  11750. }
  11751. // PageToken sets the optional parameter "pageToken": Continuation token
  11752. // for fetching the next page of results.
  11753. func (c *AccountsContainersWorkspacesVariablesListCall) PageToken(pageToken string) *AccountsContainersWorkspacesVariablesListCall {
  11754. c.urlParams_.Set("pageToken", pageToken)
  11755. return c
  11756. }
  11757. // Fields allows partial responses to be retrieved. See
  11758. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11759. // for more information.
  11760. func (c *AccountsContainersWorkspacesVariablesListCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesListCall {
  11761. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11762. return c
  11763. }
  11764. // IfNoneMatch sets the optional parameter which makes the operation
  11765. // fail if the object's ETag matches the given value. This is useful for
  11766. // getting updates only after the object has changed since the last
  11767. // request. Use googleapi.IsNotModified to check whether the response
  11768. // error from Do is the result of In-None-Match.
  11769. func (c *AccountsContainersWorkspacesVariablesListCall) IfNoneMatch(entityTag string) *AccountsContainersWorkspacesVariablesListCall {
  11770. c.ifNoneMatch_ = entityTag
  11771. return c
  11772. }
  11773. // Context sets the context to be used in this call's Do method. Any
  11774. // pending HTTP request will be aborted if the provided context is
  11775. // canceled.
  11776. func (c *AccountsContainersWorkspacesVariablesListCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesListCall {
  11777. c.ctx_ = ctx
  11778. return c
  11779. }
  11780. // Header returns an http.Header that can be modified by the caller to
  11781. // add HTTP headers to the request.
  11782. func (c *AccountsContainersWorkspacesVariablesListCall) Header() http.Header {
  11783. if c.header_ == nil {
  11784. c.header_ = make(http.Header)
  11785. }
  11786. return c.header_
  11787. }
  11788. func (c *AccountsContainersWorkspacesVariablesListCall) doRequest(alt string) (*http.Response, error) {
  11789. reqHeaders := make(http.Header)
  11790. for k, v := range c.header_ {
  11791. reqHeaders[k] = v
  11792. }
  11793. reqHeaders.Set("User-Agent", c.s.userAgent())
  11794. if c.ifNoneMatch_ != "" {
  11795. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11796. }
  11797. var body io.Reader = nil
  11798. c.urlParams_.Set("alt", alt)
  11799. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/variables")
  11800. urls += "?" + c.urlParams_.Encode()
  11801. req, _ := http.NewRequest("GET", urls, body)
  11802. req.Header = reqHeaders
  11803. googleapi.Expand(req.URL, map[string]string{
  11804. "parent": c.parent,
  11805. })
  11806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11807. }
  11808. // Do executes the "tagmanager.accounts.containers.workspaces.variables.list" call.
  11809. // Exactly one of *ListVariablesResponse or error will be non-nil. Any
  11810. // non-2xx status code is an error. Response headers are in either
  11811. // *ListVariablesResponse.ServerResponse.Header or (if a response was
  11812. // returned at all) in error.(*googleapi.Error).Header. Use
  11813. // googleapi.IsNotModified to check whether the returned error was
  11814. // because http.StatusNotModified was returned.
  11815. func (c *AccountsContainersWorkspacesVariablesListCall) Do(opts ...googleapi.CallOption) (*ListVariablesResponse, error) {
  11816. gensupport.SetOptions(c.urlParams_, opts...)
  11817. res, err := c.doRequest("json")
  11818. if res != nil && res.StatusCode == http.StatusNotModified {
  11819. if res.Body != nil {
  11820. res.Body.Close()
  11821. }
  11822. return nil, &googleapi.Error{
  11823. Code: res.StatusCode,
  11824. Header: res.Header,
  11825. }
  11826. }
  11827. if err != nil {
  11828. return nil, err
  11829. }
  11830. defer googleapi.CloseBody(res)
  11831. if err := googleapi.CheckResponse(res); err != nil {
  11832. return nil, err
  11833. }
  11834. ret := &ListVariablesResponse{
  11835. ServerResponse: googleapi.ServerResponse{
  11836. Header: res.Header,
  11837. HTTPStatusCode: res.StatusCode,
  11838. },
  11839. }
  11840. target := &ret
  11841. if err := gensupport.DecodeResponse(target, res); err != nil {
  11842. return nil, err
  11843. }
  11844. return ret, nil
  11845. // {
  11846. // "description": "Lists all GTM Variables of a Container.",
  11847. // "httpMethod": "GET",
  11848. // "id": "tagmanager.accounts.containers.workspaces.variables.list",
  11849. // "parameterOrder": [
  11850. // "parent"
  11851. // ],
  11852. // "parameters": {
  11853. // "pageToken": {
  11854. // "description": "Continuation token for fetching the next page of results.",
  11855. // "location": "query",
  11856. // "type": "string"
  11857. // },
  11858. // "parent": {
  11859. // "description": "GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}",
  11860. // "location": "path",
  11861. // "required": true,
  11862. // "type": "string"
  11863. // }
  11864. // },
  11865. // "path": "{+parent}/variables",
  11866. // "response": {
  11867. // "$ref": "ListVariablesResponse"
  11868. // },
  11869. // "scopes": [
  11870. // "https://www.googleapis.com/auth/tagmanager.edit.containers",
  11871. // "https://www.googleapis.com/auth/tagmanager.readonly"
  11872. // ]
  11873. // }
  11874. }
  11875. // Pages invokes f for each page of results.
  11876. // A non-nil error returned from f will halt the iteration.
  11877. // The provided context supersedes any context provided to the Context method.
  11878. func (c *AccountsContainersWorkspacesVariablesListCall) Pages(ctx context.Context, f func(*ListVariablesResponse) error) error {
  11879. c.ctx_ = ctx
  11880. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11881. for {
  11882. x, err := c.Do()
  11883. if err != nil {
  11884. return err
  11885. }
  11886. if err := f(x); err != nil {
  11887. return err
  11888. }
  11889. if x.NextPageToken == "" {
  11890. return nil
  11891. }
  11892. c.PageToken(x.NextPageToken)
  11893. }
  11894. }
  11895. // method id "tagmanager.accounts.containers.workspaces.variables.revert":
  11896. type AccountsContainersWorkspacesVariablesRevertCall struct {
  11897. s *Service
  11898. path string
  11899. urlParams_ gensupport.URLParams
  11900. ctx_ context.Context
  11901. header_ http.Header
  11902. }
  11903. // Revert: Reverts changes to a GTM Variable in a GTM Workspace.
  11904. func (r *AccountsContainersWorkspacesVariablesService) Revert(path string) *AccountsContainersWorkspacesVariablesRevertCall {
  11905. c := &AccountsContainersWorkspacesVariablesRevertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11906. c.path = path
  11907. return c
  11908. }
  11909. // Fingerprint sets the optional parameter "fingerprint": When provided,
  11910. // this fingerprint must match the fingerprint of the variable in
  11911. // storage.
  11912. func (c *AccountsContainersWorkspacesVariablesRevertCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesVariablesRevertCall {
  11913. c.urlParams_.Set("fingerprint", fingerprint)
  11914. return c
  11915. }
  11916. // Fields allows partial responses to be retrieved. See
  11917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11918. // for more information.
  11919. func (c *AccountsContainersWorkspacesVariablesRevertCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesRevertCall {
  11920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11921. return c
  11922. }
  11923. // Context sets the context to be used in this call's Do method. Any
  11924. // pending HTTP request will be aborted if the provided context is
  11925. // canceled.
  11926. func (c *AccountsContainersWorkspacesVariablesRevertCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesRevertCall {
  11927. c.ctx_ = ctx
  11928. return c
  11929. }
  11930. // Header returns an http.Header that can be modified by the caller to
  11931. // add HTTP headers to the request.
  11932. func (c *AccountsContainersWorkspacesVariablesRevertCall) Header() http.Header {
  11933. if c.header_ == nil {
  11934. c.header_ = make(http.Header)
  11935. }
  11936. return c.header_
  11937. }
  11938. func (c *AccountsContainersWorkspacesVariablesRevertCall) doRequest(alt string) (*http.Response, error) {
  11939. reqHeaders := make(http.Header)
  11940. for k, v := range c.header_ {
  11941. reqHeaders[k] = v
  11942. }
  11943. reqHeaders.Set("User-Agent", c.s.userAgent())
  11944. var body io.Reader = nil
  11945. c.urlParams_.Set("alt", alt)
  11946. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}:revert")
  11947. urls += "?" + c.urlParams_.Encode()
  11948. req, _ := http.NewRequest("POST", urls, body)
  11949. req.Header = reqHeaders
  11950. googleapi.Expand(req.URL, map[string]string{
  11951. "path": c.path,
  11952. })
  11953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11954. }
  11955. // Do executes the "tagmanager.accounts.containers.workspaces.variables.revert" call.
  11956. // Exactly one of *RevertVariableResponse or error will be non-nil. Any
  11957. // non-2xx status code is an error. Response headers are in either
  11958. // *RevertVariableResponse.ServerResponse.Header or (if a response was
  11959. // returned at all) in error.(*googleapi.Error).Header. Use
  11960. // googleapi.IsNotModified to check whether the returned error was
  11961. // because http.StatusNotModified was returned.
  11962. func (c *AccountsContainersWorkspacesVariablesRevertCall) Do(opts ...googleapi.CallOption) (*RevertVariableResponse, error) {
  11963. gensupport.SetOptions(c.urlParams_, opts...)
  11964. res, err := c.doRequest("json")
  11965. if res != nil && res.StatusCode == http.StatusNotModified {
  11966. if res.Body != nil {
  11967. res.Body.Close()
  11968. }
  11969. return nil, &googleapi.Error{
  11970. Code: res.StatusCode,
  11971. Header: res.Header,
  11972. }
  11973. }
  11974. if err != nil {
  11975. return nil, err
  11976. }
  11977. defer googleapi.CloseBody(res)
  11978. if err := googleapi.CheckResponse(res); err != nil {
  11979. return nil, err
  11980. }
  11981. ret := &RevertVariableResponse{
  11982. ServerResponse: googleapi.ServerResponse{
  11983. Header: res.Header,
  11984. HTTPStatusCode: res.StatusCode,
  11985. },
  11986. }
  11987. target := &ret
  11988. if err := gensupport.DecodeResponse(target, res); err != nil {
  11989. return nil, err
  11990. }
  11991. return ret, nil
  11992. // {
  11993. // "description": "Reverts changes to a GTM Variable in a GTM Workspace.",
  11994. // "httpMethod": "POST",
  11995. // "id": "tagmanager.accounts.containers.workspaces.variables.revert",
  11996. // "parameterOrder": [
  11997. // "path"
  11998. // ],
  11999. // "parameters": {
  12000. // "fingerprint": {
  12001. // "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.",
  12002. // "location": "query",
  12003. // "type": "string"
  12004. // },
  12005. // "path": {
  12006. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  12007. // "location": "path",
  12008. // "required": true,
  12009. // "type": "string"
  12010. // }
  12011. // },
  12012. // "path": "{+path}:revert",
  12013. // "response": {
  12014. // "$ref": "RevertVariableResponse"
  12015. // },
  12016. // "scopes": [
  12017. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  12018. // ]
  12019. // }
  12020. }
  12021. // method id "tagmanager.accounts.containers.workspaces.variables.update":
  12022. type AccountsContainersWorkspacesVariablesUpdateCall struct {
  12023. s *Service
  12024. path string
  12025. variable *Variable
  12026. urlParams_ gensupport.URLParams
  12027. ctx_ context.Context
  12028. header_ http.Header
  12029. }
  12030. // Update: Updates a GTM Variable.
  12031. func (r *AccountsContainersWorkspacesVariablesService) Update(path string, variable *Variable) *AccountsContainersWorkspacesVariablesUpdateCall {
  12032. c := &AccountsContainersWorkspacesVariablesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12033. c.path = path
  12034. c.variable = variable
  12035. return c
  12036. }
  12037. // Fingerprint sets the optional parameter "fingerprint": When provided,
  12038. // this fingerprint must match the fingerprint of the variable in
  12039. // storage.
  12040. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Fingerprint(fingerprint string) *AccountsContainersWorkspacesVariablesUpdateCall {
  12041. c.urlParams_.Set("fingerprint", fingerprint)
  12042. return c
  12043. }
  12044. // Fields allows partial responses to be retrieved. See
  12045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12046. // for more information.
  12047. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Fields(s ...googleapi.Field) *AccountsContainersWorkspacesVariablesUpdateCall {
  12048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12049. return c
  12050. }
  12051. // Context sets the context to be used in this call's Do method. Any
  12052. // pending HTTP request will be aborted if the provided context is
  12053. // canceled.
  12054. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Context(ctx context.Context) *AccountsContainersWorkspacesVariablesUpdateCall {
  12055. c.ctx_ = ctx
  12056. return c
  12057. }
  12058. // Header returns an http.Header that can be modified by the caller to
  12059. // add HTTP headers to the request.
  12060. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Header() http.Header {
  12061. if c.header_ == nil {
  12062. c.header_ = make(http.Header)
  12063. }
  12064. return c.header_
  12065. }
  12066. func (c *AccountsContainersWorkspacesVariablesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12067. reqHeaders := make(http.Header)
  12068. for k, v := range c.header_ {
  12069. reqHeaders[k] = v
  12070. }
  12071. reqHeaders.Set("User-Agent", c.s.userAgent())
  12072. var body io.Reader = nil
  12073. body, err := googleapi.WithoutDataWrapper.JSONReader(c.variable)
  12074. if err != nil {
  12075. return nil, err
  12076. }
  12077. reqHeaders.Set("Content-Type", "application/json")
  12078. c.urlParams_.Set("alt", alt)
  12079. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12080. urls += "?" + c.urlParams_.Encode()
  12081. req, _ := http.NewRequest("PUT", urls, body)
  12082. req.Header = reqHeaders
  12083. googleapi.Expand(req.URL, map[string]string{
  12084. "path": c.path,
  12085. })
  12086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12087. }
  12088. // Do executes the "tagmanager.accounts.containers.workspaces.variables.update" call.
  12089. // Exactly one of *Variable or error will be non-nil. Any non-2xx status
  12090. // code is an error. Response headers are in either
  12091. // *Variable.ServerResponse.Header or (if a response was returned at
  12092. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12093. // to check whether the returned error was because
  12094. // http.StatusNotModified was returned.
  12095. func (c *AccountsContainersWorkspacesVariablesUpdateCall) Do(opts ...googleapi.CallOption) (*Variable, error) {
  12096. gensupport.SetOptions(c.urlParams_, opts...)
  12097. res, err := c.doRequest("json")
  12098. if res != nil && res.StatusCode == http.StatusNotModified {
  12099. if res.Body != nil {
  12100. res.Body.Close()
  12101. }
  12102. return nil, &googleapi.Error{
  12103. Code: res.StatusCode,
  12104. Header: res.Header,
  12105. }
  12106. }
  12107. if err != nil {
  12108. return nil, err
  12109. }
  12110. defer googleapi.CloseBody(res)
  12111. if err := googleapi.CheckResponse(res); err != nil {
  12112. return nil, err
  12113. }
  12114. ret := &Variable{
  12115. ServerResponse: googleapi.ServerResponse{
  12116. Header: res.Header,
  12117. HTTPStatusCode: res.StatusCode,
  12118. },
  12119. }
  12120. target := &ret
  12121. if err := gensupport.DecodeResponse(target, res); err != nil {
  12122. return nil, err
  12123. }
  12124. return ret, nil
  12125. // {
  12126. // "description": "Updates a GTM Variable.",
  12127. // "httpMethod": "PUT",
  12128. // "id": "tagmanager.accounts.containers.workspaces.variables.update",
  12129. // "parameterOrder": [
  12130. // "path"
  12131. // ],
  12132. // "parameters": {
  12133. // "fingerprint": {
  12134. // "description": "When provided, this fingerprint must match the fingerprint of the variable in storage.",
  12135. // "location": "query",
  12136. // "type": "string"
  12137. // },
  12138. // "path": {
  12139. // "description": "GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id}",
  12140. // "location": "path",
  12141. // "required": true,
  12142. // "type": "string"
  12143. // }
  12144. // },
  12145. // "path": "{+path}",
  12146. // "request": {
  12147. // "$ref": "Variable"
  12148. // },
  12149. // "response": {
  12150. // "$ref": "Variable"
  12151. // },
  12152. // "scopes": [
  12153. // "https://www.googleapis.com/auth/tagmanager.edit.containers"
  12154. // ]
  12155. // }
  12156. }
  12157. // method id "tagmanager.accounts.user_permissions.create":
  12158. type AccountsUserPermissionsCreateCall struct {
  12159. s *Service
  12160. parent string
  12161. userpermission *UserPermission
  12162. urlParams_ gensupport.URLParams
  12163. ctx_ context.Context
  12164. header_ http.Header
  12165. }
  12166. // Create: Creates a user's Account & Container access.
  12167. func (r *AccountsUserPermissionsService) Create(parent string, userpermission *UserPermission) *AccountsUserPermissionsCreateCall {
  12168. c := &AccountsUserPermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12169. c.parent = parent
  12170. c.userpermission = userpermission
  12171. return c
  12172. }
  12173. // Fields allows partial responses to be retrieved. See
  12174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12175. // for more information.
  12176. func (c *AccountsUserPermissionsCreateCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsCreateCall {
  12177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12178. return c
  12179. }
  12180. // Context sets the context to be used in this call's Do method. Any
  12181. // pending HTTP request will be aborted if the provided context is
  12182. // canceled.
  12183. func (c *AccountsUserPermissionsCreateCall) Context(ctx context.Context) *AccountsUserPermissionsCreateCall {
  12184. c.ctx_ = ctx
  12185. return c
  12186. }
  12187. // Header returns an http.Header that can be modified by the caller to
  12188. // add HTTP headers to the request.
  12189. func (c *AccountsUserPermissionsCreateCall) Header() http.Header {
  12190. if c.header_ == nil {
  12191. c.header_ = make(http.Header)
  12192. }
  12193. return c.header_
  12194. }
  12195. func (c *AccountsUserPermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
  12196. reqHeaders := make(http.Header)
  12197. for k, v := range c.header_ {
  12198. reqHeaders[k] = v
  12199. }
  12200. reqHeaders.Set("User-Agent", c.s.userAgent())
  12201. var body io.Reader = nil
  12202. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userpermission)
  12203. if err != nil {
  12204. return nil, err
  12205. }
  12206. reqHeaders.Set("Content-Type", "application/json")
  12207. c.urlParams_.Set("alt", alt)
  12208. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/user_permissions")
  12209. urls += "?" + c.urlParams_.Encode()
  12210. req, _ := http.NewRequest("POST", urls, body)
  12211. req.Header = reqHeaders
  12212. googleapi.Expand(req.URL, map[string]string{
  12213. "parent": c.parent,
  12214. })
  12215. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12216. }
  12217. // Do executes the "tagmanager.accounts.user_permissions.create" call.
  12218. // Exactly one of *UserPermission or error will be non-nil. Any non-2xx
  12219. // status code is an error. Response headers are in either
  12220. // *UserPermission.ServerResponse.Header or (if a response was returned
  12221. // at all) in error.(*googleapi.Error).Header. Use
  12222. // googleapi.IsNotModified to check whether the returned error was
  12223. // because http.StatusNotModified was returned.
  12224. func (c *AccountsUserPermissionsCreateCall) Do(opts ...googleapi.CallOption) (*UserPermission, error) {
  12225. gensupport.SetOptions(c.urlParams_, opts...)
  12226. res, err := c.doRequest("json")
  12227. if res != nil && res.StatusCode == http.StatusNotModified {
  12228. if res.Body != nil {
  12229. res.Body.Close()
  12230. }
  12231. return nil, &googleapi.Error{
  12232. Code: res.StatusCode,
  12233. Header: res.Header,
  12234. }
  12235. }
  12236. if err != nil {
  12237. return nil, err
  12238. }
  12239. defer googleapi.CloseBody(res)
  12240. if err := googleapi.CheckResponse(res); err != nil {
  12241. return nil, err
  12242. }
  12243. ret := &UserPermission{
  12244. ServerResponse: googleapi.ServerResponse{
  12245. Header: res.Header,
  12246. HTTPStatusCode: res.StatusCode,
  12247. },
  12248. }
  12249. target := &ret
  12250. if err := gensupport.DecodeResponse(target, res); err != nil {
  12251. return nil, err
  12252. }
  12253. return ret, nil
  12254. // {
  12255. // "description": "Creates a user's Account \u0026 Container access.",
  12256. // "httpMethod": "POST",
  12257. // "id": "tagmanager.accounts.user_permissions.create",
  12258. // "parameterOrder": [
  12259. // "parent"
  12260. // ],
  12261. // "parameters": {
  12262. // "parent": {
  12263. // "description": "GTM Account's API relative path. Example: accounts/{account_id}",
  12264. // "location": "path",
  12265. // "required": true,
  12266. // "type": "string"
  12267. // }
  12268. // },
  12269. // "path": "{+parent}/user_permissions",
  12270. // "request": {
  12271. // "$ref": "UserPermission"
  12272. // },
  12273. // "response": {
  12274. // "$ref": "UserPermission"
  12275. // },
  12276. // "scopes": [
  12277. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12278. // ]
  12279. // }
  12280. }
  12281. // method id "tagmanager.accounts.user_permissions.delete":
  12282. type AccountsUserPermissionsDeleteCall struct {
  12283. s *Service
  12284. path string
  12285. urlParams_ gensupport.URLParams
  12286. ctx_ context.Context
  12287. header_ http.Header
  12288. }
  12289. // Delete: Removes a user from the account, revoking access to it and
  12290. // all of its containers.
  12291. func (r *AccountsUserPermissionsService) Delete(path string) *AccountsUserPermissionsDeleteCall {
  12292. c := &AccountsUserPermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12293. c.path = path
  12294. return c
  12295. }
  12296. // Fields allows partial responses to be retrieved. See
  12297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12298. // for more information.
  12299. func (c *AccountsUserPermissionsDeleteCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsDeleteCall {
  12300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12301. return c
  12302. }
  12303. // Context sets the context to be used in this call's Do method. Any
  12304. // pending HTTP request will be aborted if the provided context is
  12305. // canceled.
  12306. func (c *AccountsUserPermissionsDeleteCall) Context(ctx context.Context) *AccountsUserPermissionsDeleteCall {
  12307. c.ctx_ = ctx
  12308. return c
  12309. }
  12310. // Header returns an http.Header that can be modified by the caller to
  12311. // add HTTP headers to the request.
  12312. func (c *AccountsUserPermissionsDeleteCall) Header() http.Header {
  12313. if c.header_ == nil {
  12314. c.header_ = make(http.Header)
  12315. }
  12316. return c.header_
  12317. }
  12318. func (c *AccountsUserPermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  12319. reqHeaders := make(http.Header)
  12320. for k, v := range c.header_ {
  12321. reqHeaders[k] = v
  12322. }
  12323. reqHeaders.Set("User-Agent", c.s.userAgent())
  12324. var body io.Reader = nil
  12325. c.urlParams_.Set("alt", alt)
  12326. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12327. urls += "?" + c.urlParams_.Encode()
  12328. req, _ := http.NewRequest("DELETE", urls, body)
  12329. req.Header = reqHeaders
  12330. googleapi.Expand(req.URL, map[string]string{
  12331. "path": c.path,
  12332. })
  12333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12334. }
  12335. // Do executes the "tagmanager.accounts.user_permissions.delete" call.
  12336. func (c *AccountsUserPermissionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  12337. gensupport.SetOptions(c.urlParams_, opts...)
  12338. res, err := c.doRequest("json")
  12339. if err != nil {
  12340. return err
  12341. }
  12342. defer googleapi.CloseBody(res)
  12343. if err := googleapi.CheckResponse(res); err != nil {
  12344. return err
  12345. }
  12346. return nil
  12347. // {
  12348. // "description": "Removes a user from the account, revoking access to it and all of its containers.",
  12349. // "httpMethod": "DELETE",
  12350. // "id": "tagmanager.accounts.user_permissions.delete",
  12351. // "parameterOrder": [
  12352. // "path"
  12353. // ],
  12354. // "parameters": {
  12355. // "path": {
  12356. // "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}",
  12357. // "location": "path",
  12358. // "required": true,
  12359. // "type": "string"
  12360. // }
  12361. // },
  12362. // "path": "{+path}",
  12363. // "scopes": [
  12364. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12365. // ]
  12366. // }
  12367. }
  12368. // method id "tagmanager.accounts.user_permissions.get":
  12369. type AccountsUserPermissionsGetCall struct {
  12370. s *Service
  12371. path string
  12372. urlParams_ gensupport.URLParams
  12373. ifNoneMatch_ string
  12374. ctx_ context.Context
  12375. header_ http.Header
  12376. }
  12377. // Get: Gets a user's Account & Container access.
  12378. func (r *AccountsUserPermissionsService) Get(path string) *AccountsUserPermissionsGetCall {
  12379. c := &AccountsUserPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12380. c.path = path
  12381. return c
  12382. }
  12383. // Fields allows partial responses to be retrieved. See
  12384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12385. // for more information.
  12386. func (c *AccountsUserPermissionsGetCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsGetCall {
  12387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12388. return c
  12389. }
  12390. // IfNoneMatch sets the optional parameter which makes the operation
  12391. // fail if the object's ETag matches the given value. This is useful for
  12392. // getting updates only after the object has changed since the last
  12393. // request. Use googleapi.IsNotModified to check whether the response
  12394. // error from Do is the result of In-None-Match.
  12395. func (c *AccountsUserPermissionsGetCall) IfNoneMatch(entityTag string) *AccountsUserPermissionsGetCall {
  12396. c.ifNoneMatch_ = entityTag
  12397. return c
  12398. }
  12399. // Context sets the context to be used in this call's Do method. Any
  12400. // pending HTTP request will be aborted if the provided context is
  12401. // canceled.
  12402. func (c *AccountsUserPermissionsGetCall) Context(ctx context.Context) *AccountsUserPermissionsGetCall {
  12403. c.ctx_ = ctx
  12404. return c
  12405. }
  12406. // Header returns an http.Header that can be modified by the caller to
  12407. // add HTTP headers to the request.
  12408. func (c *AccountsUserPermissionsGetCall) Header() http.Header {
  12409. if c.header_ == nil {
  12410. c.header_ = make(http.Header)
  12411. }
  12412. return c.header_
  12413. }
  12414. func (c *AccountsUserPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12415. reqHeaders := make(http.Header)
  12416. for k, v := range c.header_ {
  12417. reqHeaders[k] = v
  12418. }
  12419. reqHeaders.Set("User-Agent", c.s.userAgent())
  12420. if c.ifNoneMatch_ != "" {
  12421. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12422. }
  12423. var body io.Reader = nil
  12424. c.urlParams_.Set("alt", alt)
  12425. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12426. urls += "?" + c.urlParams_.Encode()
  12427. req, _ := http.NewRequest("GET", urls, body)
  12428. req.Header = reqHeaders
  12429. googleapi.Expand(req.URL, map[string]string{
  12430. "path": c.path,
  12431. })
  12432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12433. }
  12434. // Do executes the "tagmanager.accounts.user_permissions.get" call.
  12435. // Exactly one of *UserPermission or error will be non-nil. Any non-2xx
  12436. // status code is an error. Response headers are in either
  12437. // *UserPermission.ServerResponse.Header or (if a response was returned
  12438. // at all) in error.(*googleapi.Error).Header. Use
  12439. // googleapi.IsNotModified to check whether the returned error was
  12440. // because http.StatusNotModified was returned.
  12441. func (c *AccountsUserPermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserPermission, error) {
  12442. gensupport.SetOptions(c.urlParams_, opts...)
  12443. res, err := c.doRequest("json")
  12444. if res != nil && res.StatusCode == http.StatusNotModified {
  12445. if res.Body != nil {
  12446. res.Body.Close()
  12447. }
  12448. return nil, &googleapi.Error{
  12449. Code: res.StatusCode,
  12450. Header: res.Header,
  12451. }
  12452. }
  12453. if err != nil {
  12454. return nil, err
  12455. }
  12456. defer googleapi.CloseBody(res)
  12457. if err := googleapi.CheckResponse(res); err != nil {
  12458. return nil, err
  12459. }
  12460. ret := &UserPermission{
  12461. ServerResponse: googleapi.ServerResponse{
  12462. Header: res.Header,
  12463. HTTPStatusCode: res.StatusCode,
  12464. },
  12465. }
  12466. target := &ret
  12467. if err := gensupport.DecodeResponse(target, res); err != nil {
  12468. return nil, err
  12469. }
  12470. return ret, nil
  12471. // {
  12472. // "description": "Gets a user's Account \u0026 Container access.",
  12473. // "httpMethod": "GET",
  12474. // "id": "tagmanager.accounts.user_permissions.get",
  12475. // "parameterOrder": [
  12476. // "path"
  12477. // ],
  12478. // "parameters": {
  12479. // "path": {
  12480. // "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}",
  12481. // "location": "path",
  12482. // "required": true,
  12483. // "type": "string"
  12484. // }
  12485. // },
  12486. // "path": "{+path}",
  12487. // "response": {
  12488. // "$ref": "UserPermission"
  12489. // },
  12490. // "scopes": [
  12491. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12492. // ]
  12493. // }
  12494. }
  12495. // method id "tagmanager.accounts.user_permissions.list":
  12496. type AccountsUserPermissionsListCall struct {
  12497. s *Service
  12498. parent string
  12499. urlParams_ gensupport.URLParams
  12500. ifNoneMatch_ string
  12501. ctx_ context.Context
  12502. header_ http.Header
  12503. }
  12504. // List: List all users that have access to the account along with
  12505. // Account and Container user access granted to each of them.
  12506. func (r *AccountsUserPermissionsService) List(parent string) *AccountsUserPermissionsListCall {
  12507. c := &AccountsUserPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12508. c.parent = parent
  12509. return c
  12510. }
  12511. // PageToken sets the optional parameter "pageToken": Continuation token
  12512. // for fetching the next page of results.
  12513. func (c *AccountsUserPermissionsListCall) PageToken(pageToken string) *AccountsUserPermissionsListCall {
  12514. c.urlParams_.Set("pageToken", pageToken)
  12515. return c
  12516. }
  12517. // Fields allows partial responses to be retrieved. See
  12518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12519. // for more information.
  12520. func (c *AccountsUserPermissionsListCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsListCall {
  12521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12522. return c
  12523. }
  12524. // IfNoneMatch sets the optional parameter which makes the operation
  12525. // fail if the object's ETag matches the given value. This is useful for
  12526. // getting updates only after the object has changed since the last
  12527. // request. Use googleapi.IsNotModified to check whether the response
  12528. // error from Do is the result of In-None-Match.
  12529. func (c *AccountsUserPermissionsListCall) IfNoneMatch(entityTag string) *AccountsUserPermissionsListCall {
  12530. c.ifNoneMatch_ = entityTag
  12531. return c
  12532. }
  12533. // Context sets the context to be used in this call's Do method. Any
  12534. // pending HTTP request will be aborted if the provided context is
  12535. // canceled.
  12536. func (c *AccountsUserPermissionsListCall) Context(ctx context.Context) *AccountsUserPermissionsListCall {
  12537. c.ctx_ = ctx
  12538. return c
  12539. }
  12540. // Header returns an http.Header that can be modified by the caller to
  12541. // add HTTP headers to the request.
  12542. func (c *AccountsUserPermissionsListCall) Header() http.Header {
  12543. if c.header_ == nil {
  12544. c.header_ = make(http.Header)
  12545. }
  12546. return c.header_
  12547. }
  12548. func (c *AccountsUserPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12549. reqHeaders := make(http.Header)
  12550. for k, v := range c.header_ {
  12551. reqHeaders[k] = v
  12552. }
  12553. reqHeaders.Set("User-Agent", c.s.userAgent())
  12554. if c.ifNoneMatch_ != "" {
  12555. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12556. }
  12557. var body io.Reader = nil
  12558. c.urlParams_.Set("alt", alt)
  12559. urls := googleapi.ResolveRelative(c.s.BasePath, "{+parent}/user_permissions")
  12560. urls += "?" + c.urlParams_.Encode()
  12561. req, _ := http.NewRequest("GET", urls, body)
  12562. req.Header = reqHeaders
  12563. googleapi.Expand(req.URL, map[string]string{
  12564. "parent": c.parent,
  12565. })
  12566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12567. }
  12568. // Do executes the "tagmanager.accounts.user_permissions.list" call.
  12569. // Exactly one of *ListUserPermissionsResponse or error will be non-nil.
  12570. // Any non-2xx status code is an error. Response headers are in either
  12571. // *ListUserPermissionsResponse.ServerResponse.Header or (if a response
  12572. // was returned at all) in error.(*googleapi.Error).Header. Use
  12573. // googleapi.IsNotModified to check whether the returned error was
  12574. // because http.StatusNotModified was returned.
  12575. func (c *AccountsUserPermissionsListCall) Do(opts ...googleapi.CallOption) (*ListUserPermissionsResponse, error) {
  12576. gensupport.SetOptions(c.urlParams_, opts...)
  12577. res, err := c.doRequest("json")
  12578. if res != nil && res.StatusCode == http.StatusNotModified {
  12579. if res.Body != nil {
  12580. res.Body.Close()
  12581. }
  12582. return nil, &googleapi.Error{
  12583. Code: res.StatusCode,
  12584. Header: res.Header,
  12585. }
  12586. }
  12587. if err != nil {
  12588. return nil, err
  12589. }
  12590. defer googleapi.CloseBody(res)
  12591. if err := googleapi.CheckResponse(res); err != nil {
  12592. return nil, err
  12593. }
  12594. ret := &ListUserPermissionsResponse{
  12595. ServerResponse: googleapi.ServerResponse{
  12596. Header: res.Header,
  12597. HTTPStatusCode: res.StatusCode,
  12598. },
  12599. }
  12600. target := &ret
  12601. if err := gensupport.DecodeResponse(target, res); err != nil {
  12602. return nil, err
  12603. }
  12604. return ret, nil
  12605. // {
  12606. // "description": "List all users that have access to the account along with Account and Container user access granted to each of them.",
  12607. // "httpMethod": "GET",
  12608. // "id": "tagmanager.accounts.user_permissions.list",
  12609. // "parameterOrder": [
  12610. // "parent"
  12611. // ],
  12612. // "parameters": {
  12613. // "pageToken": {
  12614. // "description": "Continuation token for fetching the next page of results.",
  12615. // "location": "query",
  12616. // "type": "string"
  12617. // },
  12618. // "parent": {
  12619. // "description": "GTM Accounts's API relative path. Example: accounts/{account_id}",
  12620. // "location": "path",
  12621. // "required": true,
  12622. // "type": "string"
  12623. // }
  12624. // },
  12625. // "path": "{+parent}/user_permissions",
  12626. // "response": {
  12627. // "$ref": "ListUserPermissionsResponse"
  12628. // },
  12629. // "scopes": [
  12630. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12631. // ]
  12632. // }
  12633. }
  12634. // Pages invokes f for each page of results.
  12635. // A non-nil error returned from f will halt the iteration.
  12636. // The provided context supersedes any context provided to the Context method.
  12637. func (c *AccountsUserPermissionsListCall) Pages(ctx context.Context, f func(*ListUserPermissionsResponse) error) error {
  12638. c.ctx_ = ctx
  12639. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12640. for {
  12641. x, err := c.Do()
  12642. if err != nil {
  12643. return err
  12644. }
  12645. if err := f(x); err != nil {
  12646. return err
  12647. }
  12648. if x.NextPageToken == "" {
  12649. return nil
  12650. }
  12651. c.PageToken(x.NextPageToken)
  12652. }
  12653. }
  12654. // method id "tagmanager.accounts.user_permissions.update":
  12655. type AccountsUserPermissionsUpdateCall struct {
  12656. s *Service
  12657. path string
  12658. userpermission *UserPermission
  12659. urlParams_ gensupport.URLParams
  12660. ctx_ context.Context
  12661. header_ http.Header
  12662. }
  12663. // Update: Updates a user's Account & Container access.
  12664. func (r *AccountsUserPermissionsService) Update(path string, userpermission *UserPermission) *AccountsUserPermissionsUpdateCall {
  12665. c := &AccountsUserPermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12666. c.path = path
  12667. c.userpermission = userpermission
  12668. return c
  12669. }
  12670. // Fields allows partial responses to be retrieved. See
  12671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12672. // for more information.
  12673. func (c *AccountsUserPermissionsUpdateCall) Fields(s ...googleapi.Field) *AccountsUserPermissionsUpdateCall {
  12674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12675. return c
  12676. }
  12677. // Context sets the context to be used in this call's Do method. Any
  12678. // pending HTTP request will be aborted if the provided context is
  12679. // canceled.
  12680. func (c *AccountsUserPermissionsUpdateCall) Context(ctx context.Context) *AccountsUserPermissionsUpdateCall {
  12681. c.ctx_ = ctx
  12682. return c
  12683. }
  12684. // Header returns an http.Header that can be modified by the caller to
  12685. // add HTTP headers to the request.
  12686. func (c *AccountsUserPermissionsUpdateCall) Header() http.Header {
  12687. if c.header_ == nil {
  12688. c.header_ = make(http.Header)
  12689. }
  12690. return c.header_
  12691. }
  12692. func (c *AccountsUserPermissionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12693. reqHeaders := make(http.Header)
  12694. for k, v := range c.header_ {
  12695. reqHeaders[k] = v
  12696. }
  12697. reqHeaders.Set("User-Agent", c.s.userAgent())
  12698. var body io.Reader = nil
  12699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userpermission)
  12700. if err != nil {
  12701. return nil, err
  12702. }
  12703. reqHeaders.Set("Content-Type", "application/json")
  12704. c.urlParams_.Set("alt", alt)
  12705. urls := googleapi.ResolveRelative(c.s.BasePath, "{+path}")
  12706. urls += "?" + c.urlParams_.Encode()
  12707. req, _ := http.NewRequest("PUT", urls, body)
  12708. req.Header = reqHeaders
  12709. googleapi.Expand(req.URL, map[string]string{
  12710. "path": c.path,
  12711. })
  12712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12713. }
  12714. // Do executes the "tagmanager.accounts.user_permissions.update" call.
  12715. // Exactly one of *UserPermission or error will be non-nil. Any non-2xx
  12716. // status code is an error. Response headers are in either
  12717. // *UserPermission.ServerResponse.Header or (if a response was returned
  12718. // at all) in error.(*googleapi.Error).Header. Use
  12719. // googleapi.IsNotModified to check whether the returned error was
  12720. // because http.StatusNotModified was returned.
  12721. func (c *AccountsUserPermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*UserPermission, error) {
  12722. gensupport.SetOptions(c.urlParams_, opts...)
  12723. res, err := c.doRequest("json")
  12724. if res != nil && res.StatusCode == http.StatusNotModified {
  12725. if res.Body != nil {
  12726. res.Body.Close()
  12727. }
  12728. return nil, &googleapi.Error{
  12729. Code: res.StatusCode,
  12730. Header: res.Header,
  12731. }
  12732. }
  12733. if err != nil {
  12734. return nil, err
  12735. }
  12736. defer googleapi.CloseBody(res)
  12737. if err := googleapi.CheckResponse(res); err != nil {
  12738. return nil, err
  12739. }
  12740. ret := &UserPermission{
  12741. ServerResponse: googleapi.ServerResponse{
  12742. Header: res.Header,
  12743. HTTPStatusCode: res.StatusCode,
  12744. },
  12745. }
  12746. target := &ret
  12747. if err := gensupport.DecodeResponse(target, res); err != nil {
  12748. return nil, err
  12749. }
  12750. return ret, nil
  12751. // {
  12752. // "description": "Updates a user's Account \u0026 Container access.",
  12753. // "httpMethod": "PUT",
  12754. // "id": "tagmanager.accounts.user_permissions.update",
  12755. // "parameterOrder": [
  12756. // "path"
  12757. // ],
  12758. // "parameters": {
  12759. // "path": {
  12760. // "description": "GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id}",
  12761. // "location": "path",
  12762. // "required": true,
  12763. // "type": "string"
  12764. // }
  12765. // },
  12766. // "path": "{+path}",
  12767. // "request": {
  12768. // "$ref": "UserPermission"
  12769. // },
  12770. // "response": {
  12771. // "$ref": "UserPermission"
  12772. // },
  12773. // "scopes": [
  12774. // "https://www.googleapis.com/auth/tagmanager.manage.users"
  12775. // ]
  12776. // }
  12777. }