...

Package displayvideo

import "google.golang.org/api/displayvideo/v4"
Overview
Index

Overview ▾

Package displayvideo provides access to the Display & Video 360 API.

For product documentation, see: https://developers.google.com/display-video/

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/displayvideo/v4"
...
ctx := context.Background()
displayvideoService, err := displayvideo.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

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:

displayvideoService, err := displayvideo.NewService(ctx, option.WithScopes(displayvideo.DoubleclickbidmanagerScope))

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

displayvideoService, err := displayvideo.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
displayvideoService, err := displayvideo.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index ▾

Constants
type GoogleBytestreamMedia
    func (s *GoogleBytestreamMedia) MarshalJSON() ([]byte, error)
type MediaDownloadCall
    func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall
    func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*GoogleBytestreamMedia, error)
    func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error)
    func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall
    func (c *MediaDownloadCall) Header() http.Header
    func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall
type MediaService
    func NewMediaService(s *Service) *MediaService
    func (r *MediaService) Download(resourceName string) *MediaDownloadCall
    func (r *MediaService) Upload(resourceName string, googlebytestreammedia *GoogleBytestreamMedia) *MediaUploadCall
type MediaUploadCall
    func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall
    func (c *MediaUploadCall) Do(opts ...googleapi.CallOption) (*GoogleBytestreamMedia, error)
    func (c *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall
    func (c *MediaUploadCall) Header() http.Header
    func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall
    func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall
    func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCall
type Operation
    func (s *Operation) MarshalJSON() ([]byte, error)
type SdfdownloadtasksOperationsGetCall
    func (c *SdfdownloadtasksOperationsGetCall) Context(ctx context.Context) *SdfdownloadtasksOperationsGetCall
    func (c *SdfdownloadtasksOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error)
    func (c *SdfdownloadtasksOperationsGetCall) Fields(s ...googleapi.Field) *SdfdownloadtasksOperationsGetCall
    func (c *SdfdownloadtasksOperationsGetCall) Header() http.Header
    func (c *SdfdownloadtasksOperationsGetCall) IfNoneMatch(entityTag string) *SdfdownloadtasksOperationsGetCall
type SdfdownloadtasksOperationsService
    func NewSdfdownloadtasksOperationsService(s *Service) *SdfdownloadtasksOperationsService
    func (r *SdfdownloadtasksOperationsService) Get(name string) *SdfdownloadtasksOperationsGetCall
type SdfdownloadtasksService
    func NewSdfdownloadtasksService(s *Service) *SdfdownloadtasksService
type Service
    func New(client *http.Client) (*Service, error)
    func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
type Status
    func (s *Status) MarshalJSON() ([]byte, error)

Package files

displayvideo-gen.go

Constants

OAuth2 scopes used by this API.

const (
    // Create, see, edit, and permanently delete your Display & Video 360
    // entities and reports
    DisplayVideoScope = "https://www.googleapis.com/auth/display-video"

    // View and manage your reports in DoubleClick Bid Manager
    DoubleclickbidmanagerScope = "https://www.googleapis.com/auth/doubleclickbidmanager"
)

type GoogleBytestreamMedia

GoogleBytestreamMedia: Media resource.

type GoogleBytestreamMedia struct {
    // ResourceName: Name of the media resource.
    ResourceName string `json:"resourceName,omitempty"`

    // ServerResponse contains the HTTP response code and headers from the
    // server.
    googleapi.ServerResponse `json:"-"`

    // ForceSendFields is a list of field names (e.g. "ResourceName") to
    // unconditionally include in API requests. By default, fields with
    // empty or default 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. "ResourceName") 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:"-"`
}

func (*GoogleBytestreamMedia) MarshalJSON

func (s *GoogleBytestreamMedia) MarshalJSON() ([]byte, error)

type MediaDownloadCall

type MediaDownloadCall struct {
    // contains filtered or unexported fields
}

func (*MediaDownloadCall) Context

func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall

Context sets the context to be used in this call's Do and Download methods. Any pending HTTP request will be aborted if the provided context is canceled.

func (*MediaDownloadCall) Do

func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*GoogleBytestreamMedia, error)

