| 1 |
// Copyright 2026 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 authorizedbuyersmarketplace provides access to the Authorized Buyers Marketplace API. |
| 8 |
// |
| 9 |
// For product documentation, see: https://developers.google.com/authorized-buyers/apis/marketplace/reference/rest/ |
| 10 |
// |
| 11 |
// # Library status |
| 12 |
// |
| 13 |
// These client libraries are officially supported by Google. However, this |
| 14 |
// library is considered complete and is in maintenance mode. This means |
| 15 |
// that we will address critical bugs and security issues but will not add |
| 16 |
// any new features. |
| 17 |
// |
| 18 |
// When possible, we recommend using our newer |
| 19 |
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) |
| 20 |
// that are still actively being worked and iterated on. |
| 21 |
// |
| 22 |
// # Creating a client |
| 23 |
// |
| 24 |
// Usage example: |
| 25 |
// |
| 26 |
// import "google.golang.org/api/authorizedbuyersmarketplace/v1beta" |
| 27 |
// ... |
| 28 |
// ctx := context.Background() |
| 29 |
// authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx) |
| 30 |
// |
| 31 |
// In this example, Google Application Default Credentials are used for |
| 32 |
// authentication. For information on how to create and obtain Application |
| 33 |
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. |
| 34 |
// |
| 35 |
// # Other authentication options |
| 36 |
// |
| 37 |
// To use an API key for authentication (note: some APIs do not support API |
| 38 |
// keys), use [google.golang.org/api/option.WithAPIKey]: |
| 39 |
// |
| 40 |
// authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx, option.WithAPIKey("AIza...")) |
| 41 |
// |
| 42 |
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth |
| 43 |
// flow, use [google.golang.org/api/option.WithTokenSource]: |
| 44 |
// |
| 45 |
// config := &oauth2.Config{...} |
| 46 |
// // ... |
| 47 |
// token, err := config.Exchange(ctx, ...) |
| 48 |
// authorizedbuyersmarketplaceService, err := authorizedbuyersmarketplace.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) |
| 49 |
// |
| 50 |
// See [google.golang.org/api/option.ClientOption] for details on options. |
| 51 |
package authorizedbuyersmarketplace // import "google.golang.org/api/authorizedbuyersmarketplace/v1beta" |
| 52 |
|
| 53 |
import ( |
| 54 |
"bytes" |
| 55 |
"context" |
| 56 |
"encoding/json" |
| 57 |
"errors" |
| 58 |
"fmt" |
| 59 |
"io" |
| 60 |
"log/slog" |
| 61 |
"net/http" |
| 62 |
"net/url" |
| 63 |
"strconv" |
| 64 |
"strings" |
| 65 |
|
| 66 |
"github.com/googleapis/gax-go/v2/internallog" |
| 67 |
googleapi "google.golang.org/api/googleapi" |
| 68 |
internal "google.golang.org/api/internal" |
| 69 |
gensupport "google.golang.org/api/internal/gensupport" |
| 70 |
option "google.golang.org/api/option" |
| 71 |
internaloption "google.golang.org/api/option/internaloption" |
| 72 |
htransport "google.golang.org/api/transport/http" |
| 73 |
) |
| 74 |
|
| 75 |
// Always reference these packages, just in case the auto-generated code |
| 76 |
// below doesn't. |
| 77 |
var _ = bytes.NewBuffer |
| 78 |
var _ = strconv.Itoa |
| 79 |
var _ = fmt.Sprintf |
| 80 |
var _ = json.NewDecoder |
| 81 |
var _ = io.Copy |
| 82 |
var _ = url.Parse |
| 83 |
var _ = gensupport.MarshalJSON |
| 84 |
var _ = googleapi.Version |
| 85 |
var _ = errors.New |
| 86 |
var _ = strings.Replace |
| 87 |
var _ = context.Canceled |
| 88 |
var _ = internaloption.WithDefaultEndpoint |
| 89 |
var _ = internal.Version |
| 90 |
var _ = internallog.New |
| 91 |
|
| 92 |
const apiId = "authorizedbuyersmarketplace:v1beta" |
| 93 |
const apiName = "authorizedbuyersmarketplace" |
| 94 |
const apiVersion = "v1beta" |
| 95 |
const basePath = "https://authorizedbuyersmarketplace.googleapis.com/" |
| 96 |
const basePathTemplate = "https://authorizedbuyersmarketplace.UNIVERSE_DOMAIN/" |
| 97 |
const mtlsBasePath = "https://authorizedbuyersmarketplace.mtls.googleapis.com/" |
| 98 |
|
| 99 |
// OAuth2 scopes used by this API. |
| 100 |
const ( |
| 101 |
// See, create, edit, and delete your Authorized Buyers Marketplace entities. |
| 102 |
AuthorizedBuyersMarketplaceScope = "https://www.googleapis.com/auth/authorized-buyers-marketplace" |
| 103 |
) |
| 104 |
|
| 105 |
// NewService creates a new Service. |
| 106 |
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { |
| 107 |
scopesOption := internaloption.WithDefaultScopes( |
| 108 |
"https://www.googleapis.com/auth/authorized-buyers-marketplace", |
| 109 |
) |
| 110 |
// NOTE: prepend, so we don't override user-specified scopes. |
| 111 |
opts = append([]option.ClientOption{scopesOption}, opts...) |
| 112 |
opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) |
| 113 |
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) |
| 114 |
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) |
| 115 |
opts = append(opts, internaloption.EnableNewAuthLibrary()) |
| 116 |
client, endpoint, err := htransport.NewClient(ctx, opts...) |
| 117 |
if err != nil { |
| 118 |
return nil, err |
| 119 |
} |
| 120 |
s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)} |
| 121 |
s.Curators = NewCuratorsService(s) |
| 122 |
s.MediaPlanners = NewMediaPlannersService(s) |
| 123 |
if endpoint != "" { |
| 124 |
s.BasePath = endpoint |
| 125 |
} |
| 126 |
return s, nil |
| 127 |
} |
| 128 |
|
| 129 |
// New creates a new Service. It uses the provided http.Client for requests. |
| 130 |
// |
| 131 |
// Deprecated: please use NewService instead. |
| 132 |
// To provide a custom HTTP client, use option.WithHTTPClient. |
| 133 |
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. |
| 134 |
func New(client *http.Client) (*Service, error) { |
| 135 |
if client == nil { |
| 136 |
return nil, errors.New("client is nil") |
| 137 |
} |
| 138 |
return NewService(context.TODO(), option.WithHTTPClient(client)) |
| 139 |
} |
| 140 |
|
| 141 |
type Service struct { |
| 142 |
client *http.Client |
| 143 |
logger *slog.Logger |
| 144 |
BasePath string // API endpoint base URL |
| 145 |
UserAgent string // optional additional User-Agent fragment |
| 146 |
|
| 147 |
Curators *CuratorsService |
| 148 |
|
| 149 |
MediaPlanners *MediaPlannersService |
| 150 |
} |
| 151 |
|
| 152 |
func (s *Service) userAgent() string { |
| 153 |
if s.UserAgent == "" { |
| 154 |
return googleapi.UserAgent |
| 155 |
} |
| 156 |
return googleapi.UserAgent + " " + s.UserAgent |
| 157 |
} |
| 158 |
|
| 159 |
func NewCuratorsService(s *Service) *CuratorsService { |
| 160 |
rs := &CuratorsService{s: s} |
| 161 |
rs.CuratedPackages = NewCuratorsCuratedPackagesService(s) |
| 162 |
rs.DataSegments = NewCuratorsDataSegmentsService(s) |
| 163 |
return rs |
| 164 |
} |
| 165 |
|
| 166 |
type CuratorsService struct { |
| 167 |
s *Service |
| 168 |
|
| 169 |
CuratedPackages *CuratorsCuratedPackagesService |
| 170 |
|
| 171 |
DataSegments *CuratorsDataSegmentsService |
| 172 |
} |
| 173 |
|
| 174 |
func NewCuratorsCuratedPackagesService(s *Service) *CuratorsCuratedPackagesService { |
| 175 |
rs := &CuratorsCuratedPackagesService{s: s} |
| 176 |
return rs |
| 177 |
} |
| 178 |
|
| 179 |
type CuratorsCuratedPackagesService struct { |
| 180 |
s *Service |
| 181 |
} |
| 182 |
|
| 183 |
func NewCuratorsDataSegmentsService(s *Service) *CuratorsDataSegmentsService { |
| 184 |
rs := &CuratorsDataSegmentsService{s: s} |
| 185 |
return rs |
| 186 |
} |
| 187 |
|
| 188 |
type CuratorsDataSegmentsService struct { |
| 189 |
s *Service |
| 190 |
} |
| 191 |
|
| 192 |
func NewMediaPlannersService(s *Service) *MediaPlannersService { |
| 193 |
rs := &MediaPlannersService{s: s} |
| 194 |
return rs |
| 195 |
} |
| 196 |
|
| 197 |
type MediaPlannersService struct { |
| 198 |
s *Service |
| 199 |
} |
| 200 |
|
| 201 |
// AccessControlSettings: Settings for controlling access to a curated package. |
| 202 |
type AccessControlSettings struct { |
| 203 |
// AllowlistedMediaPlanners: Required. Immutable. The list of media planners |
| 204 |
// that are explicitly granted access to the curated package. Eligible media |
| 205 |
// planners can be found in the mediaPlanners.list method. Only a single media |
| 206 |
// planner may be allowlisted at this time. Format: |
| 207 |
// `mediaPlanners/{mediaPlannerAccountId}` |
| 208 |
AllowlistedMediaPlanners []string `json:"allowlistedMediaPlanners,omitempty"` |
| 209 |
// ForceSendFields is a list of field names (e.g. "AllowlistedMediaPlanners") |
| 210 |
// to unconditionally include in API requests. By default, fields with empty or |
| 211 |
// default values are omitted from API requests. See |
| 212 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 213 |
// details. |
| 214 |
ForceSendFields []string `json:"-"` |
| 215 |
// NullFields is a list of field names (e.g. "AllowlistedMediaPlanners") to |
| 216 |
// include in API requests with the JSON null value. By default, fields with |
| 217 |
// empty values are omitted from API requests. See |
| 218 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 219 |
NullFields []string `json:"-"` |
| 220 |
} |
| 221 |
|
| 222 |
func (s AccessControlSettings) MarshalJSON() ([]byte, error) { |
| 223 |
type NoMethod AccessControlSettings |
| 224 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 225 |
} |
| 226 |
|
| 227 |
// ActivateCuratedPackageRequest: Request message for ActivateCuratedPackage. |
| 228 |
type ActivateCuratedPackageRequest struct { |
| 229 |
} |
| 230 |
|
| 231 |
// ActivateDataSegmentRequest: Request message for activating a data segment |
| 232 |
type ActivateDataSegmentRequest struct { |
| 233 |
} |
| 234 |
|
| 235 |
// AdSize: Represents size of a single ad slot, or a creative. |
| 236 |
type AdSize struct { |
| 237 |
// Height: The height of the ad slot in pixels. This field will be present only |
| 238 |
// when size type is `PIXEL`. |
| 239 |
Height int64 `json:"height,omitempty,string"` |
| 240 |
// Type: The type of the ad slot size. |
| 241 |
// |
| 242 |
// Possible values: |
| 243 |
// "TYPE_UNSPECIFIED" - A placeholder for an undefined size type. |
| 244 |
// "PIXEL" - Ad slot with size specified by height and width in pixels. |
| 245 |
// "INTERSTITIAL" - Special size to describe an interstitial ad slot. |
| 246 |
// "NATIVE" - Native (mobile) ads rendered by the publisher. |
| 247 |
// "FLUID" - Fluid size (responsive size) can be resized automatically with |
| 248 |
// the change of outside environment. |
| 249 |
Type string `json:"type,omitempty"` |
| 250 |
// Width: The width of the ad slot in pixels. This field will be present only |
| 251 |
// when size type is `PIXEL`. |
| 252 |
Width int64 `json:"width,omitempty,string"` |
| 253 |
// ForceSendFields is a list of field names (e.g. "Height") to unconditionally |
| 254 |
// include in API requests. By default, fields with empty or default values are |
| 255 |
// omitted from API requests. See |
| 256 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 257 |
// details. |
| 258 |
ForceSendFields []string `json:"-"` |
| 259 |
// NullFields is a list of field names (e.g. "Height") to include in API |
| 260 |
// requests with the JSON null value. By default, fields with empty values are |
| 261 |
// omitted from API requests. See |
| 262 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 263 |
NullFields []string `json:"-"` |
| 264 |
} |
| 265 |
|
| 266 |
func (s AdSize) MarshalJSON() ([]byte, error) { |
| 267 |
type NoMethod AdSize |
| 268 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 269 |
} |
| 270 |
|
| 271 |
// CriteriaTargeting: Generic targeting used for targeting dimensions that |
| 272 |
// contains a list of included and excluded numeric IDs. This cannot be |
| 273 |
// filtered using list filter syntax. |
| 274 |
type CriteriaTargeting struct { |
| 275 |
// ExcludedCriteriaIds: A list of numeric IDs to be excluded. |
| 276 |
ExcludedCriteriaIds googleapi.Int64s `json:"excludedCriteriaIds,omitempty"` |
| 277 |
// TargetedCriteriaIds: A list of numeric IDs to be included. |
| 278 |
TargetedCriteriaIds googleapi.Int64s `json:"targetedCriteriaIds,omitempty"` |
| 279 |
// ForceSendFields is a list of field names (e.g. "ExcludedCriteriaIds") to |
| 280 |
// unconditionally include in API requests. By default, fields with empty or |
| 281 |
// default values are omitted from API requests. See |
| 282 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 283 |
// details. |
| 284 |
ForceSendFields []string `json:"-"` |
| 285 |
// NullFields is a list of field names (e.g. "ExcludedCriteriaIds") to include |
| 286 |
// in API requests with the JSON null value. By default, fields with empty |
| 287 |
// values are omitted from API requests. See |
| 288 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 289 |
NullFields []string `json:"-"` |
| 290 |
} |
| 291 |
|
| 292 |
func (s CriteriaTargeting) MarshalJSON() ([]byte, error) { |
| 293 |
type NoMethod CriteriaTargeting |
| 294 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 295 |
} |
| 296 |
|
| 297 |
// CuratedPackage: Represents a curated package of inventory created and |
| 298 |
// managed by a Curator. |
| 299 |
type CuratedPackage struct { |
| 300 |
// AccessSettings: Required. Settings for controlling access to the curated |
| 301 |
// package. Access to this curated package is limited to the allowlisted media |
| 302 |
// planners and the creator. Buyers and bidders can not be allowlisted for or |
| 303 |
// have direct access to this resource. |
| 304 |
AccessSettings *AccessControlSettings `json:"accessSettings,omitempty"` |
| 305 |
// CreateTime: Output only. The timestamp when the curated package was created. |
| 306 |
// Can be used to filter the response of the curatedPackages.list method. |
| 307 |
CreateTime string `json:"createTime,omitempty"` |
| 308 |
// Description: Optional. A description of the curated package, provided by the |
| 309 |
// curator. |
| 310 |
Description string `json:"description,omitempty"` |
| 311 |
// DisplayName: Required. The display name assigned to the curated package by |
| 312 |
// the curator. Can be used to filter the response of the curatedPackages.list |
| 313 |
// method. |
| 314 |
DisplayName string `json:"displayName,omitempty"` |
| 315 |
// FeeCpm: Optional. The CPM fee charged by the curator to buyers using this |
| 316 |
// curated package. Can be used to filter the response of the |
| 317 |
// curatedPackages.list method. |
| 318 |
FeeCpm *Money `json:"feeCpm,omitempty"` |
| 319 |
// FloorPriceCpm: Optional. The minimum CPM a buyer has to bid to participate |
| 320 |
// in auctions for inventory in this curated package. Can be used to filter the |
| 321 |
// response of the curatedPackages.list method. |
| 322 |
FloorPriceCpm *Money `json:"floorPriceCpm,omitempty"` |
| 323 |
// Name: Identifier. The unique resource name for the curated package. Format: |
| 324 |
// `curators/{accountId}/curatedPackages/{curatedPackageId}` |
| 325 |
Name string `json:"name,omitempty"` |
| 326 |
// State: Output only. The state of the curated package. Can be used to filter |
| 327 |
// the response of the curatedPackages.list method. |
| 328 |
// |
| 329 |
// Possible values: |
| 330 |
// "STATE_UNSPECIFIED" - Default value. |
| 331 |
// "ACTIVE" - The curated package is active. |
| 332 |
// "INACTIVE" - The curated package is inactive. |
| 333 |
State string `json:"state,omitempty"` |
| 334 |
// Targeting: Optional. Targeting criteria for the curated package. |
| 335 |
Targeting *PackageTargeting `json:"targeting,omitempty"` |
| 336 |
// UpdateTime: Output only. The timestamp when the curated package was last |
| 337 |
// updated. Can be used to filter the response of the curatedPackages.list |
| 338 |
// method. |
| 339 |
UpdateTime string `json:"updateTime,omitempty"` |
| 340 |
|
| 341 |
// ServerResponse contains the HTTP response code and headers from the server. |
| 342 |
googleapi.ServerResponse `json:"-"` |
| 343 |
// ForceSendFields is a list of field names (e.g. "AccessSettings") to |
| 344 |
// unconditionally include in API requests. By default, fields with empty or |
| 345 |
// default values are omitted from API requests. See |
| 346 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 347 |
// details. |
| 348 |
ForceSendFields []string `json:"-"` |
| 349 |
// NullFields is a list of field names (e.g. "AccessSettings") to include in |
| 350 |
// API requests with the JSON null value. By default, fields with empty values |
| 351 |
// are omitted from API requests. See |
| 352 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 353 |
NullFields []string `json:"-"` |
| 354 |
} |
| 355 |
|
| 356 |
func (s CuratedPackage) MarshalJSON() ([]byte, error) { |
| 357 |
type NoMethod CuratedPackage |
| 358 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 359 |
} |
| 360 |
|
| 361 |
// DataSegment: Defines an identifier for a segment of inventory that can be |
| 362 |
// targeted by curators or media planners in the deals or auction packages UI. |
| 363 |
// Curation of inventory is done by curators on external platforms. |
| 364 |
type DataSegment struct { |
| 365 |
// CpmFee: Optional. A fixed fee charged per thousand impressions. Once set, |
| 366 |
// the currency code cannot be changed. |
| 367 |
CpmFee *Money `json:"cpmFee,omitempty"` |
| 368 |
// CreateTime: Output only. Time the data segment was created. |
| 369 |
CreateTime string `json:"createTime,omitempty"` |
| 370 |
// Name: Immutable. Identifier. The unique identifier for the data segment. |
| 371 |
// Account ID corresponds to the account ID that created the segment. v1alpha |
| 372 |
// format: `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta |
| 373 |
// format: `curators/{curatorAccountId}/dataSegments/{curatorDataSegmentId}` |
| 374 |
Name string `json:"name,omitempty"` |
| 375 |
// State: Output only. The state of the data segment. |
| 376 |
// |
| 377 |
// Possible values: |
| 378 |
// "STATE_UNSPECIFIED" - Default value. |
| 379 |
// "ACTIVE" - The data segment is active. |
| 380 |
// "INACTIVE" - The data segment is inactive. |
| 381 |
State string `json:"state,omitempty"` |
| 382 |
// UpdateTime: Output only. Time the data segment was last updated. |
| 383 |
UpdateTime string `json:"updateTime,omitempty"` |
| 384 |
|
| 385 |
// ServerResponse contains the HTTP response code and headers from the server. |
| 386 |
googleapi.ServerResponse `json:"-"` |
| 387 |
// ForceSendFields is a list of field names (e.g. "CpmFee") to unconditionally |
| 388 |
// include in API requests. By default, fields with empty or default values are |
| 389 |
// omitted from API requests. See |
| 390 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 391 |
// details. |
| 392 |
ForceSendFields []string `json:"-"` |
| 393 |
// NullFields is a list of field names (e.g. "CpmFee") to include in API |
| 394 |
// requests with the JSON null value. By default, fields with empty values are |
| 395 |
// omitted from API requests. See |
| 396 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 397 |
NullFields []string `json:"-"` |
| 398 |
} |
| 399 |
|
| 400 |
func (s DataSegment) MarshalJSON() ([]byte, error) { |
| 401 |
type NoMethod DataSegment |
| 402 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 403 |
} |
| 404 |
|
| 405 |
// DeactivateCuratedPackageRequest: Request message for |
| 406 |
// DeactivateCuratedPackage. |
| 407 |
type DeactivateCuratedPackageRequest struct { |
| 408 |
} |
| 409 |
|
| 410 |
// DeactivateDataSegmentRequest: Request message for deactivating a data |
| 411 |
// segment |
| 412 |
type DeactivateDataSegmentRequest struct { |
| 413 |
} |
| 414 |
|
| 415 |
// ListCuratedPackagesResponse: Response message for ListCuratedPackages. |
| 416 |
type ListCuratedPackagesResponse struct { |
| 417 |
// CuratedPackages: The list of curated packages. |
| 418 |
CuratedPackages []*CuratedPackage `json:"curatedPackages,omitempty"` |
| 419 |
// NextPageToken: A token to retrieve the next page of results. Pass this value |
| 420 |
// in the ListCuratedPackagesRequest.pageToken field in the subsequent call to |
| 421 |
// `ListCuratedPackages` method to retrieve the next page of results. If empty, |
| 422 |
// then there are no more results. |
| 423 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 424 |
|
| 425 |
// ServerResponse contains the HTTP response code and headers from the server. |
| 426 |
googleapi.ServerResponse `json:"-"` |
| 427 |
// ForceSendFields is a list of field names (e.g. "CuratedPackages") to |
| 428 |
// unconditionally include in API requests. By default, fields with empty or |
| 429 |
// default values are omitted from API requests. See |
| 430 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 431 |
// details. |
| 432 |
ForceSendFields []string `json:"-"` |
| 433 |
// NullFields is a list of field names (e.g. "CuratedPackages") to include in |
| 434 |
// API requests with the JSON null value. By default, fields with empty values |
| 435 |
// are omitted from API requests. See |
| 436 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 437 |
NullFields []string `json:"-"` |
| 438 |
} |
| 439 |
|
| 440 |
func (s ListCuratedPackagesResponse) MarshalJSON() ([]byte, error) { |
| 441 |
type NoMethod ListCuratedPackagesResponse |
| 442 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 443 |
} |
| 444 |
|
| 445 |
// ListDataSegmentsResponse: Response message for listing data segments. |
| 446 |
type ListDataSegmentsResponse struct { |
| 447 |
// DataSegments: The list of data segments. |
| 448 |
DataSegments []*DataSegment `json:"dataSegments,omitempty"` |
| 449 |
// NextPageToken: Continuation token for fetching the next page of results. |
| 450 |
// Pass this value in the ListDataSegmentsRequest.pageToken field in the |
| 451 |
// subsequent call to the `ListDataSegments` method to retrieve the next page |
| 452 |
// of results. |
| 453 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 454 |
|
| 455 |
// ServerResponse contains the HTTP response code and headers from the server. |
| 456 |
googleapi.ServerResponse `json:"-"` |
| 457 |
// ForceSendFields is a list of field names (e.g. "DataSegments") to |
| 458 |
// unconditionally include in API requests. By default, fields with empty or |
| 459 |
// default values are omitted from API requests. See |
| 460 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 461 |
// details. |
| 462 |
ForceSendFields []string `json:"-"` |
| 463 |
// NullFields is a list of field names (e.g. "DataSegments") to include in API |
| 464 |
// requests with the JSON null value. By default, fields with empty values are |
| 465 |
// omitted from API requests. See |
| 466 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 467 |
NullFields []string `json:"-"` |
| 468 |
} |
| 469 |
|
| 470 |
func (s ListDataSegmentsResponse) MarshalJSON() ([]byte, error) { |
| 471 |
type NoMethod ListDataSegmentsResponse |
| 472 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 473 |
} |
| 474 |
|
| 475 |
// ListMediaPlannersResponse: A response containing media planner account |
| 476 |
// information. |
| 477 |
type ListMediaPlannersResponse struct { |
| 478 |
// MediaPlanners: List of media planners. |
| 479 |
MediaPlanners []*MediaPlanner `json:"mediaPlanners,omitempty"` |
| 480 |
// NextPageToken: A token which can be passed to a subsequent call to the |
| 481 |
// `ListMediaPlanners` method to retrieve the next page of results in |
| 482 |
// ListMediaPlannersRequest.pageToken. |
| 483 |
NextPageToken string `json:"nextPageToken,omitempty"` |
| 484 |
|
| 485 |
// ServerResponse contains the HTTP response code and headers from the server. |
| 486 |
googleapi.ServerResponse `json:"-"` |
| 487 |
// ForceSendFields is a list of field names (e.g. "MediaPlanners") to |
| 488 |
// unconditionally include in API requests. By default, fields with empty or |
| 489 |
// default values are omitted from API requests. See |
| 490 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 491 |
// details. |
| 492 |
ForceSendFields []string `json:"-"` |
| 493 |
// NullFields is a list of field names (e.g. "MediaPlanners") to include in API |
| 494 |
// requests with the JSON null value. By default, fields with empty values are |
| 495 |
// omitted from API requests. See |
| 496 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 497 |
NullFields []string `json:"-"` |
| 498 |
} |
| 499 |
|
| 500 |
func (s ListMediaPlannersResponse) MarshalJSON() ([]byte, error) { |
| 501 |
type NoMethod ListMediaPlannersResponse |
| 502 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 503 |
} |
| 504 |
|
| 505 |
// MediaPlanner: Represents a media planner account. |
| 506 |
type MediaPlanner struct { |
| 507 |
// AccountId: Output only. Account ID of the media planner. |
| 508 |
AccountId string `json:"accountId,omitempty"` |
| 509 |
// AncestorNames: Output only. The ancestor names of the media planner. Format: |
| 510 |
// `mediaPlanners/{mediaPlannerAccountId}` Can be used to filter the response |
| 511 |
// of the mediaPlanners.list method. |
| 512 |
AncestorNames []string `json:"ancestorNames,omitempty"` |
| 513 |
// DisplayName: Output only. The display name of the media planner. Can be used |
| 514 |
// to filter the response of the mediaPlanners.list method. |
| 515 |
DisplayName string `json:"displayName,omitempty"` |
| 516 |
// Name: Identifier. The unique resource name of the media planner. Format: |
| 517 |
// `mediaPlanners/{mediaPlannerAccountId}` Can be used to filter the response |
| 518 |
// of the mediaPlanners.list method. |
| 519 |
Name string `json:"name,omitempty"` |
| 520 |
// ForceSendFields is a list of field names (e.g. "AccountId") to |
| 521 |
// unconditionally include in API requests. By default, fields with empty or |
| 522 |
// default values are omitted from API requests. See |
| 523 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 524 |
// details. |
| 525 |
ForceSendFields []string `json:"-"` |
| 526 |
// NullFields is a list of field names (e.g. "AccountId") to include in API |
| 527 |
// requests with the JSON null value. By default, fields with empty values are |
| 528 |
// omitted from API requests. See |
| 529 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 530 |
NullFields []string `json:"-"` |
| 531 |
} |
| 532 |
|
| 533 |
func (s MediaPlanner) MarshalJSON() ([]byte, error) { |
| 534 |
type NoMethod MediaPlanner |
| 535 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 536 |
} |
| 537 |
|
| 538 |
// Money: Represents an amount of money with its currency type. |
| 539 |
type Money struct { |
| 540 |
// CurrencyCode: The three-letter currency code defined in ISO 4217. |
| 541 |
CurrencyCode string `json:"currencyCode,omitempty"` |
| 542 |
// Nanos: Number of nano (10^-9) units of the amount. The value must be between |
| 543 |
// -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` |
| 544 |
// must be positive or zero. If `units` is zero, `nanos` can be positive, zero, |
| 545 |
// or negative. If `units` is negative, `nanos` must be negative or zero. For |
| 546 |
// example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. |
| 547 |
Nanos int64 `json:"nanos,omitempty"` |
| 548 |
// Units: The whole units of the amount. For example if `currencyCode` is |
| 549 |
// "USD", then 1 unit is one US dollar. |
| 550 |
Units int64 `json:"units,omitempty,string"` |
| 551 |
// ForceSendFields is a list of field names (e.g. "CurrencyCode") to |
| 552 |
// unconditionally include in API requests. By default, fields with empty or |
| 553 |
// default values are omitted from API requests. See |
| 554 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 555 |
// details. |
| 556 |
ForceSendFields []string `json:"-"` |
| 557 |
// NullFields is a list of field names (e.g. "CurrencyCode") to include in API |
| 558 |
// requests with the JSON null value. By default, fields with empty values are |
| 559 |
// omitted from API requests. See |
| 560 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 561 |
NullFields []string `json:"-"` |
| 562 |
} |
| 563 |
|
| 564 |
func (s Money) MarshalJSON() ([]byte, error) { |
| 565 |
type NoMethod Money |
| 566 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 567 |
} |
| 568 |
|
| 569 |
// PackagePlacementTargeting: Represents targeting about where the ads can |
| 570 |
// appear, for example, certain sites or mobile applications. Different |
| 571 |
// placement targeting types will be logically OR'ed. |
| 572 |
type PackagePlacementTargeting struct { |
| 573 |
// IncludedMobileAppCategoryTargeting: Optional. The list of targeted mobile |
| 574 |
// app categories. |
| 575 |
IncludedMobileAppCategoryTargeting googleapi.Int64s `json:"includedMobileAppCategoryTargeting,omitempty"` |
| 576 |
// MobileAppTargeting: Optional. The list of targeted or excluded mobile |
| 577 |
// application IDs that publishers own. Currently, only Android and Apple apps |
| 578 |
// are supported. Android App ID, for example, com.google.android.apps.maps, |
| 579 |
// can be found in Google Play Store URL. iOS App ID (which is a number) can be |
| 580 |
// found at the end of iTunes store URL. First party mobile applications is |
| 581 |
// either included or excluded. |
| 582 |
MobileAppTargeting *StringTargetingDimension `json:"mobileAppTargeting,omitempty"` |
| 583 |
// UriTargeting: Optional. The list of targeted or excluded URLs. The domains |
| 584 |
// should have the http/https stripped (for example, google.com), and can |
| 585 |
// contain a max of 5 paths per url. |
| 586 |
UriTargeting *StringTargetingDimension `json:"uriTargeting,omitempty"` |
| 587 |
// ForceSendFields is a list of field names (e.g. |
| 588 |
// "IncludedMobileAppCategoryTargeting") to unconditionally include in API |
| 589 |
// requests. By default, fields with empty or default values are omitted from |
| 590 |
// API requests. See |
| 591 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 592 |
// details. |
| 593 |
ForceSendFields []string `json:"-"` |
| 594 |
// NullFields is a list of field names (e.g. |
| 595 |
// "IncludedMobileAppCategoryTargeting") to include in API requests with the |
| 596 |
// JSON null value. By default, fields with empty values are omitted from API |
| 597 |
// requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for |
| 598 |
// more details. |
| 599 |
NullFields []string `json:"-"` |
| 600 |
} |
| 601 |
|
| 602 |
func (s PackagePlacementTargeting) MarshalJSON() ([]byte, error) { |
| 603 |
type NoMethod PackagePlacementTargeting |
| 604 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 605 |
} |
| 606 |
|
| 607 |
// PackagePublisherProvidedSignalsTargeting: Represents targeting about |
| 608 |
// publisher provided signals. Different publisher provided signals types will |
| 609 |
// be logically OR'ed. |
| 610 |
type PackagePublisherProvidedSignalsTargeting struct { |
| 611 |
// AudienceTargeting: Optional. The list of targeted or excluded audience IDs. |
| 612 |
// Based off of IAB Audience Taxonomy version 1.1 |
| 613 |
// (https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Audience%20Taxonomies/Audience%20Taxonomy%201.1.tsv) |
| 614 |
AudienceTargeting *TaxonomyTargeting `json:"audienceTargeting,omitempty"` |
| 615 |
// ContentTargeting: Optional. The list of targeted or excluded content IDs. |
| 616 |
// Based off of IAB Content Taxonomy version 2.2 |
| 617 |
// (https://github.com/InteractiveAdvertisingBureau/Taxonomies/blob/main/Content%20Taxonomies/Content%20Taxonomy%202.2.tsv) |
| 618 |
ContentTargeting *TaxonomyTargeting `json:"contentTargeting,omitempty"` |
| 619 |
// VideoAndAudioSignalsTargeting: Optional. The list of targeted and excluded |
| 620 |
// video and audio signals IDs. These are additional signals supported by |
| 621 |
// publisher provided signals. |
| 622 |
VideoAndAudioSignalsTargeting *StringTargetingDimension `json:"videoAndAudioSignalsTargeting,omitempty"` |
| 623 |
// ForceSendFields is a list of field names (e.g. "AudienceTargeting") to |
| 624 |
// unconditionally include in API requests. By default, fields with empty or |
| 625 |
// default values are omitted from API requests. See |
| 626 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 627 |
// details. |
| 628 |
ForceSendFields []string `json:"-"` |
| 629 |
// NullFields is a list of field names (e.g. "AudienceTargeting") to include in |
| 630 |
// API requests with the JSON null value. By default, fields with empty values |
| 631 |
// are omitted from API requests. See |
| 632 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 633 |
NullFields []string `json:"-"` |
| 634 |
} |
| 635 |
|
| 636 |
func (s PackagePublisherProvidedSignalsTargeting) MarshalJSON() ([]byte, error) { |
| 637 |
type NoMethod PackagePublisherProvidedSignalsTargeting |
| 638 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 639 |
} |
| 640 |
|
| 641 |
// PackageTargeting: Targeting criteria for curated and auction packages. |
| 642 |
type PackageTargeting struct { |
| 643 |
// GeoTargeting: Optional. The geo criteria IDs to be included or excluded as |
| 644 |
// defined in |
| 645 |
// https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv. If unset, |
| 646 |
// inventory will be targeted regardless of geo. |
| 647 |
GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"` |
| 648 |
// IncludedAcceleratedMobilePageType: Optional. The targeted accelerated mobile |
| 649 |
// page type. If unset, inventory will be targeted regardless of AMP status. |
| 650 |
// |
| 651 |
// Possible values: |
| 652 |
// "ACCELERATED_MOBILE_PAGE_TYPE_UNSPECIFIED" - Default value. Should not be |
| 653 |
// used in targeting specifications. |
| 654 |
// "ACCELERATED_MOBILE_PAGE_TYPE_NON_AMP" - Targets inventory on standard web |
| 655 |
// pages not using any AMP framework. |
| 656 |
// "ACCELERATED_MOBILE_PAGE_TYPE_AMP" - Targets inventory on pages built |
| 657 |
// using the core AMP HTML framework. |
| 658 |
// "ACCELERATED_MOBILE_PAGE_TYPE_AMP_STORY" - Targets inventory on pages |
| 659 |
// using the AMP Story (STAMP) format, which is optimized for visual |
| 660 |
// storytelling (e.g., tappable full-screen experiences). |
| 661 |
IncludedAcceleratedMobilePageType string `json:"includedAcceleratedMobilePageType,omitempty"` |
| 662 |
// IncludedAdSizes: Optional. The list of ad sizes to target. If unset, |
| 663 |
// inventory will be targeted regardless of ad size. Curated packages supports |
| 664 |
// `PIXEL` and `INTERSTITIAL` ad sizes. |
| 665 |
IncludedAdSizes []*AdSize `json:"includedAdSizes,omitempty"` |
| 666 |
// IncludedAuthorizedSellerStatuses: Optional. The included list of targeted |
| 667 |
// authorized seller statuses. If empty, inventory will be targeted regardless |
| 668 |
// of seller status. |
| 669 |
// |
| 670 |
// Possible values: |
| 671 |
// "AUTHORIZED_SELLER_STATUS_UNSPECIFIED" - Default value. Should not be used |
| 672 |
// in targeting specifications. |
| 673 |
// "AUTHORIZED_SELLER_STATUS_DIRECT" - Targets inventory where the seller is |
| 674 |
// declared as 'DIRECT'. This indicates the publisher (content owner) directly |
| 675 |
// controls the seller account and has a direct business contract with the |
| 676 |
// advertising system for this account. |
| 677 |
// "AUTHORIZED_SELLER_STATUS_RESELLER" - Targets inventory where the seller |
| 678 |
// is declared as 'RESELLER'. This indicates the publisher has authorized |
| 679 |
// another entity to operate the listed seller account and resell their ad |
| 680 |
// space. |
| 681 |
IncludedAuthorizedSellerStatuses []string `json:"includedAuthorizedSellerStatuses,omitempty"` |
| 682 |
// IncludedCreativeFormat: Optional. The creative format to target. If unset, |
| 683 |
// all creative markup types are targeted. |
| 684 |
// |
| 685 |
// Possible values: |
| 686 |
// "CREATIVE_FORMAT_UNSPECIFIED" - Default value. Should not be used in |
| 687 |
// targeting specifications. |
| 688 |
// "CREATIVE_FORMAT_DISPLAY" - Targets ad slots intended for HTML display |
| 689 |
// creatives. |
| 690 |
// "CREATIVE_FORMAT_VIDEO" - Targets ad slots intended for video creatives. |
| 691 |
// "CREATIVE_FORMAT_AUDIO" - Targets ad slots intended for audio creatives. |
| 692 |
IncludedCreativeFormat string `json:"includedCreativeFormat,omitempty"` |
| 693 |
// IncludedDataSegments: Optional. The active data segments to be targeted. If |
| 694 |
// unset, inventory will be targeted regardless of data segments. Format: |
| 695 |
// `curators/{account_id}/dataSegments/{data_segment_id}` |
| 696 |
IncludedDataSegments []string `json:"includedDataSegments,omitempty"` |
| 697 |
// IncludedDeviceTypes: Optional. The list of included device types to target. |
| 698 |
// If empty, all device types are targeted. |
| 699 |
// |
| 700 |
// Possible values: |
| 701 |
// "DEVICE_TYPE_UNSPECIFIED" - Default value. Should not be used in targeting |
| 702 |
// specifications. |
| 703 |
// "DEVICE_TYPE_PERSONAL_COMPUTER" - Targets desktop or laptop computers. |
| 704 |
// "DEVICE_TYPE_CONNECTED_TV" - Targets connected TVs: devices that stream TV |
| 705 |
// content, including smart TVs, gaming consoles, and streaming boxes/sticks. |
| 706 |
// "DEVICE_TYPE_PHONE" - Targets high-end mobile devices. |
| 707 |
// "DEVICE_TYPE_TABLET" - Targets tablet devices. |
| 708 |
IncludedDeviceTypes []string `json:"includedDeviceTypes,omitempty"` |
| 709 |
// IncludedEnvironment: Optional. The environment to target. If unspecified, |
| 710 |
// all environments are targeted. |
| 711 |
// |
| 712 |
// Possible values: |
| 713 |
// "ENVIRONMENT_UNSPECIFIED" - Default value. Should not be used in targeting |
| 714 |
// specifications. |
| 715 |
// "ENVIRONMENT_SITE" - Targets inventory rendered within an ad-supported |
| 716 |
// website. |
| 717 |
// "ENVIRONMENT_APP" - Targets inventory within a mobile application. |
| 718 |
IncludedEnvironment string `json:"includedEnvironment,omitempty"` |
| 719 |
// IncludedNativeInventoryTypes: Optional. The targeted native inventory types. |
| 720 |
// If empty, inventory will be targeted regardless of native inventory type. |
| 721 |
// |
| 722 |
// Possible values: |
| 723 |
// "NATIVE_INVENTORY_TYPE_UNSPECIFIED" - Default value. Should not be used in |
| 724 |
// targeting specifications. |
| 725 |
// "NATIVE_INVENTORY_TYPE_NATIVE_ONLY" - Targets ad slots that *only* accept |
| 726 |
// and render native ads. |
| 727 |
// "NATIVE_INVENTORY_TYPE_NATIVE_OR_BANNER" - Targets ad slots that accept |
| 728 |
// and render either native or banner ads. |
| 729 |
IncludedNativeInventoryTypes []string `json:"includedNativeInventoryTypes,omitempty"` |
| 730 |
// IncludedOpenMeasurementTypes: Optional. The list of targeted open |
| 731 |
// measurement types. If empty, inventory will be targeted regardless of Open |
| 732 |
// Measurement support. |
| 733 |
// |
| 734 |
// Possible values: |
| 735 |
// "OPEN_MEASUREMENT_TYPE_UNSPECIFIED" - Default value. Should not be used in |
| 736 |
// targeting specifications. |
| 737 |
// "OPEN_MEASUREMENT_TYPE_OMID_V1" - Targets inventory that supports the v1 |
| 738 |
// Open Measurement Interface Definition (OMID). |
| 739 |
IncludedOpenMeasurementTypes []string `json:"includedOpenMeasurementTypes,omitempty"` |
| 740 |
// IncludedRestrictedCategories: Optional. The list of targeted restricted |
| 741 |
// categories. If empty, inventory will be targeted regardless of restricted |
| 742 |
// categories. |
| 743 |
// |
| 744 |
// Possible values: |
| 745 |
// "RESTRICTED_CATEGORY_UNSPECIFIED" - Default value. Should not be used in |
| 746 |
// targeting specifications. |
| 747 |
// "RESTRICTED_CATEGORY_ALCOHOL" - Targets inventory where alcohol ads are |
| 748 |
// allowed by the publisher. |
| 749 |
// "RESTRICTED_CATEGORY_GAMBLING" - Targets inventory where gambling ads are |
| 750 |
// allowed by the publisher. |
| 751 |
IncludedRestrictedCategories []string `json:"includedRestrictedCategories,omitempty"` |
| 752 |
// IncludedRewardedType: Optional. The targeted rewarded type. If unset, |
| 753 |
// inventory will be targeted regardless of rewarded type. |
| 754 |
// |
| 755 |
// Possible values: |
| 756 |
// "REWARDED_TYPE_UNSPECIFIED" - Default value. Should not be used in |
| 757 |
// targeting specifications. |
| 758 |
// "REWARDED_TYPE_NON_REWARDED" - Targets inventory that does NOT offer an |
| 759 |
// explicit reward to the user for watching or interacting with the ad. |
| 760 |
// "REWARDED_TYPE_REWARDED" - Targets inventory that offers a reward to the |
| 761 |
// user in exchange for watching or engaging with the ad. |
| 762 |
IncludedRewardedType string `json:"includedRewardedType,omitempty"` |
| 763 |
// LanguageTargeting: Optional. The languages to target. If unset, inventory |
| 764 |
// will be targeted regardless of language. See |
| 765 |
// https://developers.google.com/google-ads/api/data/codes-formats#languages |
| 766 |
// for the list of supported language codes. |
| 767 |
LanguageTargeting *StringTargetingDimension `json:"languageTargeting,omitempty"` |
| 768 |
// MinimumPredictedClickThroughRatePercentageMillis: Optional. The targeted |
| 769 |
// minimum predicted click through rate, ranging in values [10, 10000] (0.01% - |
| 770 |
// 10%). A value of 50 means that the configuration will only match adslots for |
| 771 |
// which we predict at least 0.05% click through rate. An unset value indicates |
| 772 |
// inventory will be targeted regardless of predicted click through rate. |
| 773 |
MinimumPredictedClickThroughRatePercentageMillis int64 `json:"minimumPredictedClickThroughRatePercentageMillis,omitempty,string"` |
| 774 |
// MinimumPredictedViewabilityPercentage: Optional. The targeted minimum |
| 775 |
// predicted viewability percentage. This value must be a multiple of 10 |
| 776 |
// between 10 and 90 (inclusive). For example, 10 is valid, but 0, 15, and 100 |
| 777 |
// are not. A value of 10 means that the configuration will only match adslots |
| 778 |
// for which we predict at least 10% viewability. An unset value indicates |
| 779 |
// inventory will be targeted regardless of predicted viewability. |
| 780 |
MinimumPredictedViewabilityPercentage int64 `json:"minimumPredictedViewabilityPercentage,omitempty,string"` |
| 781 |
// PlacementTargeting: Optional. Placement targeting information, for example, |
| 782 |
// URL, mobile applications. |
| 783 |
PlacementTargeting *PackagePlacementTargeting `json:"placementTargeting,omitempty"` |
| 784 |
// PublisherProvidedSignalsTargeting: Optional. The publisher provided signals |
| 785 |
// to target. If unset, inventory will be targeted regardless of publisher |
| 786 |
// provided signals. |
| 787 |
PublisherProvidedSignalsTargeting *PackagePublisherProvidedSignalsTargeting `json:"publisherProvidedSignalsTargeting,omitempty"` |
| 788 |
// PublisherTargeting: Optional. The targeted publishers. If unset, inventory |
| 789 |
// will be targeted regardless of publisher. Publishers are identified by their |
| 790 |
// publisher ID from ads.txt / app-ads.txt. See https://iabtechlab.com/ads-txt/ |
| 791 |
// and https://iabtechlab.com/app-ads-txt/ for more details. |
| 792 |
PublisherTargeting *StringTargetingDimension `json:"publisherTargeting,omitempty"` |
| 793 |
// VerticalTargeting: Optional. The verticals included or excluded as defined |
| 794 |
// in |
| 795 |
// https://developers.google.com/authorized-buyers/rtb/downloads/publisher-verticals. |
| 796 |
// If unset, inventory will be targeted regardless of vertical. |
| 797 |
VerticalTargeting *CriteriaTargeting `json:"verticalTargeting,omitempty"` |
| 798 |
// VideoTargeting: Optional. Video specific targeting criteria. |
| 799 |
VideoTargeting *PackageVideoTargeting `json:"videoTargeting,omitempty"` |
| 800 |
// ForceSendFields is a list of field names (e.g. "GeoTargeting") to |
| 801 |
// unconditionally include in API requests. By default, fields with empty or |
| 802 |
// default values are omitted from API requests. See |
| 803 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 804 |
// details. |
| 805 |
ForceSendFields []string `json:"-"` |
| 806 |
// NullFields is a list of field names (e.g. "GeoTargeting") to include in API |
| 807 |
// requests with the JSON null value. By default, fields with empty values are |
| 808 |
// omitted from API requests. See |
| 809 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 810 |
NullFields []string `json:"-"` |
| 811 |
} |
| 812 |
|
| 813 |
func (s PackageTargeting) MarshalJSON() ([]byte, error) { |
| 814 |
type NoMethod PackageTargeting |
| 815 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 816 |
} |
| 817 |
|
| 818 |
// PackageVideoTargeting: Video specific targeting criteria. |
| 819 |
type PackageVideoTargeting struct { |
| 820 |
// IncludedContentDeliveryMethod: Optional. The targeted video delivery method. |
| 821 |
// If unset, inventory will be targeted regardless of video delivery method. |
| 822 |
// |
| 823 |
// Possible values: |
| 824 |
// "CONTENT_DELIVERY_METHOD_UNSPECIFIED" - Default value. Should not be used |
| 825 |
// in targeting specifications. |
| 826 |
// "CONTENT_DELIVERY_METHOD_STREAMING" - Targets video content that is being |
| 827 |
// broadcast live. |
| 828 |
// "CONTENT_DELIVERY_METHOD_PROGRESSIVE" - Targets video content that is |
| 829 |
// transferred incrementally as client's playback requires. |
| 830 |
IncludedContentDeliveryMethod string `json:"includedContentDeliveryMethod,omitempty"` |
| 831 |
// IncludedMaximumAdDurationTargeting: Optional. The targeted maximum video ad |
| 832 |
// duration. If unset, inventory will be targeted regardless of maximum video |
| 833 |
// ad duration. |
| 834 |
// |
| 835 |
// Possible values: |
| 836 |
// "MAXIMUM_VIDEO_AD_DURATION_UNSPECIFIED" - Default value. Should not be |
| 837 |
// used in targeting specifications. |
| 838 |
// "MAXIMUM_VIDEO_AD_DURATION_FIFTEEN_SECONDS" - Applies to video ads with a |
| 839 |
// duration up to 15 seconds (0 < duration <= 15s). |
| 840 |
// "MAXIMUM_VIDEO_AD_DURATION_TWENTY_SECONDS" - Applies to video ads with a |
| 841 |
// duration up to 20 seconds (0 < duration <= 20s). |
| 842 |
// "MAXIMUM_VIDEO_AD_DURATION_THIRTY_SECONDS" - Applies to video ads with a |
| 843 |
// duration up to 30 seconds (0 < duration <= 30s). |
| 844 |
// "MAXIMUM_VIDEO_AD_DURATION_SIXTY_SECONDS" - Applies to video ads with a |
| 845 |
// duration up to 60 seconds (0 < duration <= 60s). |
| 846 |
// "MAXIMUM_VIDEO_AD_DURATION_NINETY_SECONDS" - Applies to video ads with a |
| 847 |
// duration up to 90 seconds (0 < duration <= 90s). |
| 848 |
// "MAXIMUM_VIDEO_AD_DURATION_ONE_HUNDRED_TWENTY_SECONDS" - Applies to video |
| 849 |
// ads with a duration up to 120 seconds (0 < duration <= 120s). |
| 850 |
IncludedMaximumAdDurationTargeting string `json:"includedMaximumAdDurationTargeting,omitempty"` |
| 851 |
// IncludedMimeTypes: Optional. The list of targeted video mime types using the |
| 852 |
// IANA published MIME type strings |
| 853 |
// (https://www.iana.org/assignments/media-types/media-types.xhtml). If empty, |
| 854 |
// inventory will be targeted regardless of video mime type. |
| 855 |
// |
| 856 |
// Possible values: |
| 857 |
// "VIDEO_MIME_TYPE_UNSPECIFIED" - Default value. Should not be used in |
| 858 |
// targeting specifications. |
| 859 |
// "VIDEO_MIME_TYPE_THREEGPP" - 3GPP container format used on 3G phones. |
| 860 |
// "VIDEO_MIME_TYPE_APPLICATION_MPEGURL" - HLS/M3U8 |
| 861 |
// "VIDEO_MIME_TYPE_MP4" - MPEG-4 container typically with H.264 codec. |
| 862 |
// "VIDEO_MIME_TYPE_APPLICATION_MPEGDASH" - DASH. |
| 863 |
// "VIDEO_MIME_TYPE_APPLICATION_JAVASCRIPT" - JavaScript (used for VPAID |
| 864 |
// ads). |
| 865 |
// "VIDEO_MIME_TYPE_WEBM" - WebM container assuming VP9 codec. |
| 866 |
IncludedMimeTypes []string `json:"includedMimeTypes,omitempty"` |
| 867 |
// IncludedPlaybackMethods: Optional. The list of targeted video playback |
| 868 |
// methods. If empty, inventory will be targeted regardless of video playback |
| 869 |
// method. |
| 870 |
// |
| 871 |
// Possible values: |
| 872 |
// "PLAYBACK_METHOD_UNSPECIFIED" - Unspecified video playback method. Should |
| 873 |
// not be used. |
| 874 |
// "PLAYBACK_METHOD_AUTO_PLAY_SOUND_ON" - Playback starts automatically when |
| 875 |
// the page/content loads. |
| 876 |
// "PLAYBACK_METHOD_AUTO_PLAY_SOUND_OFF" - Playback starts automatically when |
| 877 |
// the page/content loads, but with sound off. |
| 878 |
// "PLAYBACK_METHOD_CLICK_TO_PLAY" - Playback is initiated by a user action |
| 879 |
// (e.g., clicking a play button). |
| 880 |
IncludedPlaybackMethods []string `json:"includedPlaybackMethods,omitempty"` |
| 881 |
// IncludedPlayerSizeTargeting: Optional. The targeted video player size. If |
| 882 |
// unset, inventory will be targeted regardless of video player size. |
| 883 |
IncludedPlayerSizeTargeting *VideoPlayerSizeTargeting `json:"includedPlayerSizeTargeting,omitempty"` |
| 884 |
// IncludedPositionTypes: Optional. The targeted video ad position types. If |
| 885 |
// empty, inventory will be targeted regardless of video ad position type. |
| 886 |
// |
| 887 |
// Possible values: |
| 888 |
// "POSITION_TYPE_UNSPECIFIED" - Default value. Should not be used in |
| 889 |
// targeting specifications. |
| 890 |
// "POSITION_TYPE_MIDROLL" - The ad is played in the middle of the video |
| 891 |
// content. |
| 892 |
// "POSITION_TYPE_POSTROLL" - The ad is played after the video content. |
| 893 |
// "POSITION_TYPE_PREROLL" - The ad is played before the video content. |
| 894 |
IncludedPositionTypes []string `json:"includedPositionTypes,omitempty"` |
| 895 |
// MinimumPredictedCompletionRatePercentage: Optional. The targeted minimum |
| 896 |
// predicted completion rate percentage. This value must be a multiple of 10 |
| 897 |
// between 10 and 90 (inclusive). For example, 10 is valid, but 0, 15, and 100 |
| 898 |
// are not. A value of 10 means that the configuration will only match adslots |
| 899 |
// for which we predict at least 10% completion rate. An unset value indicates |
| 900 |
// inventory will be targeted regardless of predicted completion rate. |
| 901 |
MinimumPredictedCompletionRatePercentage int64 `json:"minimumPredictedCompletionRatePercentage,omitempty,string"` |
| 902 |
// PlcmtTargeting: Optional. The targeted video plcmt types. If unset, |
| 903 |
// inventory will be targeted regardless of video plcmt type. |
| 904 |
PlcmtTargeting *VideoPlcmtTargeting `json:"plcmtTargeting,omitempty"` |
| 905 |
// ForceSendFields is a list of field names (e.g. |
| 906 |
// "IncludedContentDeliveryMethod") to unconditionally include in API requests. |
| 907 |
// By default, fields with empty or default values are omitted from API |
| 908 |
// requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields |
| 909 |
// for more details. |
| 910 |
ForceSendFields []string `json:"-"` |
| 911 |
// NullFields is a list of field names (e.g. "IncludedContentDeliveryMethod") |
| 912 |
// to include in API requests with the JSON null value. By default, fields with |
| 913 |
// empty values are omitted from API requests. See |
| 914 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 915 |
NullFields []string `json:"-"` |
| 916 |
} |
| 917 |
|
| 918 |
func (s PackageVideoTargeting) MarshalJSON() ([]byte, error) { |
| 919 |
type NoMethod PackageVideoTargeting |
| 920 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 921 |
} |
| 922 |
|
| 923 |
// StringTargetingDimension: Generic targeting with string values. |
| 924 |
type StringTargetingDimension struct { |
| 925 |
// SelectionType: Required. How the items in this list should be targeted. |
| 926 |
// |
| 927 |
// Possible values: |
| 928 |
// "SELECTION_TYPE_UNSPECIFIED" - Unspecified selection type. Should not be |
| 929 |
// used. |
| 930 |
// "SELECTION_TYPE_INCLUDE" - The values in the targeting dimension are |
| 931 |
// included. |
| 932 |
// "SELECTION_TYPE_EXCLUDE" - The values in the targeting dimension are |
| 933 |
// excluded. |
| 934 |
SelectionType string `json:"selectionType,omitempty"` |
| 935 |
// Values: Required. The values specified. |
| 936 |
Values []string `json:"values,omitempty"` |
| 937 |
// ForceSendFields is a list of field names (e.g. "SelectionType") to |
| 938 |
// unconditionally include in API requests. By default, fields with empty or |
| 939 |
// default values are omitted from API requests. See |
| 940 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 941 |
// details. |
| 942 |
ForceSendFields []string `json:"-"` |
| 943 |
// NullFields is a list of field names (e.g. "SelectionType") to include in API |
| 944 |
// requests with the JSON null value. By default, fields with empty values are |
| 945 |
// omitted from API requests. See |
| 946 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 947 |
NullFields []string `json:"-"` |
| 948 |
} |
| 949 |
|
| 950 |
func (s StringTargetingDimension) MarshalJSON() ([]byte, error) { |
| 951 |
type NoMethod StringTargetingDimension |
| 952 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 953 |
} |
| 954 |
|
| 955 |
// TaxonomyTargeting: Defines targeting criteria for handling the IAB audience |
| 956 |
// and content Taxonomy ID space. |
| 957 |
type TaxonomyTargeting struct { |
| 958 |
// ExcludedTaxonomyIds: Optional. The list of excluded content taxonomy IDs. |
| 959 |
ExcludedTaxonomyIds []string `json:"excludedTaxonomyIds,omitempty"` |
| 960 |
// TargetedTaxonomyIds: Optional. The list of targeted content taxonomy IDs. |
| 961 |
TargetedTaxonomyIds []string `json:"targetedTaxonomyIds,omitempty"` |
| 962 |
// ForceSendFields is a list of field names (e.g. "ExcludedTaxonomyIds") to |
| 963 |
// unconditionally include in API requests. By default, fields with empty or |
| 964 |
// default values are omitted from API requests. See |
| 965 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 966 |
// details. |
| 967 |
ForceSendFields []string `json:"-"` |
| 968 |
// NullFields is a list of field names (e.g. "ExcludedTaxonomyIds") to include |
| 969 |
// in API requests with the JSON null value. By default, fields with empty |
| 970 |
// values are omitted from API requests. See |
| 971 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 972 |
NullFields []string `json:"-"` |
| 973 |
} |
| 974 |
|
| 975 |
func (s TaxonomyTargeting) MarshalJSON() ([]byte, error) { |
| 976 |
type NoMethod TaxonomyTargeting |
| 977 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 978 |
} |
| 979 |
|
| 980 |
// VideoPlayerSizeTargeting: Represents the size of the video player that can |
| 981 |
// be targeted. Both width and height are required to be set to non-zero |
| 982 |
// values. |
| 983 |
type VideoPlayerSizeTargeting struct { |
| 984 |
// MinimumHeight: Required. The minimum height of the video player in pixels. |
| 985 |
MinimumHeight int64 `json:"minimumHeight,omitempty,string"` |
| 986 |
// MinimumWidth: Required. The minimum width of the video player in pixels. |
| 987 |
MinimumWidth int64 `json:"minimumWidth,omitempty,string"` |
| 988 |
// ForceSendFields is a list of field names (e.g. "MinimumHeight") to |
| 989 |
// unconditionally include in API requests. By default, fields with empty or |
| 990 |
// default values are omitted from API requests. See |
| 991 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 992 |
// details. |
| 993 |
ForceSendFields []string `json:"-"` |
| 994 |
// NullFields is a list of field names (e.g. "MinimumHeight") to include in API |
| 995 |
// requests with the JSON null value. By default, fields with empty values are |
| 996 |
// omitted from API requests. See |
| 997 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 998 |
NullFields []string `json:"-"` |
| 999 |
} |
| 1000 |
|
| 1001 |
func (s VideoPlayerSizeTargeting) MarshalJSON() ([]byte, error) { |
| 1002 |
type NoMethod VideoPlayerSizeTargeting |
| 1003 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1004 |
} |
| 1005 |
|
| 1006 |
// VideoPlcmtTargeting: Defines targeting criteria based on the video placement |
| 1007 |
// type, often corresponding to the IAB OpenRTB 'plcmt' field. |
| 1008 |
type VideoPlcmtTargeting struct { |
| 1009 |
// SelectionType: Required. The selection type for the list of video plcmts. |
| 1010 |
// |
| 1011 |
// Possible values: |
| 1012 |
// "SELECTION_TYPE_UNSPECIFIED" - Unspecified selection type. Should not be |
| 1013 |
// used. |
| 1014 |
// "SELECTION_TYPE_INCLUDE" - The values in the targeting dimension are |
| 1015 |
// included. |
| 1016 |
// "SELECTION_TYPE_EXCLUDE" - The values in the targeting dimension are |
| 1017 |
// excluded. |
| 1018 |
SelectionType string `json:"selectionType,omitempty"` |
| 1019 |
// VideoPlcmtTypes: Required. The list of targeted video plcmts types. If |
| 1020 |
// empty, inventory will be targeted regardless of video plcmt type. |
| 1021 |
// |
| 1022 |
// Possible values: |
| 1023 |
// "VIDEO_PLCMT_TYPE_UNSPECIFIED" - Default value. Should not be used in |
| 1024 |
// targeting specifications. |
| 1025 |
// "INSTREAM" - Pre-roll, mid-roll, and post-roll ads that are played before, |
| 1026 |
// during or after the streaming video content that the consumer has requested. |
| 1027 |
// Instream video must be set to “sound on” by default at player start, or |
| 1028 |
// have explicitly clear user intent to watch the video content. While there |
| 1029 |
// may be other content surrounding the player, the video content must be the |
| 1030 |
// focus of the user’s visit. It should remain the primary content on the |
| 1031 |
// page and the only video player in-view capable of audio when playing. If the |
| 1032 |
// player converts to floating/sticky, subsequent ad calls should accurately |
| 1033 |
// convey the updated player size. |
| 1034 |
// "ACCOMPANYING_CONTENT" - Pre-roll, mid-roll, and post-roll ads that are |
| 1035 |
// played before, during, or after streaming video content. The video player |
| 1036 |
// loads and plays before, between, or after paragraphs of text or graphical |
| 1037 |
// content, and starts playing only when it enters the viewport. Accompanying |
| 1038 |
// content should only start playback upon entering the viewport. It may |
| 1039 |
// convert to a floating/sticky player as it scrolls off the page. |
| 1040 |
// "INTERSTITIAL" - Video ads that are played without video content. During |
| 1041 |
// playback, it must be the primary focus of the page and take up the majority |
| 1042 |
// of the viewport and cannot be scrolled out of view. This can be in |
| 1043 |
// placements like in-app video or slideshows. |
| 1044 |
// "NO_CONTENT" - Video ads that are played without streaming video content. |
| 1045 |
// This can be in placements like slideshows, native feeds, in-content or |
| 1046 |
// sticky/floating. |
| 1047 |
VideoPlcmtTypes []string `json:"videoPlcmtTypes,omitempty"` |
| 1048 |
// ForceSendFields is a list of field names (e.g. "SelectionType") to |
| 1049 |
// unconditionally include in API requests. By default, fields with empty or |
| 1050 |
// default values are omitted from API requests. See |
| 1051 |
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more |
| 1052 |
// details. |
| 1053 |
ForceSendFields []string `json:"-"` |
| 1054 |
// NullFields is a list of field names (e.g. "SelectionType") to include in API |
| 1055 |
// requests with the JSON null value. By default, fields with empty values are |
| 1056 |
// omitted from API requests. See |
| 1057 |
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. |
| 1058 |
NullFields []string `json:"-"` |
| 1059 |
} |
| 1060 |
|
| 1061 |
func (s VideoPlcmtTargeting) MarshalJSON() ([]byte, error) { |
| 1062 |
type NoMethod VideoPlcmtTargeting |
| 1063 |
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) |
| 1064 |
} |
| 1065 |
|
| 1066 |
type CuratorsCuratedPackagesActivateCall struct { |
| 1067 |
s *Service |
| 1068 |
name string |
| 1069 |
activatecuratedpackagerequest *ActivateCuratedPackageRequest |
| 1070 |
urlParams_ gensupport.URLParams |
| 1071 |
ctx_ context.Context |
| 1072 |
header_ http.Header |
| 1073 |
} |
| 1074 |
|
| 1075 |
// Activate: Activates an existing curated package. |
| 1076 |
// |
| 1077 |
// - name: The name of the curated package to activate. Format: |
| 1078 |
// `curators/{accountId}/curatedPackages/{curatedPackageId}`. |
| 1079 |
func (r *CuratorsCuratedPackagesService) Activate(name string, activatecuratedpackagerequest *ActivateCuratedPackageRequest) *CuratorsCuratedPackagesActivateCall { |
| 1080 |
c := &CuratorsCuratedPackagesActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1081 |
c.name = name |
| 1082 |
c.activatecuratedpackagerequest = activatecuratedpackagerequest |
| 1083 |
return c |
| 1084 |
} |
| 1085 |
|
| 1086 |
// Fields allows partial responses to be retrieved. See |
| 1087 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1088 |
// details. |
| 1089 |
func (c *CuratorsCuratedPackagesActivateCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesActivateCall { |
| 1090 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1091 |
return c |
| 1092 |
} |
| 1093 |
|
| 1094 |
// Context sets the context to be used in this call's Do method. |
| 1095 |
func (c *CuratorsCuratedPackagesActivateCall) Context(ctx context.Context) *CuratorsCuratedPackagesActivateCall { |
| 1096 |
c.ctx_ = ctx |
| 1097 |
return c |
| 1098 |
} |
| 1099 |
|
| 1100 |
// Header returns a http.Header that can be modified by the caller to add |
| 1101 |
// headers to the request. |
| 1102 |
func (c *CuratorsCuratedPackagesActivateCall) Header() http.Header { |
| 1103 |
if c.header_ == nil { |
| 1104 |
c.header_ = make(http.Header) |
| 1105 |
} |
| 1106 |
return c.header_ |
| 1107 |
} |
| 1108 |
|
| 1109 |
func (c *CuratorsCuratedPackagesActivateCall) doRequest(alt string) (*http.Response, error) { |
| 1110 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1111 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatecuratedpackagerequest) |
| 1112 |
if err != nil { |
| 1113 |
return nil, err |
| 1114 |
} |
| 1115 |
c.urlParams_.Set("alt", alt) |
| 1116 |
c.urlParams_.Set("prettyPrint", "false") |
| 1117 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:activate") |
| 1118 |
urls += "?" + c.urlParams_.Encode() |
| 1119 |
req, err := http.NewRequest("POST", urls, body) |
| 1120 |
if err != nil { |
| 1121 |
return nil, err |
| 1122 |
} |
| 1123 |
req.Header = reqHeaders |
| 1124 |
googleapi.Expand(req.URL, map[string]string{ |
| 1125 |
"name": c.name, |
| 1126 |
}) |
| 1127 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.activate", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1128 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1129 |
} |
| 1130 |
|
| 1131 |
// Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.activate" call. |
| 1132 |
// Any non-2xx status code is an error. Response headers are in either |
| 1133 |
// *CuratedPackage.ServerResponse.Header or (if a response was returned at all) |
| 1134 |
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1135 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1136 |
func (c *CuratorsCuratedPackagesActivateCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) { |
| 1137 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1138 |
res, err := c.doRequest("json") |
| 1139 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1140 |
if res.Body != nil { |
| 1141 |
res.Body.Close() |
| 1142 |
} |
| 1143 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1144 |
Code: res.StatusCode, |
| 1145 |
Header: res.Header, |
| 1146 |
}) |
| 1147 |
} |
| 1148 |
if err != nil { |
| 1149 |
return nil, err |
| 1150 |
} |
| 1151 |
defer googleapi.CloseBody(res) |
| 1152 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1153 |
return nil, gensupport.WrapError(err) |
| 1154 |
} |
| 1155 |
ret := &CuratedPackage{ |
| 1156 |
ServerResponse: googleapi.ServerResponse{ |
| 1157 |
Header: res.Header, |
| 1158 |
HTTPStatusCode: res.StatusCode, |
| 1159 |
}, |
| 1160 |
} |
| 1161 |
target := &ret |
| 1162 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1163 |
if err != nil { |
| 1164 |
return nil, err |
| 1165 |
} |
| 1166 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.activate", "response", internallog.HTTPResponse(res, b)) |
| 1167 |
return ret, nil |
| 1168 |
} |
| 1169 |
|
| 1170 |
type CuratorsCuratedPackagesCreateCall struct { |
| 1171 |
s *Service |
| 1172 |
parent string |
| 1173 |
curatedpackage *CuratedPackage |
| 1174 |
urlParams_ gensupport.URLParams |
| 1175 |
ctx_ context.Context |
| 1176 |
header_ http.Header |
| 1177 |
} |
| 1178 |
|
| 1179 |
// Create: Creates a new curated package. |
| 1180 |
// |
| 1181 |
// - parent: The parent curator account where this curated package will be |
| 1182 |
// created. Format: `curators/{accountId}`. |
| 1183 |
func (r *CuratorsCuratedPackagesService) Create(parent string, curatedpackage *CuratedPackage) *CuratorsCuratedPackagesCreateCall { |
| 1184 |
c := &CuratorsCuratedPackagesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1185 |
c.parent = parent |
| 1186 |
c.curatedpackage = curatedpackage |
| 1187 |
return c |
| 1188 |
} |
| 1189 |
|
| 1190 |
// Fields allows partial responses to be retrieved. See |
| 1191 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1192 |
// details. |
| 1193 |
func (c *CuratorsCuratedPackagesCreateCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesCreateCall { |
| 1194 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1195 |
return c |
| 1196 |
} |
| 1197 |
|
| 1198 |
// Context sets the context to be used in this call's Do method. |
| 1199 |
func (c *CuratorsCuratedPackagesCreateCall) Context(ctx context.Context) *CuratorsCuratedPackagesCreateCall { |
| 1200 |
c.ctx_ = ctx |
| 1201 |
return c |
| 1202 |
} |
| 1203 |
|
| 1204 |
// Header returns a http.Header that can be modified by the caller to add |
| 1205 |
// headers to the request. |
| 1206 |
func (c *CuratorsCuratedPackagesCreateCall) Header() http.Header { |
| 1207 |
if c.header_ == nil { |
| 1208 |
c.header_ = make(http.Header) |
| 1209 |
} |
| 1210 |
return c.header_ |
| 1211 |
} |
| 1212 |
|
| 1213 |
func (c *CuratorsCuratedPackagesCreateCall) doRequest(alt string) (*http.Response, error) { |
| 1214 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1215 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.curatedpackage) |
| 1216 |
if err != nil { |
| 1217 |
return nil, err |
| 1218 |
} |
| 1219 |
c.urlParams_.Set("alt", alt) |
| 1220 |
c.urlParams_.Set("prettyPrint", "false") |
| 1221 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/curatedPackages") |
| 1222 |
urls += "?" + c.urlParams_.Encode() |
| 1223 |
req, err := http.NewRequest("POST", urls, body) |
| 1224 |
if err != nil { |
| 1225 |
return nil, err |
| 1226 |
} |
| 1227 |
req.Header = reqHeaders |
| 1228 |
googleapi.Expand(req.URL, map[string]string{ |
| 1229 |
"parent": c.parent, |
| 1230 |
}) |
| 1231 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.create", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1232 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1233 |
} |
| 1234 |
|
| 1235 |
// Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.create" call. |
| 1236 |
// Any non-2xx status code is an error. Response headers are in either |
| 1237 |
// *CuratedPackage.ServerResponse.Header or (if a response was returned at all) |
| 1238 |
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1239 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1240 |
func (c *CuratorsCuratedPackagesCreateCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) { |
| 1241 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1242 |
res, err := c.doRequest("json") |
| 1243 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1244 |
if res.Body != nil { |
| 1245 |
res.Body.Close() |
| 1246 |
} |
| 1247 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1248 |
Code: res.StatusCode, |
| 1249 |
Header: res.Header, |
| 1250 |
}) |
| 1251 |
} |
| 1252 |
if err != nil { |
| 1253 |
return nil, err |
| 1254 |
} |
| 1255 |
defer googleapi.CloseBody(res) |
| 1256 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1257 |
return nil, gensupport.WrapError(err) |
| 1258 |
} |
| 1259 |
ret := &CuratedPackage{ |
| 1260 |
ServerResponse: googleapi.ServerResponse{ |
| 1261 |
Header: res.Header, |
| 1262 |
HTTPStatusCode: res.StatusCode, |
| 1263 |
}, |
| 1264 |
} |
| 1265 |
target := &ret |
| 1266 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1267 |
if err != nil { |
| 1268 |
return nil, err |
| 1269 |
} |
| 1270 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.create", "response", internallog.HTTPResponse(res, b)) |
| 1271 |
return ret, nil |
| 1272 |
} |
| 1273 |
|
| 1274 |
type CuratorsCuratedPackagesDeactivateCall struct { |
| 1275 |
s *Service |
| 1276 |
name string |
| 1277 |
deactivatecuratedpackagerequest *DeactivateCuratedPackageRequest |
| 1278 |
urlParams_ gensupport.URLParams |
| 1279 |
ctx_ context.Context |
| 1280 |
header_ http.Header |
| 1281 |
} |
| 1282 |
|
| 1283 |
// Deactivate: Deactivates an existing curated package. |
| 1284 |
// |
| 1285 |
// - name: The name of the curated package to deactivate. Format: |
| 1286 |
// `curators/{accountId}/curatedPackages/{curatedPackageId}`. |
| 1287 |
func (r *CuratorsCuratedPackagesService) Deactivate(name string, deactivatecuratedpackagerequest *DeactivateCuratedPackageRequest) *CuratorsCuratedPackagesDeactivateCall { |
| 1288 |
c := &CuratorsCuratedPackagesDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1289 |
c.name = name |
| 1290 |
c.deactivatecuratedpackagerequest = deactivatecuratedpackagerequest |
| 1291 |
return c |
| 1292 |
} |
| 1293 |
|
| 1294 |
// Fields allows partial responses to be retrieved. See |
| 1295 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1296 |
// details. |
| 1297 |
func (c *CuratorsCuratedPackagesDeactivateCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesDeactivateCall { |
| 1298 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1299 |
return c |
| 1300 |
} |
| 1301 |
|
| 1302 |
// Context sets the context to be used in this call's Do method. |
| 1303 |
func (c *CuratorsCuratedPackagesDeactivateCall) Context(ctx context.Context) *CuratorsCuratedPackagesDeactivateCall { |
| 1304 |
c.ctx_ = ctx |
| 1305 |
return c |
| 1306 |
} |
| 1307 |
|
| 1308 |
// Header returns a http.Header that can be modified by the caller to add |
| 1309 |
// headers to the request. |
| 1310 |
func (c *CuratorsCuratedPackagesDeactivateCall) Header() http.Header { |
| 1311 |
if c.header_ == nil { |
| 1312 |
c.header_ = make(http.Header) |
| 1313 |
} |
| 1314 |
return c.header_ |
| 1315 |
} |
| 1316 |
|
| 1317 |
func (c *CuratorsCuratedPackagesDeactivateCall) doRequest(alt string) (*http.Response, error) { |
| 1318 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1319 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatecuratedpackagerequest) |
| 1320 |
if err != nil { |
| 1321 |
return nil, err |
| 1322 |
} |
| 1323 |
c.urlParams_.Set("alt", alt) |
| 1324 |
c.urlParams_.Set("prettyPrint", "false") |
| 1325 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:deactivate") |
| 1326 |
urls += "?" + c.urlParams_.Encode() |
| 1327 |
req, err := http.NewRequest("POST", urls, body) |
| 1328 |
if err != nil { |
| 1329 |
return nil, err |
| 1330 |
} |
| 1331 |
req.Header = reqHeaders |
| 1332 |
googleapi.Expand(req.URL, map[string]string{ |
| 1333 |
"name": c.name, |
| 1334 |
}) |
| 1335 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.deactivate", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1336 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1337 |
} |
| 1338 |
|
| 1339 |
// Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.deactivate" call. |
| 1340 |
// Any non-2xx status code is an error. Response headers are in either |
| 1341 |
// *CuratedPackage.ServerResponse.Header or (if a response was returned at all) |
| 1342 |
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1343 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1344 |
func (c *CuratorsCuratedPackagesDeactivateCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) { |
| 1345 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1346 |
res, err := c.doRequest("json") |
| 1347 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1348 |
if res.Body != nil { |
| 1349 |
res.Body.Close() |
| 1350 |
} |
| 1351 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1352 |
Code: res.StatusCode, |
| 1353 |
Header: res.Header, |
| 1354 |
}) |
| 1355 |
} |
| 1356 |
if err != nil { |
| 1357 |
return nil, err |
| 1358 |
} |
| 1359 |
defer googleapi.CloseBody(res) |
| 1360 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1361 |
return nil, gensupport.WrapError(err) |
| 1362 |
} |
| 1363 |
ret := &CuratedPackage{ |
| 1364 |
ServerResponse: googleapi.ServerResponse{ |
| 1365 |
Header: res.Header, |
| 1366 |
HTTPStatusCode: res.StatusCode, |
| 1367 |
}, |
| 1368 |
} |
| 1369 |
target := &ret |
| 1370 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1371 |
if err != nil { |
| 1372 |
return nil, err |
| 1373 |
} |
| 1374 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.deactivate", "response", internallog.HTTPResponse(res, b)) |
| 1375 |
return ret, nil |
| 1376 |
} |
| 1377 |
|
| 1378 |
type CuratorsCuratedPackagesGetCall struct { |
| 1379 |
s *Service |
| 1380 |
name string |
| 1381 |
urlParams_ gensupport.URLParams |
| 1382 |
ifNoneMatch_ string |
| 1383 |
ctx_ context.Context |
| 1384 |
header_ http.Header |
| 1385 |
} |
| 1386 |
|
| 1387 |
// Get: Gets a curated package given its resource name. |
| 1388 |
// |
| 1389 |
// - name: The name of the curated package to retrieve. Format: |
| 1390 |
// `curators/{accountId}/curatedPackages/{curatedPackageId}`. |
| 1391 |
func (r *CuratorsCuratedPackagesService) Get(name string) *CuratorsCuratedPackagesGetCall { |
| 1392 |
c := &CuratorsCuratedPackagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1393 |
c.name = name |
| 1394 |
return c |
| 1395 |
} |
| 1396 |
|
| 1397 |
// Fields allows partial responses to be retrieved. See |
| 1398 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1399 |
// details. |
| 1400 |
func (c *CuratorsCuratedPackagesGetCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesGetCall { |
| 1401 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1402 |
return c |
| 1403 |
} |
| 1404 |
|
| 1405 |
// IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 1406 |
// object's ETag matches the given value. This is useful for getting updates |
| 1407 |
// only after the object has changed since the last request. |
| 1408 |
func (c *CuratorsCuratedPackagesGetCall) IfNoneMatch(entityTag string) *CuratorsCuratedPackagesGetCall { |
| 1409 |
c.ifNoneMatch_ = entityTag |
| 1410 |
return c |
| 1411 |
} |
| 1412 |
|
| 1413 |
// Context sets the context to be used in this call's Do method. |
| 1414 |
func (c *CuratorsCuratedPackagesGetCall) Context(ctx context.Context) *CuratorsCuratedPackagesGetCall { |
| 1415 |
c.ctx_ = ctx |
| 1416 |
return c |
| 1417 |
} |
| 1418 |
|
| 1419 |
// Header returns a http.Header that can be modified by the caller to add |
| 1420 |
// headers to the request. |
| 1421 |
func (c *CuratorsCuratedPackagesGetCall) Header() http.Header { |
| 1422 |
if c.header_ == nil { |
| 1423 |
c.header_ = make(http.Header) |
| 1424 |
} |
| 1425 |
return c.header_ |
| 1426 |
} |
| 1427 |
|
| 1428 |
func (c *CuratorsCuratedPackagesGetCall) doRequest(alt string) (*http.Response, error) { |
| 1429 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1430 |
if c.ifNoneMatch_ != "" { |
| 1431 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1432 |
} |
| 1433 |
c.urlParams_.Set("alt", alt) |
| 1434 |
c.urlParams_.Set("prettyPrint", "false") |
| 1435 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1436 |
urls += "?" + c.urlParams_.Encode() |
| 1437 |
req, err := http.NewRequest("GET", urls, nil) |
| 1438 |
if err != nil { |
| 1439 |
return nil, err |
| 1440 |
} |
| 1441 |
req.Header = reqHeaders |
| 1442 |
googleapi.Expand(req.URL, map[string]string{ |
| 1443 |
"name": c.name, |
| 1444 |
}) |
| 1445 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.get", "request", internallog.HTTPRequest(req, nil)) |
| 1446 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1447 |
} |
| 1448 |
|
| 1449 |
// Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.get" call. |
| 1450 |
// Any non-2xx status code is an error. Response headers are in either |
| 1451 |
// *CuratedPackage.ServerResponse.Header or (if a response was returned at all) |
| 1452 |
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1453 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1454 |
func (c *CuratorsCuratedPackagesGetCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) { |
| 1455 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1456 |
res, err := c.doRequest("json") |
| 1457 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1458 |
if res.Body != nil { |
| 1459 |
res.Body.Close() |
| 1460 |
} |
| 1461 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1462 |
Code: res.StatusCode, |
| 1463 |
Header: res.Header, |
| 1464 |
}) |
| 1465 |
} |
| 1466 |
if err != nil { |
| 1467 |
return nil, err |
| 1468 |
} |
| 1469 |
defer googleapi.CloseBody(res) |
| 1470 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1471 |
return nil, gensupport.WrapError(err) |
| 1472 |
} |
| 1473 |
ret := &CuratedPackage{ |
| 1474 |
ServerResponse: googleapi.ServerResponse{ |
| 1475 |
Header: res.Header, |
| 1476 |
HTTPStatusCode: res.StatusCode, |
| 1477 |
}, |
| 1478 |
} |
| 1479 |
target := &ret |
| 1480 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1481 |
if err != nil { |
| 1482 |
return nil, err |
| 1483 |
} |
| 1484 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.get", "response", internallog.HTTPResponse(res, b)) |
| 1485 |
return ret, nil |
| 1486 |
} |
| 1487 |
|
| 1488 |
type CuratorsCuratedPackagesListCall struct { |
| 1489 |
s *Service |
| 1490 |
parent string |
| 1491 |
urlParams_ gensupport.URLParams |
| 1492 |
ifNoneMatch_ string |
| 1493 |
ctx_ context.Context |
| 1494 |
header_ http.Header |
| 1495 |
} |
| 1496 |
|
| 1497 |
// List: Lists curated packages owned by the specified curator. |
| 1498 |
// |
| 1499 |
// - parent: The parent curator account which owns this collection of curated |
| 1500 |
// packages. Format: `curators/{accountId}`. |
| 1501 |
func (r *CuratorsCuratedPackagesService) List(parent string) *CuratorsCuratedPackagesListCall { |
| 1502 |
c := &CuratorsCuratedPackagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1503 |
c.parent = parent |
| 1504 |
return c |
| 1505 |
} |
| 1506 |
|
| 1507 |
// Filter sets the optional parameter "filter": Optional query string using the |
| 1508 |
// Cloud API list filtering syntax |
| 1509 |
// (/authorized-buyers/apis/guides/list-filters). Supported columns for |
| 1510 |
// filtering are: * displayName * createTime * updateTime * state * |
| 1511 |
// feeCpm.currencyCode * feeCpm.units * feeCpm.nanos * |
| 1512 |
// floorPriceCpm.currencyCode * floorPriceCpm.units * floorPriceCpm.nanos |
| 1513 |
func (c *CuratorsCuratedPackagesListCall) Filter(filter string) *CuratorsCuratedPackagesListCall { |
| 1514 |
c.urlParams_.Set("filter", filter) |
| 1515 |
return c |
| 1516 |
} |
| 1517 |
|
| 1518 |
// PageSize sets the optional parameter "pageSize": Requested page size. The |
| 1519 |
// server may return fewer results than requested. Max allowed page size is |
| 1520 |
// 500. If unspecified, the server will default to 500. |
| 1521 |
func (c *CuratorsCuratedPackagesListCall) PageSize(pageSize int64) *CuratorsCuratedPackagesListCall { |
| 1522 |
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 1523 |
return c |
| 1524 |
} |
| 1525 |
|
| 1526 |
// PageToken sets the optional parameter "pageToken": A page token, received |
| 1527 |
// from a previous `ListCuratedPackages` call. Provide this to retrieve the |
| 1528 |
// subsequent page. |
| 1529 |
func (c *CuratorsCuratedPackagesListCall) PageToken(pageToken string) *CuratorsCuratedPackagesListCall { |
| 1530 |
c.urlParams_.Set("pageToken", pageToken) |
| 1531 |
return c |
| 1532 |
} |
| 1533 |
|
| 1534 |
// Fields allows partial responses to be retrieved. See |
| 1535 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1536 |
// details. |
| 1537 |
func (c *CuratorsCuratedPackagesListCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesListCall { |
| 1538 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1539 |
return c |
| 1540 |
} |
| 1541 |
|
| 1542 |
// IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 1543 |
// object's ETag matches the given value. This is useful for getting updates |
| 1544 |
// only after the object has changed since the last request. |
| 1545 |
func (c *CuratorsCuratedPackagesListCall) IfNoneMatch(entityTag string) *CuratorsCuratedPackagesListCall { |
| 1546 |
c.ifNoneMatch_ = entityTag |
| 1547 |
return c |
| 1548 |
} |
| 1549 |
|
| 1550 |
// Context sets the context to be used in this call's Do method. |
| 1551 |
func (c *CuratorsCuratedPackagesListCall) Context(ctx context.Context) *CuratorsCuratedPackagesListCall { |
| 1552 |
c.ctx_ = ctx |
| 1553 |
return c |
| 1554 |
} |
| 1555 |
|
| 1556 |
// Header returns a http.Header that can be modified by the caller to add |
| 1557 |
// headers to the request. |
| 1558 |
func (c *CuratorsCuratedPackagesListCall) Header() http.Header { |
| 1559 |
if c.header_ == nil { |
| 1560 |
c.header_ = make(http.Header) |
| 1561 |
} |
| 1562 |
return c.header_ |
| 1563 |
} |
| 1564 |
|
| 1565 |
func (c *CuratorsCuratedPackagesListCall) doRequest(alt string) (*http.Response, error) { |
| 1566 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 1567 |
if c.ifNoneMatch_ != "" { |
| 1568 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 1569 |
} |
| 1570 |
c.urlParams_.Set("alt", alt) |
| 1571 |
c.urlParams_.Set("prettyPrint", "false") |
| 1572 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/curatedPackages") |
| 1573 |
urls += "?" + c.urlParams_.Encode() |
| 1574 |
req, err := http.NewRequest("GET", urls, nil) |
| 1575 |
if err != nil { |
| 1576 |
return nil, err |
| 1577 |
} |
| 1578 |
req.Header = reqHeaders |
| 1579 |
googleapi.Expand(req.URL, map[string]string{ |
| 1580 |
"parent": c.parent, |
| 1581 |
}) |
| 1582 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.list", "request", internallog.HTTPRequest(req, nil)) |
| 1583 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1584 |
} |
| 1585 |
|
| 1586 |
// Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.list" call. |
| 1587 |
// Any non-2xx status code is an error. Response headers are in either |
| 1588 |
// *ListCuratedPackagesResponse.ServerResponse.Header or (if a response was |
| 1589 |
// returned at all) in error.(*googleapi.Error).Header. Use |
| 1590 |
// googleapi.IsNotModified to check whether the returned error was because |
| 1591 |
// http.StatusNotModified was returned. |
| 1592 |
func (c *CuratorsCuratedPackagesListCall) Do(opts ...googleapi.CallOption) (*ListCuratedPackagesResponse, error) { |
| 1593 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1594 |
res, err := c.doRequest("json") |
| 1595 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1596 |
if res.Body != nil { |
| 1597 |
res.Body.Close() |
| 1598 |
} |
| 1599 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1600 |
Code: res.StatusCode, |
| 1601 |
Header: res.Header, |
| 1602 |
}) |
| 1603 |
} |
| 1604 |
if err != nil { |
| 1605 |
return nil, err |
| 1606 |
} |
| 1607 |
defer googleapi.CloseBody(res) |
| 1608 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1609 |
return nil, gensupport.WrapError(err) |
| 1610 |
} |
| 1611 |
ret := &ListCuratedPackagesResponse{ |
| 1612 |
ServerResponse: googleapi.ServerResponse{ |
| 1613 |
Header: res.Header, |
| 1614 |
HTTPStatusCode: res.StatusCode, |
| 1615 |
}, |
| 1616 |
} |
| 1617 |
target := &ret |
| 1618 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1619 |
if err != nil { |
| 1620 |
return nil, err |
| 1621 |
} |
| 1622 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.list", "response", internallog.HTTPResponse(res, b)) |
| 1623 |
return ret, nil |
| 1624 |
} |
| 1625 |
|
| 1626 |
// Pages invokes f for each page of results. |
| 1627 |
// A non-nil error returned from f will halt the iteration. |
| 1628 |
// The provided context supersedes any context provided to the Context method. |
| 1629 |
func (c *CuratorsCuratedPackagesListCall) Pages(ctx context.Context, f func(*ListCuratedPackagesResponse) error) error { |
| 1630 |
c.ctx_ = ctx |
| 1631 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 1632 |
for { |
| 1633 |
x, err := c.Do() |
| 1634 |
if err != nil { |
| 1635 |
return err |
| 1636 |
} |
| 1637 |
if err := f(x); err != nil { |
| 1638 |
return err |
| 1639 |
} |
| 1640 |
if x.NextPageToken == "" { |
| 1641 |
return nil |
| 1642 |
} |
| 1643 |
c.PageToken(x.NextPageToken) |
| 1644 |
} |
| 1645 |
} |
| 1646 |
|
| 1647 |
type CuratorsCuratedPackagesPatchCall struct { |
| 1648 |
s *Service |
| 1649 |
name string |
| 1650 |
curatedpackage *CuratedPackage |
| 1651 |
urlParams_ gensupport.URLParams |
| 1652 |
ctx_ context.Context |
| 1653 |
header_ http.Header |
| 1654 |
} |
| 1655 |
|
| 1656 |
// Patch: Updates an existing curated package. |
| 1657 |
// |
| 1658 |
// - name: Identifier. The unique resource name for the curated package. |
| 1659 |
// Format: `curators/{accountId}/curatedPackages/{curatedPackageId}`. |
| 1660 |
func (r *CuratorsCuratedPackagesService) Patch(name string, curatedpackage *CuratedPackage) *CuratorsCuratedPackagesPatchCall { |
| 1661 |
c := &CuratorsCuratedPackagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1662 |
c.name = name |
| 1663 |
c.curatedpackage = curatedpackage |
| 1664 |
return c |
| 1665 |
} |
| 1666 |
|
| 1667 |
// UpdateMask sets the optional parameter "updateMask": List of fields to be |
| 1668 |
// updated. If empty or unspecified, the service will update all fields |
| 1669 |
// populated in the update request excluding the output only fields and |
| 1670 |
// primitive fields with default value. Note that explicit field mask is |
| 1671 |
// required in order to reset a primitive field back to its default value, for |
| 1672 |
// example, false for boolean fields, 0 for integer fields. A special field |
| 1673 |
// mask consisting of a single path "*" can be used to indicate full |
| 1674 |
// replacement (the equivalent of PUT method), updatable fields unset or |
| 1675 |
// unspecified in the input will be cleared or set to default value. Output |
| 1676 |
// only fields will be ignored regardless of the value of updateMask. |
| 1677 |
func (c *CuratorsCuratedPackagesPatchCall) UpdateMask(updateMask string) *CuratorsCuratedPackagesPatchCall { |
| 1678 |
c.urlParams_.Set("updateMask", updateMask) |
| 1679 |
return c |
| 1680 |
} |
| 1681 |
|
| 1682 |
// Fields allows partial responses to be retrieved. See |
| 1683 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1684 |
// details. |
| 1685 |
func (c *CuratorsCuratedPackagesPatchCall) Fields(s ...googleapi.Field) *CuratorsCuratedPackagesPatchCall { |
| 1686 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1687 |
return c |
| 1688 |
} |
| 1689 |
|
| 1690 |
// Context sets the context to be used in this call's Do method. |
| 1691 |
func (c *CuratorsCuratedPackagesPatchCall) Context(ctx context.Context) *CuratorsCuratedPackagesPatchCall { |
| 1692 |
c.ctx_ = ctx |
| 1693 |
return c |
| 1694 |
} |
| 1695 |
|
| 1696 |
// Header returns a http.Header that can be modified by the caller to add |
| 1697 |
// headers to the request. |
| 1698 |
func (c *CuratorsCuratedPackagesPatchCall) Header() http.Header { |
| 1699 |
if c.header_ == nil { |
| 1700 |
c.header_ = make(http.Header) |
| 1701 |
} |
| 1702 |
return c.header_ |
| 1703 |
} |
| 1704 |
|
| 1705 |
func (c *CuratorsCuratedPackagesPatchCall) doRequest(alt string) (*http.Response, error) { |
| 1706 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1707 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.curatedpackage) |
| 1708 |
if err != nil { |
| 1709 |
return nil, err |
| 1710 |
} |
| 1711 |
c.urlParams_.Set("alt", alt) |
| 1712 |
c.urlParams_.Set("prettyPrint", "false") |
| 1713 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 1714 |
urls += "?" + c.urlParams_.Encode() |
| 1715 |
req, err := http.NewRequest("PATCH", urls, body) |
| 1716 |
if err != nil { |
| 1717 |
return nil, err |
| 1718 |
} |
| 1719 |
req.Header = reqHeaders |
| 1720 |
googleapi.Expand(req.URL, map[string]string{ |
| 1721 |
"name": c.name, |
| 1722 |
}) |
| 1723 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.patch", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1724 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1725 |
} |
| 1726 |
|
| 1727 |
// Do executes the "authorizedbuyersmarketplace.curators.curatedPackages.patch" call. |
| 1728 |
// Any non-2xx status code is an error. Response headers are in either |
| 1729 |
// *CuratedPackage.ServerResponse.Header or (if a response was returned at all) |
| 1730 |
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1731 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1732 |
func (c *CuratorsCuratedPackagesPatchCall) Do(opts ...googleapi.CallOption) (*CuratedPackage, error) { |
| 1733 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1734 |
res, err := c.doRequest("json") |
| 1735 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1736 |
if res.Body != nil { |
| 1737 |
res.Body.Close() |
| 1738 |
} |
| 1739 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1740 |
Code: res.StatusCode, |
| 1741 |
Header: res.Header, |
| 1742 |
}) |
| 1743 |
} |
| 1744 |
if err != nil { |
| 1745 |
return nil, err |
| 1746 |
} |
| 1747 |
defer googleapi.CloseBody(res) |
| 1748 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1749 |
return nil, gensupport.WrapError(err) |
| 1750 |
} |
| 1751 |
ret := &CuratedPackage{ |
| 1752 |
ServerResponse: googleapi.ServerResponse{ |
| 1753 |
Header: res.Header, |
| 1754 |
HTTPStatusCode: res.StatusCode, |
| 1755 |
}, |
| 1756 |
} |
| 1757 |
target := &ret |
| 1758 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1759 |
if err != nil { |
| 1760 |
return nil, err |
| 1761 |
} |
| 1762 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.curatedPackages.patch", "response", internallog.HTTPResponse(res, b)) |
| 1763 |
return ret, nil |
| 1764 |
} |
| 1765 |
|
| 1766 |
type CuratorsDataSegmentsActivateCall struct { |
| 1767 |
s *Service |
| 1768 |
name string |
| 1769 |
activatedatasegmentrequest *ActivateDataSegmentRequest |
| 1770 |
urlParams_ gensupport.URLParams |
| 1771 |
ctx_ context.Context |
| 1772 |
header_ http.Header |
| 1773 |
} |
| 1774 |
|
| 1775 |
// Activate: Activates a data segment. |
| 1776 |
// |
| 1777 |
// - name: Name of data segment to activate. v1alpha format: |
| 1778 |
// `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta format: |
| 1779 |
// `curators/{accountId}/dataSegments/{curatorDataSegmentId}`. |
| 1780 |
func (r *CuratorsDataSegmentsService) Activate(name string, activatedatasegmentrequest *ActivateDataSegmentRequest) *CuratorsDataSegmentsActivateCall { |
| 1781 |
c := &CuratorsDataSegmentsActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1782 |
c.name = name |
| 1783 |
c.activatedatasegmentrequest = activatedatasegmentrequest |
| 1784 |
return c |
| 1785 |
} |
| 1786 |
|
| 1787 |
// Fields allows partial responses to be retrieved. See |
| 1788 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1789 |
// details. |
| 1790 |
func (c *CuratorsDataSegmentsActivateCall) Fields(s ...googleapi.Field) *CuratorsDataSegmentsActivateCall { |
| 1791 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1792 |
return c |
| 1793 |
} |
| 1794 |
|
| 1795 |
// Context sets the context to be used in this call's Do method. |
| 1796 |
func (c *CuratorsDataSegmentsActivateCall) Context(ctx context.Context) *CuratorsDataSegmentsActivateCall { |
| 1797 |
c.ctx_ = ctx |
| 1798 |
return c |
| 1799 |
} |
| 1800 |
|
| 1801 |
// Header returns a http.Header that can be modified by the caller to add |
| 1802 |
// headers to the request. |
| 1803 |
func (c *CuratorsDataSegmentsActivateCall) Header() http.Header { |
| 1804 |
if c.header_ == nil { |
| 1805 |
c.header_ = make(http.Header) |
| 1806 |
} |
| 1807 |
return c.header_ |
| 1808 |
} |
| 1809 |
|
| 1810 |
func (c *CuratorsDataSegmentsActivateCall) doRequest(alt string) (*http.Response, error) { |
| 1811 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1812 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.activatedatasegmentrequest) |
| 1813 |
if err != nil { |
| 1814 |
return nil, err |
| 1815 |
} |
| 1816 |
c.urlParams_.Set("alt", alt) |
| 1817 |
c.urlParams_.Set("prettyPrint", "false") |
| 1818 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:activate") |
| 1819 |
urls += "?" + c.urlParams_.Encode() |
| 1820 |
req, err := http.NewRequest("POST", urls, body) |
| 1821 |
if err != nil { |
| 1822 |
return nil, err |
| 1823 |
} |
| 1824 |
req.Header = reqHeaders |
| 1825 |
googleapi.Expand(req.URL, map[string]string{ |
| 1826 |
"name": c.name, |
| 1827 |
}) |
| 1828 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.activate", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1829 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1830 |
} |
| 1831 |
|
| 1832 |
// Do executes the "authorizedbuyersmarketplace.curators.dataSegments.activate" call. |
| 1833 |
// Any non-2xx status code is an error. Response headers are in either |
| 1834 |
// *DataSegment.ServerResponse.Header or (if a response was returned at all) in |
| 1835 |
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1836 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1837 |
func (c *CuratorsDataSegmentsActivateCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) { |
| 1838 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1839 |
res, err := c.doRequest("json") |
| 1840 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1841 |
if res.Body != nil { |
| 1842 |
res.Body.Close() |
| 1843 |
} |
| 1844 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1845 |
Code: res.StatusCode, |
| 1846 |
Header: res.Header, |
| 1847 |
}) |
| 1848 |
} |
| 1849 |
if err != nil { |
| 1850 |
return nil, err |
| 1851 |
} |
| 1852 |
defer googleapi.CloseBody(res) |
| 1853 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1854 |
return nil, gensupport.WrapError(err) |
| 1855 |
} |
| 1856 |
ret := &DataSegment{ |
| 1857 |
ServerResponse: googleapi.ServerResponse{ |
| 1858 |
Header: res.Header, |
| 1859 |
HTTPStatusCode: res.StatusCode, |
| 1860 |
}, |
| 1861 |
} |
| 1862 |
target := &ret |
| 1863 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1864 |
if err != nil { |
| 1865 |
return nil, err |
| 1866 |
} |
| 1867 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.activate", "response", internallog.HTTPResponse(res, b)) |
| 1868 |
return ret, nil |
| 1869 |
} |
| 1870 |
|
| 1871 |
type CuratorsDataSegmentsCreateCall struct { |
| 1872 |
s *Service |
| 1873 |
parent string |
| 1874 |
datasegment *DataSegment |
| 1875 |
urlParams_ gensupport.URLParams |
| 1876 |
ctx_ context.Context |
| 1877 |
header_ http.Header |
| 1878 |
} |
| 1879 |
|
| 1880 |
// Create: Creates a data segment owned by the listed curator. The data segment |
| 1881 |
// will be created in the `ACTIVE` state, meaning it will be immediately |
| 1882 |
// available for buyers to use in preferred deals, private auction deals, and |
| 1883 |
// auction packages. |
| 1884 |
// |
| 1885 |
// - parent: The parent resource where this data segment will be created. |
| 1886 |
// v1alpha format: `buyers/{accountId}` v1beta format: `curators/{accountId}`. |
| 1887 |
func (r *CuratorsDataSegmentsService) Create(parent string, datasegment *DataSegment) *CuratorsDataSegmentsCreateCall { |
| 1888 |
c := &CuratorsDataSegmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1889 |
c.parent = parent |
| 1890 |
c.datasegment = datasegment |
| 1891 |
return c |
| 1892 |
} |
| 1893 |
|
| 1894 |
// Fields allows partial responses to be retrieved. See |
| 1895 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 1896 |
// details. |
| 1897 |
func (c *CuratorsDataSegmentsCreateCall) Fields(s ...googleapi.Field) *CuratorsDataSegmentsCreateCall { |
| 1898 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 1899 |
return c |
| 1900 |
} |
| 1901 |
|
| 1902 |
// Context sets the context to be used in this call's Do method. |
| 1903 |
func (c *CuratorsDataSegmentsCreateCall) Context(ctx context.Context) *CuratorsDataSegmentsCreateCall { |
| 1904 |
c.ctx_ = ctx |
| 1905 |
return c |
| 1906 |
} |
| 1907 |
|
| 1908 |
// Header returns a http.Header that can be modified by the caller to add |
| 1909 |
// headers to the request. |
| 1910 |
func (c *CuratorsDataSegmentsCreateCall) Header() http.Header { |
| 1911 |
if c.header_ == nil { |
| 1912 |
c.header_ = make(http.Header) |
| 1913 |
} |
| 1914 |
return c.header_ |
| 1915 |
} |
| 1916 |
|
| 1917 |
func (c *CuratorsDataSegmentsCreateCall) doRequest(alt string) (*http.Response, error) { |
| 1918 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 1919 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasegment) |
| 1920 |
if err != nil { |
| 1921 |
return nil, err |
| 1922 |
} |
| 1923 |
c.urlParams_.Set("alt", alt) |
| 1924 |
c.urlParams_.Set("prettyPrint", "false") |
| 1925 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/dataSegments") |
| 1926 |
urls += "?" + c.urlParams_.Encode() |
| 1927 |
req, err := http.NewRequest("POST", urls, body) |
| 1928 |
if err != nil { |
| 1929 |
return nil, err |
| 1930 |
} |
| 1931 |
req.Header = reqHeaders |
| 1932 |
googleapi.Expand(req.URL, map[string]string{ |
| 1933 |
"parent": c.parent, |
| 1934 |
}) |
| 1935 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.create", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 1936 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 1937 |
} |
| 1938 |
|
| 1939 |
// Do executes the "authorizedbuyersmarketplace.curators.dataSegments.create" call. |
| 1940 |
// Any non-2xx status code is an error. Response headers are in either |
| 1941 |
// *DataSegment.ServerResponse.Header or (if a response was returned at all) in |
| 1942 |
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 1943 |
// whether the returned error was because http.StatusNotModified was returned. |
| 1944 |
func (c *CuratorsDataSegmentsCreateCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) { |
| 1945 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 1946 |
res, err := c.doRequest("json") |
| 1947 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 1948 |
if res.Body != nil { |
| 1949 |
res.Body.Close() |
| 1950 |
} |
| 1951 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 1952 |
Code: res.StatusCode, |
| 1953 |
Header: res.Header, |
| 1954 |
}) |
| 1955 |
} |
| 1956 |
if err != nil { |
| 1957 |
return nil, err |
| 1958 |
} |
| 1959 |
defer googleapi.CloseBody(res) |
| 1960 |
if err := googleapi.CheckResponse(res); err != nil { |
| 1961 |
return nil, gensupport.WrapError(err) |
| 1962 |
} |
| 1963 |
ret := &DataSegment{ |
| 1964 |
ServerResponse: googleapi.ServerResponse{ |
| 1965 |
Header: res.Header, |
| 1966 |
HTTPStatusCode: res.StatusCode, |
| 1967 |
}, |
| 1968 |
} |
| 1969 |
target := &ret |
| 1970 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 1971 |
if err != nil { |
| 1972 |
return nil, err |
| 1973 |
} |
| 1974 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.create", "response", internallog.HTTPResponse(res, b)) |
| 1975 |
return ret, nil |
| 1976 |
} |
| 1977 |
|
| 1978 |
type CuratorsDataSegmentsDeactivateCall struct { |
| 1979 |
s *Service |
| 1980 |
name string |
| 1981 |
deactivatedatasegmentrequest *DeactivateDataSegmentRequest |
| 1982 |
urlParams_ gensupport.URLParams |
| 1983 |
ctx_ context.Context |
| 1984 |
header_ http.Header |
| 1985 |
} |
| 1986 |
|
| 1987 |
// Deactivate: Deactivates a data segment. |
| 1988 |
// |
| 1989 |
// - name: Name of data segment to deactivate. v1alpha format: |
| 1990 |
// `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta format: |
| 1991 |
// `curators/{accountId}/dataSegments/{curatorDataSegmentId}`. |
| 1992 |
func (r *CuratorsDataSegmentsService) Deactivate(name string, deactivatedatasegmentrequest *DeactivateDataSegmentRequest) *CuratorsDataSegmentsDeactivateCall { |
| 1993 |
c := &CuratorsDataSegmentsDeactivateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 1994 |
c.name = name |
| 1995 |
c.deactivatedatasegmentrequest = deactivatedatasegmentrequest |
| 1996 |
return c |
| 1997 |
} |
| 1998 |
|
| 1999 |
// Fields allows partial responses to be retrieved. See |
| 2000 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 2001 |
// details. |
| 2002 |
func (c *CuratorsDataSegmentsDeactivateCall) Fields(s ...googleapi.Field) *CuratorsDataSegmentsDeactivateCall { |
| 2003 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2004 |
return c |
| 2005 |
} |
| 2006 |
|
| 2007 |
// Context sets the context to be used in this call's Do method. |
| 2008 |
func (c *CuratorsDataSegmentsDeactivateCall) Context(ctx context.Context) *CuratorsDataSegmentsDeactivateCall { |
| 2009 |
c.ctx_ = ctx |
| 2010 |
return c |
| 2011 |
} |
| 2012 |
|
| 2013 |
// Header returns a http.Header that can be modified by the caller to add |
| 2014 |
// headers to the request. |
| 2015 |
func (c *CuratorsDataSegmentsDeactivateCall) Header() http.Header { |
| 2016 |
if c.header_ == nil { |
| 2017 |
c.header_ = make(http.Header) |
| 2018 |
} |
| 2019 |
return c.header_ |
| 2020 |
} |
| 2021 |
|
| 2022 |
func (c *CuratorsDataSegmentsDeactivateCall) doRequest(alt string) (*http.Response, error) { |
| 2023 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 2024 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.deactivatedatasegmentrequest) |
| 2025 |
if err != nil { |
| 2026 |
return nil, err |
| 2027 |
} |
| 2028 |
c.urlParams_.Set("alt", alt) |
| 2029 |
c.urlParams_.Set("prettyPrint", "false") |
| 2030 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:deactivate") |
| 2031 |
urls += "?" + c.urlParams_.Encode() |
| 2032 |
req, err := http.NewRequest("POST", urls, body) |
| 2033 |
if err != nil { |
| 2034 |
return nil, err |
| 2035 |
} |
| 2036 |
req.Header = reqHeaders |
| 2037 |
googleapi.Expand(req.URL, map[string]string{ |
| 2038 |
"name": c.name, |
| 2039 |
}) |
| 2040 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.deactivate", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 2041 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2042 |
} |
| 2043 |
|
| 2044 |
// Do executes the "authorizedbuyersmarketplace.curators.dataSegments.deactivate" call. |
| 2045 |
// Any non-2xx status code is an error. Response headers are in either |
| 2046 |
// *DataSegment.ServerResponse.Header or (if a response was returned at all) in |
| 2047 |
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 2048 |
// whether the returned error was because http.StatusNotModified was returned. |
| 2049 |
func (c *CuratorsDataSegmentsDeactivateCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) { |
| 2050 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 2051 |
res, err := c.doRequest("json") |
| 2052 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 2053 |
if res.Body != nil { |
| 2054 |
res.Body.Close() |
| 2055 |
} |
| 2056 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 2057 |
Code: res.StatusCode, |
| 2058 |
Header: res.Header, |
| 2059 |
}) |
| 2060 |
} |
| 2061 |
if err != nil { |
| 2062 |
return nil, err |
| 2063 |
} |
| 2064 |
defer googleapi.CloseBody(res) |
| 2065 |
if err := googleapi.CheckResponse(res); err != nil { |
| 2066 |
return nil, gensupport.WrapError(err) |
| 2067 |
} |
| 2068 |
ret := &DataSegment{ |
| 2069 |
ServerResponse: googleapi.ServerResponse{ |
| 2070 |
Header: res.Header, |
| 2071 |
HTTPStatusCode: res.StatusCode, |
| 2072 |
}, |
| 2073 |
} |
| 2074 |
target := &ret |
| 2075 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2076 |
if err != nil { |
| 2077 |
return nil, err |
| 2078 |
} |
| 2079 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.deactivate", "response", internallog.HTTPResponse(res, b)) |
| 2080 |
return ret, nil |
| 2081 |
} |
| 2082 |
|
| 2083 |
type CuratorsDataSegmentsGetCall struct { |
| 2084 |
s *Service |
| 2085 |
name string |
| 2086 |
urlParams_ gensupport.URLParams |
| 2087 |
ifNoneMatch_ string |
| 2088 |
ctx_ context.Context |
| 2089 |
header_ http.Header |
| 2090 |
} |
| 2091 |
|
| 2092 |
// Get: Gets a data segment given its name. |
| 2093 |
// |
| 2094 |
// - name: Name of data segment to get. v1alpha format: |
| 2095 |
// `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta format: |
| 2096 |
// `curators/{accountId}/dataSegments/{curatorDataSegmentId}`. |
| 2097 |
func (r *CuratorsDataSegmentsService) Get(name string) *CuratorsDataSegmentsGetCall { |
| 2098 |
c := &CuratorsDataSegmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 2099 |
c.name = name |
| 2100 |
return c |
| 2101 |
} |
| 2102 |
|
| 2103 |
// Fields allows partial responses to be retrieved. See |
| 2104 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 2105 |
// details. |
| 2106 |
func (c *CuratorsDataSegmentsGetCall) Fields(s ...googleapi.Field) *CuratorsDataSegmentsGetCall { |
| 2107 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2108 |
return c |
| 2109 |
} |
| 2110 |
|
| 2111 |
// IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 2112 |
// object's ETag matches the given value. This is useful for getting updates |
| 2113 |
// only after the object has changed since the last request. |
| 2114 |
func (c *CuratorsDataSegmentsGetCall) IfNoneMatch(entityTag string) *CuratorsDataSegmentsGetCall { |
| 2115 |
c.ifNoneMatch_ = entityTag |
| 2116 |
return c |
| 2117 |
} |
| 2118 |
|
| 2119 |
// Context sets the context to be used in this call's Do method. |
| 2120 |
func (c *CuratorsDataSegmentsGetCall) Context(ctx context.Context) *CuratorsDataSegmentsGetCall { |
| 2121 |
c.ctx_ = ctx |
| 2122 |
return c |
| 2123 |
} |
| 2124 |
|
| 2125 |
// Header returns a http.Header that can be modified by the caller to add |
| 2126 |
// headers to the request. |
| 2127 |
func (c *CuratorsDataSegmentsGetCall) Header() http.Header { |
| 2128 |
if c.header_ == nil { |
| 2129 |
c.header_ = make(http.Header) |
| 2130 |
} |
| 2131 |
return c.header_ |
| 2132 |
} |
| 2133 |
|
| 2134 |
func (c *CuratorsDataSegmentsGetCall) doRequest(alt string) (*http.Response, error) { |
| 2135 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 2136 |
if c.ifNoneMatch_ != "" { |
| 2137 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 2138 |
} |
| 2139 |
c.urlParams_.Set("alt", alt) |
| 2140 |
c.urlParams_.Set("prettyPrint", "false") |
| 2141 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 2142 |
urls += "?" + c.urlParams_.Encode() |
| 2143 |
req, err := http.NewRequest("GET", urls, nil) |
| 2144 |
if err != nil { |
| 2145 |
return nil, err |
| 2146 |
} |
| 2147 |
req.Header = reqHeaders |
| 2148 |
googleapi.Expand(req.URL, map[string]string{ |
| 2149 |
"name": c.name, |
| 2150 |
}) |
| 2151 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.get", "request", internallog.HTTPRequest(req, nil)) |
| 2152 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2153 |
} |
| 2154 |
|
| 2155 |
// Do executes the "authorizedbuyersmarketplace.curators.dataSegments.get" call. |
| 2156 |
// Any non-2xx status code is an error. Response headers are in either |
| 2157 |
// *DataSegment.ServerResponse.Header or (if a response was returned at all) in |
| 2158 |
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 2159 |
// whether the returned error was because http.StatusNotModified was returned. |
| 2160 |
func (c *CuratorsDataSegmentsGetCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) { |
| 2161 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 2162 |
res, err := c.doRequest("json") |
| 2163 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 2164 |
if res.Body != nil { |
| 2165 |
res.Body.Close() |
| 2166 |
} |
| 2167 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 2168 |
Code: res.StatusCode, |
| 2169 |
Header: res.Header, |
| 2170 |
}) |
| 2171 |
} |
| 2172 |
if err != nil { |
| 2173 |
return nil, err |
| 2174 |
} |
| 2175 |
defer googleapi.CloseBody(res) |
| 2176 |
if err := googleapi.CheckResponse(res); err != nil { |
| 2177 |
return nil, gensupport.WrapError(err) |
| 2178 |
} |
| 2179 |
ret := &DataSegment{ |
| 2180 |
ServerResponse: googleapi.ServerResponse{ |
| 2181 |
Header: res.Header, |
| 2182 |
HTTPStatusCode: res.StatusCode, |
| 2183 |
}, |
| 2184 |
} |
| 2185 |
target := &ret |
| 2186 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2187 |
if err != nil { |
| 2188 |
return nil, err |
| 2189 |
} |
| 2190 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.get", "response", internallog.HTTPResponse(res, b)) |
| 2191 |
return ret, nil |
| 2192 |
} |
| 2193 |
|
| 2194 |
type CuratorsDataSegmentsListCall struct { |
| 2195 |
s *Service |
| 2196 |
parent string |
| 2197 |
urlParams_ gensupport.URLParams |
| 2198 |
ifNoneMatch_ string |
| 2199 |
ctx_ context.Context |
| 2200 |
header_ http.Header |
| 2201 |
} |
| 2202 |
|
| 2203 |
// List: List the data segments owned by a curator. |
| 2204 |
// |
| 2205 |
// - parent: Name of the parent curator that can access the data segment. |
| 2206 |
// v1alpha format: `buyers/{accountId}` v1beta format: `curators/{accountId}`. |
| 2207 |
func (r *CuratorsDataSegmentsService) List(parent string) *CuratorsDataSegmentsListCall { |
| 2208 |
c := &CuratorsDataSegmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 2209 |
c.parent = parent |
| 2210 |
return c |
| 2211 |
} |
| 2212 |
|
| 2213 |
// PageSize sets the optional parameter "pageSize": Requested page size. The |
| 2214 |
// server may return fewer results than requested. Max allowed page size is |
| 2215 |
// 500. If unspecified, the server will default to 500. |
| 2216 |
func (c *CuratorsDataSegmentsListCall) PageSize(pageSize int64) *CuratorsDataSegmentsListCall { |
| 2217 |
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 2218 |
return c |
| 2219 |
} |
| 2220 |
|
| 2221 |
// PageToken sets the optional parameter "pageToken": The page token as |
| 2222 |
// returned. ListDataSegmentsResponse.nextPageToken |
| 2223 |
func (c *CuratorsDataSegmentsListCall) PageToken(pageToken string) *CuratorsDataSegmentsListCall { |
| 2224 |
c.urlParams_.Set("pageToken", pageToken) |
| 2225 |
return c |
| 2226 |
} |
| 2227 |
|
| 2228 |
// Fields allows partial responses to be retrieved. See |
| 2229 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 2230 |
// details. |
| 2231 |
func (c *CuratorsDataSegmentsListCall) Fields(s ...googleapi.Field) *CuratorsDataSegmentsListCall { |
| 2232 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2233 |
return c |
| 2234 |
} |
| 2235 |
|
| 2236 |
// IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 2237 |
// object's ETag matches the given value. This is useful for getting updates |
| 2238 |
// only after the object has changed since the last request. |
| 2239 |
func (c *CuratorsDataSegmentsListCall) IfNoneMatch(entityTag string) *CuratorsDataSegmentsListCall { |
| 2240 |
c.ifNoneMatch_ = entityTag |
| 2241 |
return c |
| 2242 |
} |
| 2243 |
|
| 2244 |
// Context sets the context to be used in this call's Do method. |
| 2245 |
func (c *CuratorsDataSegmentsListCall) Context(ctx context.Context) *CuratorsDataSegmentsListCall { |
| 2246 |
c.ctx_ = ctx |
| 2247 |
return c |
| 2248 |
} |
| 2249 |
|
| 2250 |
// Header returns a http.Header that can be modified by the caller to add |
| 2251 |
// headers to the request. |
| 2252 |
func (c *CuratorsDataSegmentsListCall) Header() http.Header { |
| 2253 |
if c.header_ == nil { |
| 2254 |
c.header_ = make(http.Header) |
| 2255 |
} |
| 2256 |
return c.header_ |
| 2257 |
} |
| 2258 |
|
| 2259 |
func (c *CuratorsDataSegmentsListCall) doRequest(alt string) (*http.Response, error) { |
| 2260 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 2261 |
if c.ifNoneMatch_ != "" { |
| 2262 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 2263 |
} |
| 2264 |
c.urlParams_.Set("alt", alt) |
| 2265 |
c.urlParams_.Set("prettyPrint", "false") |
| 2266 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/dataSegments") |
| 2267 |
urls += "?" + c.urlParams_.Encode() |
| 2268 |
req, err := http.NewRequest("GET", urls, nil) |
| 2269 |
if err != nil { |
| 2270 |
return nil, err |
| 2271 |
} |
| 2272 |
req.Header = reqHeaders |
| 2273 |
googleapi.Expand(req.URL, map[string]string{ |
| 2274 |
"parent": c.parent, |
| 2275 |
}) |
| 2276 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.list", "request", internallog.HTTPRequest(req, nil)) |
| 2277 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2278 |
} |
| 2279 |
|
| 2280 |
// Do executes the "authorizedbuyersmarketplace.curators.dataSegments.list" call. |
| 2281 |
// Any non-2xx status code is an error. Response headers are in either |
| 2282 |
// *ListDataSegmentsResponse.ServerResponse.Header or (if a response was |
| 2283 |
// returned at all) in error.(*googleapi.Error).Header. Use |
| 2284 |
// googleapi.IsNotModified to check whether the returned error was because |
| 2285 |
// http.StatusNotModified was returned. |
| 2286 |
func (c *CuratorsDataSegmentsListCall) Do(opts ...googleapi.CallOption) (*ListDataSegmentsResponse, error) { |
| 2287 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 2288 |
res, err := c.doRequest("json") |
| 2289 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 2290 |
if res.Body != nil { |
| 2291 |
res.Body.Close() |
| 2292 |
} |
| 2293 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 2294 |
Code: res.StatusCode, |
| 2295 |
Header: res.Header, |
| 2296 |
}) |
| 2297 |
} |
| 2298 |
if err != nil { |
| 2299 |
return nil, err |
| 2300 |
} |
| 2301 |
defer googleapi.CloseBody(res) |
| 2302 |
if err := googleapi.CheckResponse(res); err != nil { |
| 2303 |
return nil, gensupport.WrapError(err) |
| 2304 |
} |
| 2305 |
ret := &ListDataSegmentsResponse{ |
| 2306 |
ServerResponse: googleapi.ServerResponse{ |
| 2307 |
Header: res.Header, |
| 2308 |
HTTPStatusCode: res.StatusCode, |
| 2309 |
}, |
| 2310 |
} |
| 2311 |
target := &ret |
| 2312 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2313 |
if err != nil { |
| 2314 |
return nil, err |
| 2315 |
} |
| 2316 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.list", "response", internallog.HTTPResponse(res, b)) |
| 2317 |
return ret, nil |
| 2318 |
} |
| 2319 |
|
| 2320 |
// Pages invokes f for each page of results. |
| 2321 |
// A non-nil error returned from f will halt the iteration. |
| 2322 |
// The provided context supersedes any context provided to the Context method. |
| 2323 |
func (c *CuratorsDataSegmentsListCall) Pages(ctx context.Context, f func(*ListDataSegmentsResponse) error) error { |
| 2324 |
c.ctx_ = ctx |
| 2325 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 2326 |
for { |
| 2327 |
x, err := c.Do() |
| 2328 |
if err != nil { |
| 2329 |
return err |
| 2330 |
} |
| 2331 |
if err := f(x); err != nil { |
| 2332 |
return err |
| 2333 |
} |
| 2334 |
if x.NextPageToken == "" { |
| 2335 |
return nil |
| 2336 |
} |
| 2337 |
c.PageToken(x.NextPageToken) |
| 2338 |
} |
| 2339 |
} |
| 2340 |
|
| 2341 |
type CuratorsDataSegmentsPatchCall struct { |
| 2342 |
s *Service |
| 2343 |
nameid string |
| 2344 |
datasegment *DataSegment |
| 2345 |
urlParams_ gensupport.URLParams |
| 2346 |
ctx_ context.Context |
| 2347 |
header_ http.Header |
| 2348 |
} |
| 2349 |
|
| 2350 |
// Patch: Updates a data segment. |
| 2351 |
// |
| 2352 |
// - name: Immutable. Identifier. The unique identifier for the data segment. |
| 2353 |
// Account ID corresponds to the account ID that created the segment. v1alpha |
| 2354 |
// format: `buyers/{accountId}/dataSegments/{curatorDataSegmentId}` v1beta |
| 2355 |
// format: `curators/{curatorAccountId}/dataSegments/{curatorDataSegmentId}`. |
| 2356 |
func (r *CuratorsDataSegmentsService) Patch(nameid string, datasegment *DataSegment) *CuratorsDataSegmentsPatchCall { |
| 2357 |
c := &CuratorsDataSegmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 2358 |
c.nameid = nameid |
| 2359 |
c.datasegment = datasegment |
| 2360 |
return c |
| 2361 |
} |
| 2362 |
|
| 2363 |
// UpdateMask sets the optional parameter "updateMask": List of fields to be |
| 2364 |
// updated. If empty or unspecified, the service will update all fields |
| 2365 |
// populated in the update request excluding the output only fields and |
| 2366 |
// primitive fields with default value. Note that explicit field mask is |
| 2367 |
// required in order to reset a primitive field back to its default value, for |
| 2368 |
// example, false for boolean fields, 0 for integer fields. A special field |
| 2369 |
// mask consisting of a single path "*" can be used to indicate full |
| 2370 |
// replacement(the equivalent of PUT method), updatable fields unset or |
| 2371 |
// unspecified in the input will be cleared or set to default value. Output |
| 2372 |
// only fields will be ignored regardless of the value of updateMask. |
| 2373 |
func (c *CuratorsDataSegmentsPatchCall) UpdateMask(updateMask string) *CuratorsDataSegmentsPatchCall { |
| 2374 |
c.urlParams_.Set("updateMask", updateMask) |
| 2375 |
return c |
| 2376 |
} |
| 2377 |
|
| 2378 |
// Fields allows partial responses to be retrieved. See |
| 2379 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 2380 |
// details. |
| 2381 |
func (c *CuratorsDataSegmentsPatchCall) Fields(s ...googleapi.Field) *CuratorsDataSegmentsPatchCall { |
| 2382 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2383 |
return c |
| 2384 |
} |
| 2385 |
|
| 2386 |
// Context sets the context to be used in this call's Do method. |
| 2387 |
func (c *CuratorsDataSegmentsPatchCall) Context(ctx context.Context) *CuratorsDataSegmentsPatchCall { |
| 2388 |
c.ctx_ = ctx |
| 2389 |
return c |
| 2390 |
} |
| 2391 |
|
| 2392 |
// Header returns a http.Header that can be modified by the caller to add |
| 2393 |
// headers to the request. |
| 2394 |
func (c *CuratorsDataSegmentsPatchCall) Header() http.Header { |
| 2395 |
if c.header_ == nil { |
| 2396 |
c.header_ = make(http.Header) |
| 2397 |
} |
| 2398 |
return c.header_ |
| 2399 |
} |
| 2400 |
|
| 2401 |
func (c *CuratorsDataSegmentsPatchCall) doRequest(alt string) (*http.Response, error) { |
| 2402 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) |
| 2403 |
body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.datasegment) |
| 2404 |
if err != nil { |
| 2405 |
return nil, err |
| 2406 |
} |
| 2407 |
c.urlParams_.Set("alt", alt) |
| 2408 |
c.urlParams_.Set("prettyPrint", "false") |
| 2409 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") |
| 2410 |
urls += "?" + c.urlParams_.Encode() |
| 2411 |
req, err := http.NewRequest("PATCH", urls, body) |
| 2412 |
if err != nil { |
| 2413 |
return nil, err |
| 2414 |
} |
| 2415 |
req.Header = reqHeaders |
| 2416 |
googleapi.Expand(req.URL, map[string]string{ |
| 2417 |
"name": c.nameid, |
| 2418 |
}) |
| 2419 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.patch", "request", internallog.HTTPRequest(req, body.Bytes())) |
| 2420 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2421 |
} |
| 2422 |
|
| 2423 |
// Do executes the "authorizedbuyersmarketplace.curators.dataSegments.patch" call. |
| 2424 |
// Any non-2xx status code is an error. Response headers are in either |
| 2425 |
// *DataSegment.ServerResponse.Header or (if a response was returned at all) in |
| 2426 |
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
| 2427 |
// whether the returned error was because http.StatusNotModified was returned. |
| 2428 |
func (c *CuratorsDataSegmentsPatchCall) Do(opts ...googleapi.CallOption) (*DataSegment, error) { |
| 2429 |
gensupport.SetOptions(c.urlParams_, opts...) |
| 2430 |
res, err := c.doRequest("json") |
| 2431 |
if res != nil && res.StatusCode == http.StatusNotModified { |
| 2432 |
if res.Body != nil { |
| 2433 |
res.Body.Close() |
| 2434 |
} |
| 2435 |
return nil, gensupport.WrapError(&googleapi.Error{ |
| 2436 |
Code: res.StatusCode, |
| 2437 |
Header: res.Header, |
| 2438 |
}) |
| 2439 |
} |
| 2440 |
if err != nil { |
| 2441 |
return nil, err |
| 2442 |
} |
| 2443 |
defer googleapi.CloseBody(res) |
| 2444 |
if err := googleapi.CheckResponse(res); err != nil { |
| 2445 |
return nil, gensupport.WrapError(err) |
| 2446 |
} |
| 2447 |
ret := &DataSegment{ |
| 2448 |
ServerResponse: googleapi.ServerResponse{ |
| 2449 |
Header: res.Header, |
| 2450 |
HTTPStatusCode: res.StatusCode, |
| 2451 |
}, |
| 2452 |
} |
| 2453 |
target := &ret |
| 2454 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2455 |
if err != nil { |
| 2456 |
return nil, err |
| 2457 |
} |
| 2458 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.curators.dataSegments.patch", "response", internallog.HTTPResponse(res, b)) |
| 2459 |
return ret, nil |
| 2460 |
} |
| 2461 |
|
| 2462 |
type MediaPlannersListCall struct { |
| 2463 |
s *Service |
| 2464 |
urlParams_ gensupport.URLParams |
| 2465 |
ifNoneMatch_ string |
| 2466 |
ctx_ context.Context |
| 2467 |
header_ http.Header |
| 2468 |
} |
| 2469 |
|
| 2470 |
// List: Lists all media planner accounts that the caller has access to. For |
| 2471 |
// curators, this will return all media planners that have accepted curator |
| 2472 |
// terms. For other accounts, attempting to list media planners will return an |
| 2473 |
// error. |
| 2474 |
func (r *MediaPlannersService) List() *MediaPlannersListCall { |
| 2475 |
c := &MediaPlannersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| 2476 |
return c |
| 2477 |
} |
| 2478 |
|
| 2479 |
// Filter sets the optional parameter "filter": Optional query string using the |
| 2480 |
// Cloud API list filtering syntax |
| 2481 |
// (/authorized-buyers/apis/guides/list-filters). Supported columns for |
| 2482 |
// filtering are: * `name` * `displayName` * `ancestorNames` |
| 2483 |
func (c *MediaPlannersListCall) Filter(filter string) *MediaPlannersListCall { |
| 2484 |
c.urlParams_.Set("filter", filter) |
| 2485 |
return c |
| 2486 |
} |
| 2487 |
|
| 2488 |
// PageSize sets the optional parameter "pageSize": The maximum number of media |
| 2489 |
// planners to return. If unspecified, at most 100 media planners will be |
| 2490 |
// returned. The maximum value is 500; values above 500 will be coerced to 500. |
| 2491 |
func (c *MediaPlannersListCall) PageSize(pageSize int64) *MediaPlannersListCall { |
| 2492 |
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) |
| 2493 |
return c |
| 2494 |
} |
| 2495 |
|
| 2496 |
// PageToken sets the optional parameter "pageToken": A token identifying a |
| 2497 |
// page of results the server should return. This value is received from a |
| 2498 |
// previous `ListMediaPlanners` call in |
| 2499 |
// ListMediaPlannersResponse.nextPageToken. |
| 2500 |
func (c *MediaPlannersListCall) PageToken(pageToken string) *MediaPlannersListCall { |
| 2501 |
c.urlParams_.Set("pageToken", pageToken) |
| 2502 |
return c |
| 2503 |
} |
| 2504 |
|
| 2505 |
// Fields allows partial responses to be retrieved. See |
| 2506 |
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more |
| 2507 |
// details. |
| 2508 |
func (c *MediaPlannersListCall) Fields(s ...googleapi.Field) *MediaPlannersListCall { |
| 2509 |
c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| 2510 |
return c |
| 2511 |
} |
| 2512 |
|
| 2513 |
// IfNoneMatch sets an optional parameter which makes the operation fail if the |
| 2514 |
// object's ETag matches the given value. This is useful for getting updates |
| 2515 |
// only after the object has changed since the last request. |
| 2516 |
func (c *MediaPlannersListCall) IfNoneMatch(entityTag string) *MediaPlannersListCall { |
| 2517 |
c.ifNoneMatch_ = entityTag |
| 2518 |
return c |
| 2519 |
} |
| 2520 |
|
| 2521 |
// Context sets the context to be used in this call's Do method. |
| 2522 |
func (c *MediaPlannersListCall) Context(ctx context.Context) *MediaPlannersListCall { |
| 2523 |
c.ctx_ = ctx |
| 2524 |
return c |
| 2525 |
} |
| 2526 |
|
| 2527 |
// Header returns a http.Header that can be modified by the caller to add |
| 2528 |
// headers to the request. |
| 2529 |
func (c *MediaPlannersListCall) Header() http.Header { |
| 2530 |
if c.header_ == nil { |
| 2531 |
c.header_ = make(http.Header) |
| 2532 |
} |
| 2533 |
return c.header_ |
| 2534 |
} |
| 2535 |
|
| 2536 |
func (c *MediaPlannersListCall) doRequest(alt string) (*http.Response, error) { |
| 2537 |
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) |
| 2538 |
if c.ifNoneMatch_ != "" { |
| 2539 |
reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| 2540 |
} |
| 2541 |
c.urlParams_.Set("alt", alt) |
| 2542 |
c.urlParams_.Set("prettyPrint", "false") |
| 2543 |
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/mediaPlanners") |
| 2544 |
urls += "?" + c.urlParams_.Encode() |
| 2545 |
req, err := http.NewRequest("GET", urls, nil) |
| 2546 |
if err != nil { |
| 2547 |
return nil, err |
| 2548 |
} |
| 2549 |
req.Header = reqHeaders |
| 2550 |
c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.mediaPlanners.list", "request", internallog.HTTPRequest(req, nil)) |
| 2551 |
return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| 2552 |
} |
| 2553 |
|
| 2554 |
// Do executes the "authorizedbuyersmarketplace.mediaPlanners.list" call. |
| 2555 |
// Any non-2xx status code is an error. Response headers are in either |
| 2556 |
// *ListMediaPlannersResponse.ServerResponse.Header or (if a response was |
| 2557 |
// returned at all) in error.(*googleapi.Error).Header. Use |
| 2558 |
// googleapi.IsNotModified to check whether the returned error was because |
| 2559 |
// http.StatusNotModified was returned. |
| 2560 |
func (c *MediaPlannersListCall) Do(opts ...googleapi.CallOption) (*ListMediaPlannersResponse, 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, gensupport.WrapError(&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, gensupport.WrapError(err) |
| 2578 |
} |
| 2579 |
ret := &ListMediaPlannersResponse{ |
| 2580 |
ServerResponse: googleapi.ServerResponse{ |
| 2581 |
Header: res.Header, |
| 2582 |
HTTPStatusCode: res.StatusCode, |
| 2583 |
}, |
| 2584 |
} |
| 2585 |
target := &ret |
| 2586 |
b, err := gensupport.DecodeResponseBytes(target, res) |
| 2587 |
if err != nil { |
| 2588 |
return nil, err |
| 2589 |
} |
| 2590 |
c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "authorizedbuyersmarketplace.mediaPlanners.list", "response", internallog.HTTPResponse(res, b)) |
| 2591 |
return ret, nil |
| 2592 |
} |
| 2593 |
|
| 2594 |
// Pages invokes f for each page of results. |
| 2595 |
// A non-nil error returned from f will halt the iteration. |
| 2596 |
// The provided context supersedes any context provided to the Context method. |
| 2597 |
func (c *MediaPlannersListCall) Pages(ctx context.Context, f func(*ListMediaPlannersResponse) error) error { |
| 2598 |
c.ctx_ = ctx |
| 2599 |
defer c.PageToken(c.urlParams_.Get("pageToken")) |
| 2600 |
for { |
| 2601 |
x, err := c.Do() |
| 2602 |
if err != nil { |
| 2603 |
return err |
| 2604 |
} |
| 2605 |
if err := f(x); err != nil { |
| 2606 |
return err |
| 2607 |
} |
| 2608 |
if x.NextPageToken == "" { |
| 2609 |
return nil |
| 2610 |
} |
| 2611 |
c.PageToken(x.NextPageToken) |
| 2612 |
} |
| 2613 |
} |