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