Do executes the "displayvideo.media.download" call. Exactly one of *GoogleBytestreamMedia or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GoogleBytestreamMedia.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 (*MediaDownloadCall) Download

func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error)

Download fetches the API endpoint's "media" value, instead of the normal API response value. If the returned error is nil, the Response is guaranteed to have a 2xx status code. Callers must close the Response.Body as usual.

func (*MediaDownloadCall) Fields

func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaDownloadCall) Header

func (c *MediaDownloadCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaDownloadCall) IfNoneMatch

func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall

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.

type MediaService

type MediaService struct {
    // contains filtered or unexported fields
}

func NewMediaService

func NewMediaService(s *Service) *MediaService

func (*MediaService) Download

func (r *MediaService) Download(resourceName string) *MediaDownloadCall

Download: Downloads media. Download is supported on the URI `/download/{resource_name=**}?alt=media.` **Note**: Download requests will not be successful without including `alt=media` query string.

func (*MediaService) Upload

func (r *MediaService) Upload(resourceName string, googlebytestreammedia *GoogleBytestreamMedia) *MediaUploadCall

Upload: Uploads media. Upload is supported on the URI `/upload/media/{resource_name=**}?upload_type=media.` **Note**: Upload requests will not be successful without including `upload_type=media` query string.

type MediaUploadCall

type MediaUploadCall struct {
    // contains filtered or unexported fields
}

func (*MediaUploadCall) Context

func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall

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. This context will supersede any context previously provided to the ResumableMedia method.

func (*MediaUploadCall) Do

func (c *MediaUploadCall) Do(opts ...googleapi.CallOption) (*GoogleBytestreamMedia, error)

Do executes the "displayvideo.media.upload" call. Exactly one of *GoogleBytestreamMedia or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *GoogleBytestreamMedia.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 (*MediaUploadCall) Fields

func (c *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*MediaUploadCall) Header

func (c *MediaUploadCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*MediaUploadCall) Media

func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall

Media specifies the media to upload in one or more chunks. The chunk size may be controlled by supplying a MediaOption generated by googleapi.ChunkSize. The chunk size defaults to googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload request will be determined by sniffing the contents of r, unless a MediaOption generated by googleapi.ContentType is supplied. At most one of Media and ResumableMedia may be set.

func (*MediaUploadCall) ProgressUpdater

func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall

ProgressUpdater provides a callback function that will be called after every chunk. It should be a low-latency function in order to not slow down the upload operation. This should only be called when using ResumableMedia (as opposed to Media).

func (*MediaUploadCall) ResumableMedia

func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCall

ResumableMedia specifies the media to upload in chunks and can be canceled with ctx.

Deprecated: use Media instead.

At most one of Media and ResumableMedia may be set. mediaType identifies the MIME media type of the upload, such as "image/png". If mediaType is "", it will be auto-detected. The provided ctx will supersede any context previously provided to the Context method.

type Operation

Operation: This resource represents a long-running operation that is the result of a network API call.

