You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

103 lines
3.1 KiB

  1. // Package adexchangebuyer provides access to the Ad Exchange Buyer API.
  2. //
  3. // See https://developers.google.com/ad-exchange/buyer-rest
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/adexchangebuyer/v1.1"
  8. // ...
  9. // adexchangebuyerService, err := adexchangebuyer.New(oauthHttpClient)
  10. package adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "adexchangebuyer:v1.1"
  41. const apiName = "adexchangebuyer"
  42. const apiVersion = "v1.1"
  43. const basePath = "https://www.googleapis.com/adexchangebuyer/v1.1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your Ad Exchange buyer account configuration
  47. AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. return s, nil
  55. }
  56. type Service struct {
  57. client *http.Client
  58. BasePath string // API endpoint base URL
  59. UserAgent string // optional additional User-Agent fragment
  60. }
  61. func (s *Service) userAgent() string {
  62. if s.UserAgent == "" {
  63. return googleapi.UserAgent
  64. }
  65. return googleapi.UserAgent + " " + s.UserAgent
  66. }
  67. // Creative: A creative and its classification data.
  68. type Creative struct {
  69. // AdvertiserId: Detected advertiser id, if any. Read-only. This field
  70. // should not be set in requests.
  71. AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"`
  72. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  73. // unconditionally include in API requests. By default, fields with
  74. // empty values are omitted from API requests. However, any non-pointer,
  75. // non-interface field appearing in ForceSendFields will be sent to the
  76. // server regardless of whether the field is empty or not. This may be
  77. // used to include empty fields in Patch requests.
  78. ForceSendFields []string `json:"-"`
  79. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  80. // in API requests with the JSON null value. By default, fields with
  81. // empty values are omitted from API requests. However, any field with
  82. // an empty value appearing in NullFields will be sent to the server as
  83. // null. It is an error if a field in this list has a non-empty value.
  84. // This may be used to include null fields in Patch requests.
  85. NullFields []string `json:"-"`
  86. }
  87. func (s *Creative) MarshalJSON() ([]byte, error) {
  88. type NoMethod Creative
  89. raw := NoMethod(*s)
  90. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  91. }