|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345 |
- // Package youtubereporting provides access to the YouTube Reporting API.
- //
- // See https://developers.google.com/youtube/reporting/v1/reports/
- //
- // Usage example:
- //
- // import "google.golang.org/api/youtubereporting/v1"
- // ...
- // youtubereportingService, err := youtubereporting.New(oauthHttpClient)
- package youtubereporting // import "google.golang.org/api/youtubereporting/v1"
-
- import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- context "golang.org/x/net/context"
- ctxhttp "golang.org/x/net/context/ctxhttp"
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
- )
-
- // Always reference these packages, just in case the auto-generated code
- // below doesn't.
- var _ = bytes.NewBuffer
- var _ = strconv.Itoa
- var _ = fmt.Sprintf
- var _ = json.NewDecoder
- var _ = io.Copy
- var _ = url.Parse
- var _ = gensupport.MarshalJSON
- var _ = googleapi.Version
- var _ = errors.New
- var _ = strings.Replace
- var _ = context.Canceled
- var _ = ctxhttp.Do
-
- const apiId = "youtubereporting:v1"
- const apiName = "youtubereporting"
- const apiVersion = "v1"
- const basePath = "https://youtubereporting.googleapis.com/"
-
- // OAuth2 scopes used by this API.
- const (
- // View monetary and non-monetary YouTube Analytics reports for your
- // YouTube content
- YtAnalyticsMonetaryReadonlyScope = "https://www.googleapis.com/auth/yt-analytics-monetary.readonly"
-
- // View YouTube Analytics reports for your YouTube content
- YtAnalyticsReadonlyScope = "https://www.googleapis.com/auth/yt-analytics.readonly"
- )
-
- func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.Jobs = NewJobsService(s)
- s.Media = NewMediaService(s)
- s.ReportTypes = NewReportTypesService(s)
- return s, nil
- }
-
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- Jobs *JobsService
-
- Media *MediaService
-
- ReportTypes *ReportTypesService
- }
-
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
-
- func NewJobsService(s *Service) *JobsService {
- rs := &JobsService{s: s}
- rs.Reports = NewJobsReportsService(s)
- return rs
- }
-
- type JobsService struct {
- s *Service
-
- Reports *JobsReportsService
- }
-
- func NewJobsReportsService(s *Service) *JobsReportsService {
- rs := &JobsReportsService{s: s}
- return rs
- }
-
- type JobsReportsService struct {
- s *Service
- }
-
- func NewMediaService(s *Service) *MediaService {
- rs := &MediaService{s: s}
- return rs
- }
-
- type MediaService struct {
- s *Service
- }
-
- func NewReportTypesService(s *Service) *ReportTypesService {
- rs := &ReportTypesService{s: s}
- return rs
- }
-
- type ReportTypesService struct {
- s *Service
- }
-
- // Empty: A generic empty message that you can re-use to avoid defining
- // duplicated
- // empty messages in your APIs. A typical example is to use it as the
- // request
- // or the response type of an API method. For instance:
- //
- // service Foo {
- // rpc Bar(google.protobuf.Empty) returns
- // (google.protobuf.Empty);
- // }
- //
- // The JSON representation for `Empty` is empty JSON object `{}`.
- type Empty struct {
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- }
-
- // GdataBlobstore2Info: gdata
- type GdataBlobstore2Info struct {
- // BlobGeneration: gdata
- BlobGeneration int64 `json:"blobGeneration,omitempty,string"`
-
- // BlobId: gdata
- BlobId string `json:"blobId,omitempty"`
-
- // DownloadReadHandle: gdata
- DownloadReadHandle string `json:"downloadReadHandle,omitempty"`
-
- // ReadToken: gdata
- ReadToken string `json:"readToken,omitempty"`
-
- // UploadMetadataContainer: gdata
- UploadMetadataContainer string `json:"uploadMetadataContainer,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BlobGeneration") 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. "BlobGeneration") 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 (s *GdataBlobstore2Info) MarshalJSON() ([]byte, error) {
- type NoMethod GdataBlobstore2Info
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataCompositeMedia: gdata
- type GdataCompositeMedia struct {
- // BlobRef: gdata
- BlobRef string `json:"blobRef,omitempty"`
-
- // Blobstore2Info: gdata
- Blobstore2Info *GdataBlobstore2Info `json:"blobstore2Info,omitempty"`
-
- // CosmoBinaryReference: gdata
- CosmoBinaryReference string `json:"cosmoBinaryReference,omitempty"`
-
- // Crc32cHash: gdata
- Crc32cHash int64 `json:"crc32cHash,omitempty"`
-
- // Inline: gdata
- Inline string `json:"inline,omitempty"`
-
- // Length: gdata
- Length int64 `json:"length,omitempty,string"`
-
- // Md5Hash: gdata
- Md5Hash string `json:"md5Hash,omitempty"`
-
- // ObjectId: gdata
- ObjectId *GdataObjectId `json:"objectId,omitempty"`
-
- // Path: gdata
- Path string `json:"path,omitempty"`
-
- // ReferenceType: gdata
- //
- // Possible values:
- // "PATH" - gdata
- // "BLOB_REF" - gdata
- // "INLINE" - gdata
- // "BIGSTORE_REF" - gdata
- // "COSMO_BINARY_REFERENCE" - gdata
- ReferenceType string `json:"referenceType,omitempty"`
-
- // Sha1Hash: gdata
- Sha1Hash string `json:"sha1Hash,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BlobRef") 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. "BlobRef") 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 (s *GdataCompositeMedia) MarshalJSON() ([]byte, error) {
- type NoMethod GdataCompositeMedia
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataContentTypeInfo: gdata
- type GdataContentTypeInfo struct {
- // BestGuess: gdata
- BestGuess string `json:"bestGuess,omitempty"`
-
- // FromBytes: gdata
- FromBytes string `json:"fromBytes,omitempty"`
-
- // FromFileName: gdata
- FromFileName string `json:"fromFileName,omitempty"`
-
- // FromHeader: gdata
- FromHeader string `json:"fromHeader,omitempty"`
-
- // FromUrlPath: gdata
- FromUrlPath string `json:"fromUrlPath,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BestGuess") 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. "BestGuess") 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 (s *GdataContentTypeInfo) MarshalJSON() ([]byte, error) {
- type NoMethod GdataContentTypeInfo
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataDiffChecksumsResponse: gdata
- type GdataDiffChecksumsResponse struct {
- // ChecksumsLocation: gdata
- ChecksumsLocation *GdataCompositeMedia `json:"checksumsLocation,omitempty"`
-
- // ChunkSizeBytes: gdata
- ChunkSizeBytes int64 `json:"chunkSizeBytes,omitempty,string"`
-
- // ObjectLocation: gdata
- ObjectLocation *GdataCompositeMedia `json:"objectLocation,omitempty"`
-
- // ObjectSizeBytes: gdata
- ObjectSizeBytes int64 `json:"objectSizeBytes,omitempty,string"`
-
- // ObjectVersion: gdata
- ObjectVersion string `json:"objectVersion,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ChecksumsLocation")
- // 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. "ChecksumsLocation") 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 (s *GdataDiffChecksumsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod GdataDiffChecksumsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataDiffDownloadResponse: gdata
- type GdataDiffDownloadResponse struct {
- // ObjectLocation: gdata
- ObjectLocation *GdataCompositeMedia `json:"objectLocation,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ObjectLocation") 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. "ObjectLocation") 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 (s *GdataDiffDownloadResponse) MarshalJSON() ([]byte, error) {
- type NoMethod GdataDiffDownloadResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataDiffUploadRequest: gdata
- type GdataDiffUploadRequest struct {
- // ChecksumsInfo: gdata
- ChecksumsInfo *GdataCompositeMedia `json:"checksumsInfo,omitempty"`
-
- // ObjectInfo: gdata
- ObjectInfo *GdataCompositeMedia `json:"objectInfo,omitempty"`
-
- // ObjectVersion: gdata
- ObjectVersion string `json:"objectVersion,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ChecksumsInfo") 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. "ChecksumsInfo") 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 (s *GdataDiffUploadRequest) MarshalJSON() ([]byte, error) {
- type NoMethod GdataDiffUploadRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataDiffUploadResponse: gdata
- type GdataDiffUploadResponse struct {
- // ObjectVersion: gdata
- ObjectVersion string `json:"objectVersion,omitempty"`
-
- // OriginalObject: gdata
- OriginalObject *GdataCompositeMedia `json:"originalObject,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ObjectVersion") 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. "ObjectVersion") 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 (s *GdataDiffUploadResponse) MarshalJSON() ([]byte, error) {
- type NoMethod GdataDiffUploadResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataDiffVersionResponse: gdata
- type GdataDiffVersionResponse struct {
- // ObjectSizeBytes: gdata
- ObjectSizeBytes int64 `json:"objectSizeBytes,omitempty,string"`
-
- // ObjectVersion: gdata
- ObjectVersion string `json:"objectVersion,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ObjectSizeBytes") 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. "ObjectSizeBytes") 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 (s *GdataDiffVersionResponse) MarshalJSON() ([]byte, error) {
- type NoMethod GdataDiffVersionResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataDownloadParameters: gdata
- type GdataDownloadParameters struct {
- // AllowGzipCompression: gdata
- AllowGzipCompression bool `json:"allowGzipCompression,omitempty"`
-
- // IgnoreRange: gdata
- IgnoreRange bool `json:"ignoreRange,omitempty"`
-
- // ForceSendFields is a list of field names (e.g.
- // "AllowGzipCompression") 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. "AllowGzipCompression") 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 (s *GdataDownloadParameters) MarshalJSON() ([]byte, error) {
- type NoMethod GdataDownloadParameters
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataMedia: gdata
- type GdataMedia struct {
- // Algorithm: gdata
- Algorithm string `json:"algorithm,omitempty"`
-
- // BigstoreObjectRef: gdata
- BigstoreObjectRef string `json:"bigstoreObjectRef,omitempty"`
-
- // BlobRef: gdata
- BlobRef string `json:"blobRef,omitempty"`
-
- // Blobstore2Info: gdata
- Blobstore2Info *GdataBlobstore2Info `json:"blobstore2Info,omitempty"`
-
- // CompositeMedia: gdata
- CompositeMedia []*GdataCompositeMedia `json:"compositeMedia,omitempty"`
-
- // ContentType: gdata
- ContentType string `json:"contentType,omitempty"`
-
- // ContentTypeInfo: gdata
- ContentTypeInfo *GdataContentTypeInfo `json:"contentTypeInfo,omitempty"`
-
- // CosmoBinaryReference: gdata
- CosmoBinaryReference string `json:"cosmoBinaryReference,omitempty"`
-
- // Crc32cHash: gdata
- Crc32cHash int64 `json:"crc32cHash,omitempty"`
-
- // DiffChecksumsResponse: gdata
- DiffChecksumsResponse *GdataDiffChecksumsResponse `json:"diffChecksumsResponse,omitempty"`
-
- // DiffDownloadResponse: gdata
- DiffDownloadResponse *GdataDiffDownloadResponse `json:"diffDownloadResponse,omitempty"`
-
- // DiffUploadRequest: gdata
- DiffUploadRequest *GdataDiffUploadRequest `json:"diffUploadRequest,omitempty"`
-
- // DiffUploadResponse: gdata
- DiffUploadResponse *GdataDiffUploadResponse `json:"diffUploadResponse,omitempty"`
-
- // DiffVersionResponse: gdata
- DiffVersionResponse *GdataDiffVersionResponse `json:"diffVersionResponse,omitempty"`
-
- // DownloadParameters: gdata
- DownloadParameters *GdataDownloadParameters `json:"downloadParameters,omitempty"`
-
- // Filename: gdata
- Filename string `json:"filename,omitempty"`
-
- // Hash: gdata
- Hash string `json:"hash,omitempty"`
-
- // HashVerified: gdata
- HashVerified bool `json:"hashVerified,omitempty"`
-
- // Inline: gdata
- Inline string `json:"inline,omitempty"`
-
- // IsPotentialRetry: gdata
- IsPotentialRetry bool `json:"isPotentialRetry,omitempty"`
-
- // Length: gdata
- Length int64 `json:"length,omitempty,string"`
-
- // Md5Hash: gdata
- Md5Hash string `json:"md5Hash,omitempty"`
-
- // MediaId: gdata
- MediaId string `json:"mediaId,omitempty"`
-
- // ObjectId: gdata
- ObjectId *GdataObjectId `json:"objectId,omitempty"`
-
- // Path: gdata
- Path string `json:"path,omitempty"`
-
- // ReferenceType: gdata
- //
- // Possible values:
- // "PATH" - gdata
- // "BLOB_REF" - gdata
- // "INLINE" - gdata
- // "GET_MEDIA" - gdata
- // "COMPOSITE_MEDIA" - gdata
- // "BIGSTORE_REF" - gdata
- // "DIFF_VERSION_RESPONSE" - gdata
- // "DIFF_CHECKSUMS_RESPONSE" - gdata
- // "DIFF_DOWNLOAD_RESPONSE" - gdata
- // "DIFF_UPLOAD_REQUEST" - gdata
- // "DIFF_UPLOAD_RESPONSE" - gdata
- // "COSMO_BINARY_REFERENCE" - gdata
- // "ARBITRARY_BYTES" - gdata
- ReferenceType string `json:"referenceType,omitempty"`
-
- // Sha1Hash: gdata
- Sha1Hash string `json:"sha1Hash,omitempty"`
-
- // Sha256Hash: gdata
- Sha256Hash string `json:"sha256Hash,omitempty"`
-
- // Timestamp: gdata
- Timestamp uint64 `json:"timestamp,omitempty,string"`
-
- // Token: gdata
- Token string `json:"token,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Algorithm") 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. "Algorithm") 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 (s *GdataMedia) MarshalJSON() ([]byte, error) {
- type NoMethod GdataMedia
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // GdataObjectId: gdata
- type GdataObjectId struct {
- // BucketName: gdata
- BucketName string `json:"bucketName,omitempty"`
-
- // Generation: gdata
- Generation int64 `json:"generation,omitempty,string"`
-
- // ObjectName: gdata
- ObjectName string `json:"objectName,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "BucketName") 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. "BucketName") 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 (s *GdataObjectId) MarshalJSON() ([]byte, error) {
- type NoMethod GdataObjectId
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Job: A job creating reports of a specific type.
- type Job struct {
- // CreateTime: The creation date/time of the job.
- CreateTime string `json:"createTime,omitempty"`
-
- // ExpireTime: The date/time when this job will expire/expired. After a
- // job expired, no
- // new reports are generated.
- ExpireTime string `json:"expireTime,omitempty"`
-
- // Id: The server-generated ID of the job (max. 40 characters).
- Id string `json:"id,omitempty"`
-
- // Name: The name of the job (max. 100 characters).
- Name string `json:"name,omitempty"`
-
- // ReportTypeId: The type of reports this job creates. Corresponds to
- // the ID of a
- // ReportType.
- ReportTypeId string `json:"reportTypeId,omitempty"`
-
- // SystemManaged: True if this a system-managed job that cannot be
- // modified by the user;
- // otherwise false.
- SystemManaged bool `json:"systemManaged,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 (s *Job) MarshalJSON() ([]byte, error) {
- type NoMethod Job
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListJobsResponse: Response message for ReportingService.ListJobs.
- type ListJobsResponse struct {
- // Jobs: The list of jobs.
- Jobs []*Job `json:"jobs,omitempty"`
-
- // NextPageToken: A token to retrieve next page of results.
- // Pass this value in the
- // ListJobsRequest.page_token
- // field in the subsequent call to `ListJobs` method to retrieve the
- // next
- // page of results.
- 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. "Jobs") 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. "Jobs") 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 (s *ListJobsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListJobsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListReportTypesResponse: Response message for
- // ReportingService.ListReportTypes.
- type ListReportTypesResponse struct {
- // NextPageToken: A token to retrieve next page of results.
- // Pass this value in the
- // ListReportTypesRequest.page_token
- // field in the subsequent call to `ListReportTypes` method to retrieve
- // the next
- // page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ReportTypes: The list of report types.
- ReportTypes []*ReportType `json:"reportTypes,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 (s *ListReportTypesResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListReportTypesResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListReportsResponse: Response message for
- // ReportingService.ListReports.
- type ListReportsResponse struct {
- // NextPageToken: A token to retrieve next page of results.
- // Pass this value in the
- // ListReportsRequest.page_token
- // field in the subsequent call to `ListReports` method to retrieve the
- // next
- // page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Reports: The list of report types.
- Reports []*Report `json:"reports,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "NextPageToken") 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. "NextPageToken") 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 (s *ListReportsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListReportsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Report: A report's metadata including the URL from which the report
- // itself can be
- // downloaded.
- type Report struct {
- // CreateTime: The date/time when this report was created.
- CreateTime string `json:"createTime,omitempty"`
-
- // DownloadUrl: The URL from which the report can be downloaded (max.
- // 1000 characters).
- DownloadUrl string `json:"downloadUrl,omitempty"`
-
- // EndTime: The end of the time period that the report instance covers.
- // The value is
- // exclusive.
- EndTime string `json:"endTime,omitempty"`
-
- // Id: The server-generated ID of the report.
- Id string `json:"id,omitempty"`
-
- // JobExpireTime: The date/time when the job this report belongs to will
- // expire/expired.
- JobExpireTime string `json:"jobExpireTime,omitempty"`
-
- // JobId: The ID of the job that created this report.
- JobId string `json:"jobId,omitempty"`
-
- // StartTime: The start of the time period that the report instance
- // covers. The value is
- // inclusive.
- StartTime string `json:"startTime,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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 (s *Report) MarshalJSON() ([]byte, error) {
- type NoMethod Report
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ReportType: A report type.
- type ReportType struct {
- // DeprecateTime: The date/time when this report type was/will be
- // deprecated.
- DeprecateTime string `json:"deprecateTime,omitempty"`
-
- // Id: The ID of the report type (max. 100 characters).
- Id string `json:"id,omitempty"`
-
- // Name: The name of the report type (max. 100 characters).
- Name string `json:"name,omitempty"`
-
- // SystemManaged: True if this a system-managed report type; otherwise
- // false. Reporting jobs
- // for system-managed report types are created automatically and can
- // thus not
- // be used in the `CreateJob` method.
- SystemManaged bool `json:"systemManaged,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DeprecateTime") 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. "DeprecateTime") 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 (s *ReportType) MarshalJSON() ([]byte, error) {
- type NoMethod ReportType
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // method id "youtubereporting.jobs.create":
-
- type JobsCreateCall struct {
- s *Service
- job *Job
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Create: Creates a job and returns it.
- func (r *JobsService) Create(job *Job) *JobsCreateCall {
- c := &JobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.job = job
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *JobsCreateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *JobsCreateCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *JobsCreateCall) Fields(s ...googleapi.Field) *JobsCreateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *JobsCreateCall) Context(ctx context.Context) *JobsCreateCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *JobsCreateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *JobsCreateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.jobs.create" call.
- // Exactly one of *Job or error will be non-nil. Any non-2xx status code
- // is an error. Response headers are in either
- // *Job.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 (c *JobsCreateCall) Do(opts ...googleapi.CallOption) (*Job, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Job{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a job and returns it.",
- // "flatPath": "v1/jobs",
- // "httpMethod": "POST",
- // "id": "youtubereporting.jobs.create",
- // "parameterOrder": [],
- // "parameters": {
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1/jobs",
- // "request": {
- // "$ref": "Job"
- // },
- // "response": {
- // "$ref": "Job"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // method id "youtubereporting.jobs.delete":
-
- type JobsDeleteCall struct {
- s *Service
- jobId string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes a job.
- func (r *JobsService) Delete(jobId string) *JobsDeleteCall {
- c := &JobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.jobId = jobId
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *JobsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *JobsDeleteCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *JobsDeleteCall) Fields(s ...googleapi.Field) *JobsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *JobsDeleteCall) Context(ctx context.Context) *JobsDeleteCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *JobsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *JobsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "jobId": c.jobId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.jobs.delete" call.
- // Exactly one of *Empty or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Empty.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 (c *JobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Empty{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Deletes a job.",
- // "flatPath": "v1/jobs/{jobId}",
- // "httpMethod": "DELETE",
- // "id": "youtubereporting.jobs.delete",
- // "parameterOrder": [
- // "jobId"
- // ],
- // "parameters": {
- // "jobId": {
- // "description": "The ID of the job to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1/jobs/{jobId}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // method id "youtubereporting.jobs.get":
-
- type JobsGetCall struct {
- s *Service
- jobId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets a job.
- func (r *JobsService) Get(jobId string) *JobsGetCall {
- c := &JobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.jobId = jobId
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *JobsGetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *JobsGetCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *JobsGetCall) Fields(s ...googleapi.Field) *JobsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *JobsGetCall) IfNoneMatch(entityTag string) *JobsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // 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 (c *JobsGetCall) Context(ctx context.Context) *JobsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *JobsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *JobsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "jobId": c.jobId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.jobs.get" call.
- // Exactly one of *Job or error will be non-nil. Any non-2xx status code
- // is an error. Response headers are in either
- // *Job.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 (c *JobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Job{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets a job.",
- // "flatPath": "v1/jobs/{jobId}",
- // "httpMethod": "GET",
- // "id": "youtubereporting.jobs.get",
- // "parameterOrder": [
- // "jobId"
- // ],
- // "parameters": {
- // "jobId": {
- // "description": "The ID of the job to retrieve.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1/jobs/{jobId}",
- // "response": {
- // "$ref": "Job"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // method id "youtubereporting.jobs.list":
-
- type JobsListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists jobs.
- func (r *JobsService) List() *JobsListCall {
- c := &JobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
- }
-
- // IncludeSystemManaged sets the optional parameter
- // "includeSystemManaged": If set to true, also system-managed jobs will
- // be returned; otherwise only
- // user-created jobs will be returned. System-managed jobs can neither
- // be
- // modified nor deleted.
- func (c *JobsListCall) IncludeSystemManaged(includeSystemManaged bool) *JobsListCall {
- c.urlParams_.Set("includeSystemManaged", fmt.Sprint(includeSystemManaged))
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *JobsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *JobsListCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": Requested page size.
- // Server may return fewer jobs than requested.
- // If unspecified, server will pick an appropriate default.
- func (c *JobsListCall) PageSize(pageSize int64) *JobsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results the server should return.
- // Typically,
- // this is the value of
- // ListReportTypesResponse.next_page_token
- // returned in response to the previous call to the `ListJobs` method.
- func (c *JobsListCall) PageToken(pageToken string) *JobsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *JobsListCall) Fields(s ...googleapi.Field) *JobsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *JobsListCall) IfNoneMatch(entityTag string) *JobsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // 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 (c *JobsListCall) Context(ctx context.Context) *JobsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *JobsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *JobsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.jobs.list" call.
- // Exactly one of *ListJobsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListJobsResponse.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 (c *JobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListJobsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists jobs.",
- // "flatPath": "v1/jobs",
- // "httpMethod": "GET",
- // "id": "youtubereporting.jobs.list",
- // "parameterOrder": [],
- // "parameters": {
- // "includeSystemManaged": {
- // "description": "If set to true, also system-managed jobs will be returned; otherwise only\nuser-created jobs will be returned. System-managed jobs can neither be\nmodified nor deleted.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // },
- // "pageSize": {
- // "description": "Requested page size. Server may return fewer jobs than requested.\nIf unspecified, server will pick an appropriate default.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportTypesResponse.next_page_token\nreturned in response to the previous call to the `ListJobs` method.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1/jobs",
- // "response": {
- // "$ref": "ListJobsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // 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.
- func (c *JobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "youtubereporting.jobs.reports.get":
-
- type JobsReportsGetCall struct {
- s *Service
- jobId string
- reportId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets the metadata of a specific report.
- func (r *JobsReportsService) Get(jobId string, reportId string) *JobsReportsGetCall {
- c := &JobsReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.jobId = jobId
- c.reportId = reportId
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *JobsReportsGetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *JobsReportsGetCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *JobsReportsGetCall) Fields(s ...googleapi.Field) *JobsReportsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *JobsReportsGetCall) IfNoneMatch(entityTag string) *JobsReportsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // 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 (c *JobsReportsGetCall) Context(ctx context.Context) *JobsReportsGetCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *JobsReportsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *JobsReportsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}/reports/{reportId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "jobId": c.jobId,
- "reportId": c.reportId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.jobs.reports.get" call.
- // Exactly one of *Report or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *Report.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 (c *JobsReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Report{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Gets the metadata of a specific report.",
- // "flatPath": "v1/jobs/{jobId}/reports/{reportId}",
- // "httpMethod": "GET",
- // "id": "youtubereporting.jobs.reports.get",
- // "parameterOrder": [
- // "jobId",
- // "reportId"
- // ],
- // "parameters": {
- // "jobId": {
- // "description": "The ID of the job.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // },
- // "reportId": {
- // "description": "The ID of the report to retrieve.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1/jobs/{jobId}/reports/{reportId}",
- // "response": {
- // "$ref": "Report"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // method id "youtubereporting.jobs.reports.list":
-
- type JobsReportsListCall struct {
- s *Service
- jobId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists reports created by a specific job.
- // Returns NOT_FOUND if the job does not exist.
- func (r *JobsReportsService) List(jobId string) *JobsReportsListCall {
- c := &JobsReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.jobId = jobId
- return c
- }
-
- // CreatedAfter sets the optional parameter "createdAfter": If set, only
- // reports created after the specified date/time are returned.
- func (c *JobsReportsListCall) CreatedAfter(createdAfter string) *JobsReportsListCall {
- c.urlParams_.Set("createdAfter", createdAfter)
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *JobsReportsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *JobsReportsListCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": Requested page size.
- // Server may return fewer report types than requested.
- // If unspecified, server will pick an appropriate default.
- func (c *JobsReportsListCall) PageSize(pageSize int64) *JobsReportsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results the server should return.
- // Typically,
- // this is the value of
- // ListReportsResponse.next_page_token
- // returned in response to the previous call to the `ListReports`
- // method.
- func (c *JobsReportsListCall) PageToken(pageToken string) *JobsReportsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // StartTimeAtOrAfter sets the optional parameter "startTimeAtOrAfter":
- // If set, only reports whose start time is greater than or equal
- // the
- // specified date/time are returned.
- func (c *JobsReportsListCall) StartTimeAtOrAfter(startTimeAtOrAfter string) *JobsReportsListCall {
- c.urlParams_.Set("startTimeAtOrAfter", startTimeAtOrAfter)
- return c
- }
-
- // StartTimeBefore sets the optional parameter "startTimeBefore": If
- // set, only reports whose start time is smaller than the
- // specified
- // date/time are returned.
- func (c *JobsReportsListCall) StartTimeBefore(startTimeBefore string) *JobsReportsListCall {
- c.urlParams_.Set("startTimeBefore", startTimeBefore)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *JobsReportsListCall) Fields(s ...googleapi.Field) *JobsReportsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *JobsReportsListCall) IfNoneMatch(entityTag string) *JobsReportsListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // 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 (c *JobsReportsListCall) Context(ctx context.Context) *JobsReportsListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *JobsReportsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *JobsReportsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/jobs/{jobId}/reports")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "jobId": c.jobId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.jobs.reports.list" call.
- // Exactly one of *ListReportsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListReportsResponse.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 (c *JobsReportsListCall) Do(opts ...googleapi.CallOption) (*ListReportsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListReportsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists reports created by a specific job.\nReturns NOT_FOUND if the job does not exist.",
- // "flatPath": "v1/jobs/{jobId}/reports",
- // "httpMethod": "GET",
- // "id": "youtubereporting.jobs.reports.list",
- // "parameterOrder": [
- // "jobId"
- // ],
- // "parameters": {
- // "createdAfter": {
- // "description": "If set, only reports created after the specified date/time are returned.",
- // "format": "google-datetime",
- // "location": "query",
- // "type": "string"
- // },
- // "jobId": {
- // "description": "The ID of the job.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // },
- // "pageSize": {
- // "description": "Requested page size. Server may return fewer report types than requested.\nIf unspecified, server will pick an appropriate default.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportsResponse.next_page_token\nreturned in response to the previous call to the `ListReports` method.",
- // "location": "query",
- // "type": "string"
- // },
- // "startTimeAtOrAfter": {
- // "description": "If set, only reports whose start time is greater than or equal the\nspecified date/time are returned.",
- // "format": "google-datetime",
- // "location": "query",
- // "type": "string"
- // },
- // "startTimeBefore": {
- // "description": "If set, only reports whose start time is smaller than the specified\ndate/time are returned.",
- // "format": "google-datetime",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1/jobs/{jobId}/reports",
- // "response": {
- // "$ref": "ListReportsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // 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.
- func (c *JobsReportsListCall) Pages(ctx context.Context, f func(*ListReportsResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
-
- // method id "youtubereporting.media.download":
-
- type MediaDownloadCall struct {
- s *Service
- resourceName string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Download: Method for media download. Download is supported
- // on the URI `/v1/media/{+name}?alt=media`.
- func (r *MediaService) Download(resourceName string) *MediaDownloadCall {
- c := &MediaDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.resourceName = resourceName
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // 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 (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *MediaDownloadCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/media/{+resourceName}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "resourceName": c.resourceName,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // 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 (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("media")
- if err != nil {
- return nil, err
- }
- if err := googleapi.CheckMediaResponse(res); err != nil {
- res.Body.Close()
- return nil, err
- }
- return res, nil
- }
-
- // Do executes the "youtubereporting.media.download" call.
- // Exactly one of *GdataMedia or error will be non-nil. Any non-2xx
- // status code is an error. Response headers are in either
- // *GdataMedia.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 (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*GdataMedia, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &GdataMedia{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Method for media download. Download is supported\non the URI `/v1/media/{+name}?alt=media`.",
- // "flatPath": "v1/media/{mediaId}",
- // "httpMethod": "GET",
- // "id": "youtubereporting.media.download",
- // "parameterOrder": [
- // "resourceName"
- // ],
- // "parameters": {
- // "resourceName": {
- // "description": "Name of the media that is being downloaded.",
- // "location": "path",
- // "pattern": "^.+$",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1/media/{+resourceName}",
- // "response": {
- // "$ref": "GdataMedia"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ],
- // "supportsMediaDownload": true
- // }
-
- }
-
- // method id "youtubereporting.reportTypes.list":
-
- type ReportTypesListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists report types.
- func (r *ReportTypesService) List() *ReportTypesListCall {
- c := &ReportTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
- }
-
- // IncludeSystemManaged sets the optional parameter
- // "includeSystemManaged": If set to true, also system-managed report
- // types will be returned;
- // otherwise only the report types that can be used to create new
- // reporting
- // jobs will be returned.
- func (c *ReportTypesListCall) IncludeSystemManaged(includeSystemManaged bool) *ReportTypesListCall {
- c.urlParams_.Set("includeSystemManaged", fmt.Sprint(includeSystemManaged))
- return c
- }
-
- // OnBehalfOfContentOwner sets the optional parameter
- // "onBehalfOfContentOwner": The content owner's external ID on which
- // behalf the user is acting on. If
- // not set, the user is acting for himself (his own channel).
- func (c *ReportTypesListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ReportTypesListCall {
- c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": Requested page size.
- // Server may return fewer report types than requested.
- // If unspecified, server will pick an appropriate default.
- func (c *ReportTypesListCall) PageSize(pageSize int64) *ReportTypesListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": A token
- // identifying a page of results the server should return.
- // Typically,
- // this is the value of
- // ListReportTypesResponse.next_page_token
- // returned in response to the previous call to the `ListReportTypes`
- // method.
- func (c *ReportTypesListCall) PageToken(pageToken string) *ReportTypesListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // Fields allows partial responses to be retrieved. See
- // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
- // for more information.
- func (c *ReportTypesListCall) Fields(s ...googleapi.Field) *ReportTypesListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
- }
-
- // 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 (c *ReportTypesListCall) IfNoneMatch(entityTag string) *ReportTypesListCall {
- c.ifNoneMatch_ = entityTag
- return c
- }
-
- // 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 (c *ReportTypesListCall) Context(ctx context.Context) *ReportTypesListCall {
- c.ctx_ = ctx
- return c
- }
-
- // Header returns an http.Header that can be modified by the caller to
- // add HTTP headers to the request.
- func (c *ReportTypesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ReportTypesListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1/reportTypes")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "youtubereporting.reportTypes.list" call.
- // Exactly one of *ListReportTypesResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListReportTypesResponse.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 (c *ReportTypesListCall) Do(opts ...googleapi.CallOption) (*ListReportTypesResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ListReportTypesResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Lists report types.",
- // "flatPath": "v1/reportTypes",
- // "httpMethod": "GET",
- // "id": "youtubereporting.reportTypes.list",
- // "parameterOrder": [],
- // "parameters": {
- // "includeSystemManaged": {
- // "description": "If set to true, also system-managed report types will be returned;\notherwise only the report types that can be used to create new reporting\njobs will be returned.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "onBehalfOfContentOwner": {
- // "description": "The content owner's external ID on which behalf the user is acting on. If\nnot set, the user is acting for himself (his own channel).",
- // "location": "query",
- // "type": "string"
- // },
- // "pageSize": {
- // "description": "Requested page size. Server may return fewer report types than requested.\nIf unspecified, server will pick an appropriate default.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A token identifying a page of results the server should return. Typically,\nthis is the value of\nListReportTypesResponse.next_page_token\nreturned in response to the previous call to the `ListReportTypes` method.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1/reportTypes",
- // "response": {
- // "$ref": "ListReportTypesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
- // "https://www.googleapis.com/auth/yt-analytics.readonly"
- // ]
- // }
-
- }
-
- // 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.
- func (c *ReportTypesListCall) Pages(ctx context.Context, f func(*ListReportTypesResponse) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
- }
|