type Operation struct {
    // Done: If the value is `false`, it means the operation is still in
    // progress. If `true`, the operation is completed, and either `error`
    // or `response` is available.
    Done bool `json:"done,omitempty"`

    // Error: The error result of the operation in case of failure or
    // cancellation.
    Error *Status `json:"error,omitempty"`

    // Metadata: Service-specific metadata associated with the operation. It
    // typically contains progress information and common metadata such as
    // create time. Some services might not provide such metadata. Any
    // method that returns a long-running operation should document the
    // metadata type, if any.
    Metadata googleapi.RawMessage `json:"metadata,omitempty"`

    // Name: The server-assigned name, which is only unique within the same
    // service that originally returns it. If you use the default HTTP
    // mapping, the `name` should be a resource name ending with
    // `operations/{unique_id}`.
    Name string `json:"name,omitempty"`

    // Response: The normal, successful response of the operation. If the
    // original method returns no data on success, such as `Delete`, the
    // response is `google.protobuf.Empty`. If the original method is
    // standard `Get`/`Create`/`Update`, the response should be the
    // resource. For other methods, the response should have the type
    // `XxxResponse`, where `Xxx` is the original method name. For example,
    // if the original method name is `TakeSnapshot()`, the inferred
    // response type is `TakeSnapshotResponse`.
    Response googleapi.RawMessage `json:"response,omitempty"`

    // ServerResponse contains the HTTP response code and headers from the
    // server.
    googleapi.ServerResponse `json:"-"`

    // ForceSendFields is a list of field names (e.g. "Done") to
    // unconditionally include in API requests. By default, fields with
    // empty or default 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. "Done") 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:"-"`
}

func (*Operation) MarshalJSON

func (s *Operation) MarshalJSON() ([]byte, error)

type SdfdownloadtasksOperationsGetCall

type SdfdownloadtasksOperationsGetCall struct {
    // contains filtered or unexported fields
}

func (*SdfdownloadtasksOperationsGetCall) Context

func (c *SdfdownloadtasksOperationsGetCall) Context(ctx context.Context) *SdfdownloadtasksOperationsGetCall

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 (*SdfdownloadtasksOperationsGetCall) Do

func (c *SdfdownloadtasksOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error)

Do executes the "displayvideo.sdfdownloadtasks.operations.get" call. Exactly one of *Operation or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Operation.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 (*SdfdownloadtasksOperationsGetCall) Fields

func (c *SdfdownloadtasksOperationsGetCall) Fields(s ...googleapi.Field) *SdfdownloadtasksOperationsGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*SdfdownloadtasksOperationsGetCall) Header

func (c *SdfdownloadtasksOperationsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*SdfdownloadtasksOperationsGetCall) IfNoneMatch

func (c *SdfdownloadtasksOperationsGetCall) IfNoneMatch(entityTag string) *SdfdownloadtasksOperationsGetCall

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.

type SdfdownloadtasksOperationsService

type SdfdownloadtasksOperationsService struct {
    // contains filtered or unexported fields
}

func NewSdfdownloadtasksOperationsService

func NewSdfdownloadtasksOperationsService(s *Service) *SdfdownloadtasksOperationsService

func (*SdfdownloadtasksOperationsService) Get

func (r *SdfdownloadtasksOperationsService) Get(name string) *SdfdownloadtasksOperationsGetCall

Get: Gets the latest state of an asynchronous SDF download task operation. Clients should poll this method at intervals of 30 seconds.

- name: The name of the operation resource.

type SdfdownloadtasksService

type SdfdownloadtasksService struct {
    Operations *SdfdownloadtasksOperationsService
    // contains filtered or unexported fields
}

func NewSdfdownloadtasksService

func NewSdfdownloadtasksService(s *Service) *SdfdownloadtasksService

type Service

type Service struct {
    BasePath  string // API endpoint base URL
    UserAgent string // optional additional User-Agent fragment

    Media *MediaService

    Sdfdownloadtasks *SdfdownloadtasksService
    // contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

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

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type Status

Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).

type Status struct {
    // Code: The status code, which should be an enum value of
    // google.rpc.Code.
    Code int64 `json:"code,omitempty"`

    // Details: A list of messages that carry the error details. There is a
    // common set of message types for APIs to use.
    Details []googleapi.RawMessage `json:"details,omitempty"`

    // Message: A developer-facing error message, which should be in
    // English. Any user-facing error message should be localized and sent
    // in the google.rpc.Status.details field, or localized by the client.
    Message string `json:"message,omitempty"`

    // ForceSendFields is a list of field names (e.g. "Code") to
    // unconditionally include in API requests. By default, fields with
    // empty or default 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. "Code") 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:"-"`
}

func (*Status) MarshalJSON

func (s *Status) MarshalJSON() ([]byte, error)