Documentation
¶
Overview ¶
Package realtimebidding provides access to the Real-time Bidding API.
For product documentation, see: https://developers.google.com/authorized-buyers/apis/realtimebidding/reference/rest/
Creating a client ¶
Usage example:
import "google.golang.org/api/realtimebidding/v1alpha" ... ctx := context.Background() realtimebiddingService, err := realtimebidding.NewService(ctx)
In this example, Google Application Default Credentials are used for authentication.
For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options ¶
To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
realtimebiddingService, err := realtimebidding.NewService(ctx, option.WithAPIKey("AIza..."))
To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
config := &oauth2.Config{...} // ... token, err := config.Exchange(ctx, ...) realtimebiddingService, err := realtimebidding.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See https://godoc.org/google.golang.org/api/option/ for details on options.
Index ¶
- Constants
- type BiddersBiddingFunctionsCreateCall
- func (c *BiddersBiddingFunctionsCreateCall) Context(ctx context.Context) *BiddersBiddingFunctionsCreateCall
- func (c *BiddersBiddingFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*BiddingFunction, error)
- func (c *BiddersBiddingFunctionsCreateCall) Fields(s ...googleapi.Field) *BiddersBiddingFunctionsCreateCall
- func (c *BiddersBiddingFunctionsCreateCall) Header() http.Header
- type BiddersBiddingFunctionsListCall
- func (c *BiddersBiddingFunctionsListCall) Context(ctx context.Context) *BiddersBiddingFunctionsListCall
- func (c *BiddersBiddingFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListBiddingFunctionsResponse, error)
- func (c *BiddersBiddingFunctionsListCall) Fields(s ...googleapi.Field) *BiddersBiddingFunctionsListCall
- func (c *BiddersBiddingFunctionsListCall) Header() http.Header
- func (c *BiddersBiddingFunctionsListCall) IfNoneMatch(entityTag string) *BiddersBiddingFunctionsListCall
- func (c *BiddersBiddingFunctionsListCall) PageSize(pageSize int64) *BiddersBiddingFunctionsListCall
- func (c *BiddersBiddingFunctionsListCall) PageToken(pageToken string) *BiddersBiddingFunctionsListCall
- func (c *BiddersBiddingFunctionsListCall) Pages(ctx context.Context, f func(*ListBiddingFunctionsResponse) error) error
- type BiddersBiddingFunctionsService
- type BiddersService
- type BiddingFunction
- type ListBiddingFunctionsResponse
- type Service
Constants ¶
const ( // See, create, edit, and delete your Authorized Buyers and Open Bidding // account entities RealtimeBiddingScope = "https://www.googleapis.com/auth/realtime-bidding" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BiddersBiddingFunctionsCreateCall ¶
type BiddersBiddingFunctionsCreateCall struct {
// contains filtered or unexported fields
}
func (*BiddersBiddingFunctionsCreateCall) Context ¶
func (c *BiddersBiddingFunctionsCreateCall) Context(ctx context.Context) *BiddersBiddingFunctionsCreateCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*BiddersBiddingFunctionsCreateCall) Do ¶
func (c *BiddersBiddingFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*BiddingFunction, error)
Do executes the "realtimebidding.bidders.biddingFunctions.create" call. Exactly one of *BiddingFunction or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BiddingFunction.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*BiddersBiddingFunctionsCreateCall) Fields ¶
func (c *BiddersBiddingFunctionsCreateCall) Fields(s ...googleapi.Field) *BiddersBiddingFunctionsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*BiddersBiddingFunctionsCreateCall) Header ¶
func (c *BiddersBiddingFunctionsCreateCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type BiddersBiddingFunctionsListCall ¶
type BiddersBiddingFunctionsListCall struct {
// contains filtered or unexported fields
}
func (*BiddersBiddingFunctionsListCall) Context ¶
func (c *BiddersBiddingFunctionsListCall) Context(ctx context.Context) *BiddersBiddingFunctionsListCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*BiddersBiddingFunctionsListCall) Do ¶
func (c *BiddersBiddingFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListBiddingFunctionsResponse, error)
Do executes the "realtimebidding.bidders.biddingFunctions.list" call. Exactly one of *ListBiddingFunctionsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListBiddingFunctionsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*BiddersBiddingFunctionsListCall) Fields ¶
func (c *BiddersBiddingFunctionsListCall) Fields(s ...googleapi.Field) *BiddersBiddingFunctionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*BiddersBiddingFunctionsListCall) Header ¶
func (c *BiddersBiddingFunctionsListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*BiddersBiddingFunctionsListCall) IfNoneMatch ¶
func (c *BiddersBiddingFunctionsListCall) IfNoneMatch(entityTag string) *BiddersBiddingFunctionsListCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
func (*BiddersBiddingFunctionsListCall) PageSize ¶
func (c *BiddersBiddingFunctionsListCall) PageSize(pageSize int64) *BiddersBiddingFunctionsListCall
PageSize sets the optional parameter "pageSize": The maximum number of bidding functions to return.
func (*BiddersBiddingFunctionsListCall) PageToken ¶
func (c *BiddersBiddingFunctionsListCall) PageToken(pageToken string) *BiddersBiddingFunctionsListCall
PageToken sets the optional parameter "pageToken": A token identifying a page of results the server should return. This value is received from a previous `ListBiddingFunctions` call in ListBiddingFunctionsResponse.nextPageToken.
func (*BiddersBiddingFunctionsListCall) Pages ¶
func (c *BiddersBiddingFunctionsListCall) Pages(ctx context.Context, f func(*ListBiddingFunctionsResponse) error) error
Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.
type BiddersBiddingFunctionsService ¶
type BiddersBiddingFunctionsService struct {
// contains filtered or unexported fields
}
func NewBiddersBiddingFunctionsService ¶
func NewBiddersBiddingFunctionsService(s *Service) *BiddersBiddingFunctionsService
func (*BiddersBiddingFunctionsService) Create ¶
func (r *BiddersBiddingFunctionsService) Create(parent string, biddingfunction *BiddingFunction) *BiddersBiddingFunctionsCreateCall
Create: Creates a new bidding function.
func (*BiddersBiddingFunctionsService) List ¶
func (r *BiddersBiddingFunctionsService) List(parent string) *BiddersBiddingFunctionsListCall
List: Lists the bidding functions that a bidder currently has registered.
type BiddersService ¶
type BiddersService struct { BiddingFunctions *BiddersBiddingFunctionsService // contains filtered or unexported fields }
func NewBiddersService ¶
func NewBiddersService(s *Service) *BiddersService
type BiddingFunction ¶
type BiddingFunction struct { // BiddingFunction: The raw Javascript source code of the bidding // function. The function takes in a Javascript object, `inputs`, that // contains the following named fields: `openrtbContextualBidRequest` OR // `googleContextualBidRequest`, `customContextualSignal`, // `interestBasedBidData`, `interestGroupData`, `recentImpressionAges`, // and returns the bid price CPM (double). Example: “` /* Returns a bid // price CPM (double). * * @param {Object} inputs an object with the * // following named fields: * - openrtbContextualBidRequest * OR // googleContextualBidRequest * - customContextualSignal * - // interestBasedBidData * - interestGroupData * - recentImpressionAges // */ function biddingFunction(inputs) { ... return // inputs.interestBasedBidData.cpm * // inputs.customContextualSignals.placementMultiplier; } “` BiddingFunction string `json:"biddingFunction,omitempty"` // Name: The name of the bidding function that must follow the pattern: // `bidders/{bidder_account_id}/biddingFunctions/{bidding_function_name}` // . Name string `json:"name,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "BiddingFunction") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "BiddingFunction") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` }
BiddingFunction: The bidding function to be executed as part of the TURTLEDOVE simulation experiment bidding flow.
func (*BiddingFunction) MarshalJSON ¶
func (s *BiddingFunction) MarshalJSON() ([]byte, error)
type ListBiddingFunctionsResponse ¶
type ListBiddingFunctionsResponse struct { // BiddingFunctions: A list of a bidder's bidding functions. BiddingFunctions []*BiddingFunction `json:"biddingFunctions,omitempty"` // NextPageToken: A token which can be passed to a subsequent call to // the `ListBiddingFunctions` method to retrieve the next page of // results in ListBiddingFunctionsRequest.pageToken. NextPageToken string `json:"nextPageToken,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "BiddingFunctions") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "BiddingFunctions") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` }
ListBiddingFunctionsResponse: A response containing a list of a bidder's bidding functions.
func (*ListBiddingFunctionsResponse) MarshalJSON ¶
func (s *ListBiddingFunctionsResponse) MarshalJSON() ([]byte, error)
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Bidders *BiddersService // contains filtered or unexported fields }
func New
deprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func NewService ¶
NewService creates a new Service.