|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152 |
- // Package logging provides access to the Google Cloud Logging API.
- //
- // Usage example:
- //
- // import "google.golang.org/api/logging/v1beta3"
- // ...
- // loggingService, err := logging.New(oauthHttpClient)
- package logging // import "google.golang.org/api/logging/v1beta3"
-
- 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 = "logging:v1beta3"
- const apiName = "logging"
- const apiVersion = "v1beta3"
- const basePath = "https://logging.googleapis.com/"
-
- // OAuth2 scopes used by this API.
- const (
- // View and manage your data across Google Cloud Platform services
- CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
- )
-
- func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.Projects = NewProjectsService(s)
- return s, nil
- }
-
- type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- Projects *ProjectsService
- }
-
- func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
- }
-
- func NewProjectsService(s *Service) *ProjectsService {
- rs := &ProjectsService{s: s}
- rs.LogServices = NewProjectsLogServicesService(s)
- rs.Logs = NewProjectsLogsService(s)
- return rs
- }
-
- type ProjectsService struct {
- s *Service
-
- LogServices *ProjectsLogServicesService
-
- Logs *ProjectsLogsService
- }
-
- func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService {
- rs := &ProjectsLogServicesService{s: s}
- rs.Indexes = NewProjectsLogServicesIndexesService(s)
- rs.Sinks = NewProjectsLogServicesSinksService(s)
- return rs
- }
-
- type ProjectsLogServicesService struct {
- s *Service
-
- Indexes *ProjectsLogServicesIndexesService
-
- Sinks *ProjectsLogServicesSinksService
- }
-
- func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService {
- rs := &ProjectsLogServicesIndexesService{s: s}
- return rs
- }
-
- type ProjectsLogServicesIndexesService struct {
- s *Service
- }
-
- func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService {
- rs := &ProjectsLogServicesSinksService{s: s}
- return rs
- }
-
- type ProjectsLogServicesSinksService struct {
- s *Service
- }
-
- func NewProjectsLogsService(s *Service) *ProjectsLogsService {
- rs := &ProjectsLogsService{s: s}
- rs.Entries = NewProjectsLogsEntriesService(s)
- rs.Sinks = NewProjectsLogsSinksService(s)
- return rs
- }
-
- type ProjectsLogsService struct {
- s *Service
-
- Entries *ProjectsLogsEntriesService
-
- Sinks *ProjectsLogsSinksService
- }
-
- func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService {
- rs := &ProjectsLogsEntriesService{s: s}
- return rs
- }
-
- type ProjectsLogsEntriesService struct {
- s *Service
- }
-
- func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService {
- rs := &ProjectsLogsSinksService{s: s}
- return rs
- }
-
- type ProjectsLogsSinksService 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); }
- type Empty struct {
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- }
-
- // ListLogServiceIndexesResponse: Result returned from
- // ListLogServiceIndexesRequest.
- type ListLogServiceIndexesResponse struct {
- // NextPageToken: If there are more results, then `nextPageToken` is
- // returned in the response. To get the next batch of indexes, use the
- // value of `nextPageToken` as `pageToken` in the next call of
- // `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are
- // no more results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServiceIndexPrefixes: A list of log service index prefixes.
- ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,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 *ListLogServiceIndexesResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListLogServiceIndexesResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListLogServiceSinksResponse: Result returned from
- // `ListLogServiceSinks`.
- type ListLogServiceSinksResponse struct {
- // Sinks: The requested log service sinks. If any of the returned
- // `LogSink` objects have an empty `destination` field, then call
- // `logServices.sinks.get` to retrieve the complete `LogSink` object.
- Sinks []*LogSink `json:"sinks,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Sinks") 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. "Sinks") 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 *ListLogServiceSinksResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListLogServiceSinksResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListLogServicesResponse: Result returned from
- // `ListLogServicesRequest`.
- type ListLogServicesResponse struct {
- // LogServices: A list of log services.
- LogServices []*LogService `json:"logServices,omitempty"`
-
- // NextPageToken: If there are more results, then `nextPageToken` is
- // returned in the response. To get the next batch of services, use the
- // value of `nextPageToken` as `pageToken` in the next call of
- // `ListLogServices`. If `nextPageToken` is empty, then there are no
- // more 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. "LogServices") 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. "LogServices") 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 *ListLogServicesResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListLogServicesResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListLogSinksResponse: Result returned from `ListLogSinks`.
- type ListLogSinksResponse struct {
- // Sinks: The requested log sinks. If any of the returned `LogSink`
- // objects have an empty `destination` field, then call
- // `logServices.sinks.get` to retrieve the complete `LogSink` object.
- Sinks []*LogSink `json:"sinks,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Sinks") 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. "Sinks") 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 *ListLogSinksResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListLogSinksResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // ListLogsResponse: Result returned from ListLogs.
- type ListLogsResponse struct {
- // Logs: A list of log resources.
- Logs []*Log `json:"logs,omitempty"`
-
- // NextPageToken: If there are more results, then `nextPageToken` is
- // returned in the response. To get the next batch of logs, use the
- // value of `nextPageToken` as `pageToken` in the next call of
- // `ListLogs`. If `nextPageToken` is empty, then there are no more
- // 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. "Logs") 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. "Logs") 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 *ListLogsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod ListLogsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Log: A log object.
- type Log struct {
- // DisplayName: Name used when displaying the log to the user (for
- // example, in a UI). Example: "activity_log"
- DisplayName string `json:"displayName,omitempty"`
-
- // Name: REQUIRED: The log's name name. Example:
- // "compute.googleapis.com/activity_log".
- Name string `json:"name,omitempty"`
-
- // PayloadType: Type URL describing the expected payload type for the
- // log.
- PayloadType string `json:"payloadType,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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 *Log) MarshalJSON() ([]byte, error) {
- type NoMethod Log
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // LogEntry: An individual entry in a log.
- type LogEntry struct {
- // InsertId: A unique ID for the log entry. If you provide this field,
- // the logging service considers other log entries in the same log with
- // the same ID as duplicates which can be removed.
- InsertId string `json:"insertId,omitempty"`
-
- // Log: The log to which this entry belongs. When a log entry is
- // ingested, the value of this field is set by the logging system.
- Log string `json:"log,omitempty"`
-
- // Metadata: Information about the log entry.
- Metadata *LogEntryMetadata `json:"metadata,omitempty"`
-
- // ProtoPayload: The log entry payload, represented as a protocol buffer
- // that is expressed as a JSON object. You can only pass `protoPayload`
- // values that belong to a set of approved types.
- ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
-
- // StructPayload: The log entry payload, represented as a structure that
- // is expressed as a JSON object.
- StructPayload googleapi.RawMessage `json:"structPayload,omitempty"`
-
- // TextPayload: The log entry payload, represented as a text string.
- TextPayload string `json:"textPayload,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "InsertId") 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. "InsertId") 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 *LogEntry) MarshalJSON() ([]byte, error) {
- type NoMethod LogEntry
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // LogEntryMetadata: Additional data that is associated with a log
- // entry, set by the service creating the log entry.
- type LogEntryMetadata struct {
- // Labels: A set of (key, value) data that provides additional
- // information about the log entry. If the log entry is from one of the
- // Google Cloud Platform sources listed below, the indicated (key,
- // value) information must be provided: Google App Engine, service_name
- // `appengine.googleapis.com`: "appengine.googleapis.com/module_id",
- // "appengine.googleapis.com/version_id", and one of:
- // "appengine.googleapis.com/replica_index",
- // "appengine.googleapis.com/clone_id", or else provide the following
- // Compute Engine labels: Google Compute Engine, service_name
- // `compute.googleapis.com`: "compute.googleapis.com/resource_type",
- // "instance" "compute.googleapis.com/resource_id",
- Labels map[string]string `json:"labels,omitempty"`
-
- // ProjectId: The project ID of the Google Cloud Platform service that
- // created the log entry.
- ProjectId string `json:"projectId,omitempty"`
-
- // Region: The region name of the Google Cloud Platform service that
- // created the log entry. For example, "us-central1".
- Region string `json:"region,omitempty"`
-
- // ServiceName: The API name of the Google Cloud Platform service that
- // created the log entry. For example, "compute.googleapis.com".
- ServiceName string `json:"serviceName,omitempty"`
-
- // Severity: The severity of the log entry.
- //
- // Possible values:
- // "DEFAULT" - This is the DEFAULT description
- // "DEBUG" - This is the DEBUG description
- // "INFO" - This is the INFO description
- // "NOTICE" - This is the NOTICE description
- // "WARNING" - This is the WARNING description
- // "ERROR" - This is the ERROR description
- // "CRITICAL" - This is the CRITICAL description
- // "ALERT" - This is the ALERT description
- // "EMERGENCY" (default) - This is the EMERGENCY description
- Severity string `json:"severity,omitempty"`
-
- // Timestamp: The time the event described by the log entry occurred.
- // Timestamps must be later than January 1, 1970.
- Timestamp string `json:"timestamp,omitempty"`
-
- // UserId: The fully-qualified email address of the authenticated user
- // that performed or requested the action represented by the log entry.
- // If the log entry does not apply to an action taken by an
- // authenticated user, then the field should be empty.
- UserId string `json:"userId,omitempty"`
-
- // Zone: The zone of the Google Cloud Platform service that created the
- // log entry. For example, "us-central1-a".
- Zone string `json:"zone,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Labels") 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. "Labels") 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 *LogEntryMetadata) MarshalJSON() ([]byte, error) {
- type NoMethod LogEntryMetadata
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // LogError: A problem in a sink or the sink's configuration.
- type LogError struct {
- // Resource: The resource associated with the error. It may be different
- // from the sink destination. For example, the sink may point to a
- // BigQuery dataset, but the error may refer to a table resource inside
- // the dataset.
- Resource string `json:"resource,omitempty"`
-
- // Status: The description of the last error observed.
- Status *Status `json:"status,omitempty"`
-
- // TimeNanos: The last time the error was observed, in nanoseconds since
- // the Unix epoch.
- TimeNanos int64 `json:"timeNanos,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "Resource") 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. "Resource") 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 *LogError) MarshalJSON() ([]byte, error) {
- type NoMethod LogError
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // LogService: A log service object.
- type LogService struct {
- // IndexKeys: Label keys used when labeling log entries for this
- // service. The order of the keys is significant, with higher priority
- // keys coming earlier in the list.
- IndexKeys []string `json:"indexKeys,omitempty"`
-
- // Name: The service's name.
- Name string `json:"name,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "IndexKeys") 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. "IndexKeys") 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 *LogService) MarshalJSON() ([]byte, error) {
- type NoMethod LogService
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // LogSink: An object that describes where a log may be written.
- type LogSink struct {
- // Destination: The resource to send log entries to. The supported sink
- // resource types are: + Google Cloud Storage:
- // `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` +
- // Google BigQuery:
- // `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently
- // the Cloud Logging API supports at most one sink for each resource
- // type per log or log service resource.
- Destination string `json:"destination,omitempty"`
-
- // Errors: _Output only._ All active errors found for this sink.
- Errors []*LogError `json:"errors,omitempty"`
-
- // Name: The name of this sink. This is a client-assigned identifier for
- // the resource. This is ignored by UpdateLogSink and
- // UpdateLogServicesSink.
- Name string `json:"name,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Destination") 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. "Destination") 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 *LogSink) MarshalJSON() ([]byte, error) {
- type NoMethod LogSink
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // Status: Represents the RPC error status for Google APIs. See
- // http://go/errormodel for details.
- type Status struct {
- // Code: The status code, which should be an enum value of
- // [google.rpc.Code][].
- Code int64 `json:"code,omitempty"`
-
- // Details: A list of messages that carry the error details. There will
- // be a common set of message types for APIs to use.
- Details []googleapi.RawMessage `json:"details,omitempty"`
-
- // Message: A developer-facing error message, which should be in
- // English. The user-facing error message should be localized and stored
- // in the [google.rpc.Status.details][google.rpc.Status.details] field.
- Message string `json:"message,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Code") to
- // unconditionally include in API requests. By default, fields with
- // empty values are omitted from API requests. However, any non-pointer,
- // non-interface field appearing in ForceSendFields will be sent to the
- // server regardless of whether the field is empty or not. This may be
- // used to include empty fields in Patch requests.
- ForceSendFields []string `json:"-"`
-
- // NullFields is a list of field names (e.g. "Code") to include in API
- // requests with the JSON null value. By default, fields with empty
- // values are omitted from API requests. However, any field with an
- // empty value appearing in NullFields will be sent to the server as
- // null. It is an error if a field in this list has a non-empty value.
- // This may be used to include null fields in Patch requests.
- NullFields []string `json:"-"`
- }
-
- func (s *Status) MarshalJSON() ([]byte, error) {
- type NoMethod Status
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // WriteLogEntriesRequest: The parameters to WriteLogEntries.
- type WriteLogEntriesRequest struct {
- // CommonLabels: Metadata labels that apply to all entries in this
- // request. If one of the log entries contains a (key, value) with the
- // same key that is in `commonLabels`, then the entry's (key, value)
- // overrides the one in `commonLabels`.
- CommonLabels map[string]string `json:"commonLabels,omitempty"`
-
- // Entries: Log entries to insert.
- Entries []*LogEntry `json:"entries,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "CommonLabels") 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. "CommonLabels") 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 *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
- type NoMethod WriteLogEntriesRequest
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
- }
-
- // WriteLogEntriesResponse: Result returned from WriteLogEntries. empty
- type WriteLogEntriesResponse struct {
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
- }
-
- // method id "logging.projects.logServices.list":
-
- type ProjectsLogServicesListCall struct {
- s *Service
- projectsId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists log services associated with log entries ingested for a
- // project.
- func (r *ProjectsLogServicesService) List(projectsId string) *ProjectsLogServicesListCall {
- c := &ProjectsLogServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- return c
- }
-
- // Log sets the optional parameter "log": The name of the log resource
- // whose services are to be listed. log for which to list services. When
- // empty, all services are listed.
- func (c *ProjectsLogServicesListCall) Log(log string) *ProjectsLogServicesListCall {
- c.urlParams_.Set("log", log)
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of `LogService` objects to return in one operation.
- func (c *ProjectsLogServicesListCall) PageSize(pageSize int64) *ProjectsLogServicesListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": An opaque token,
- // returned as `nextPageToken` by a prior `ListLogServices` operation.
- // If `pageToken` is supplied, then the other fields of this request are
- // ignored, and instead the previous `ListLogServices` operation is
- // continued.
- func (c *ProjectsLogServicesListCall) PageToken(pageToken string) *ProjectsLogServicesListCall {
- 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 *ProjectsLogServicesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesListCall {
- 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 *ProjectsLogServicesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesListCall {
- 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 *ProjectsLogServicesListCall) Context(ctx context.Context) *ProjectsLogServicesListCall {
- 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 *ProjectsLogServicesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesListCall) 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, "v1beta3/projects/{projectsId}/logServices")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.list" call.
- // Exactly one of *ListLogServicesResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListLogServicesResponse.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 *ProjectsLogServicesListCall) Do(opts ...googleapi.CallOption) (*ListLogServicesResponse, 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 := &ListLogServicesResponse{
- 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 log services associated with log entries ingested for a project.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logServices.list",
- // "parameterOrder": [
- // "projectsId"
- // ],
- // "parameters": {
- // "log": {
- // "description": "The name of the log resource whose services are to be listed. log for which to list services. When empty, all services are listed.",
- // "location": "query",
- // "type": "string"
- // },
- // "pageSize": {
- // "description": "The maximum number of `LogService` objects to return in one operation.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.",
- // "location": "query",
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `projectName`. The project resource whose services are to be listed.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices",
- // "response": {
- // "$ref": "ListLogServicesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // 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 *ProjectsLogServicesListCall) Pages(ctx context.Context, f func(*ListLogServicesResponse) 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 "logging.projects.logServices.indexes.list":
-
- type ProjectsLogServicesIndexesListCall struct {
- s *Service
- projectsId string
- logServicesId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists log service indexes associated with a log service.
- func (r *ProjectsLogServicesIndexesService) List(projectsId string, logServicesId string) *ProjectsLogServicesIndexesListCall {
- c := &ProjectsLogServicesIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logServicesId = logServicesId
- return c
- }
-
- // Depth sets the optional parameter "depth": A limit to the number of
- // levels of the index hierarchy that are expanded. If `depth` is 0, it
- // defaults to the level specified by the prefix field (the number of
- // slash separators). The default empty prefix implies a `depth` of 1.
- // It is an error for `depth` to be any non-zero value less than the
- // number of components in `indexPrefix`.
- func (c *ProjectsLogServicesIndexesListCall) Depth(depth int64) *ProjectsLogServicesIndexesListCall {
- c.urlParams_.Set("depth", fmt.Sprint(depth))
- return c
- }
-
- // IndexPrefix sets the optional parameter "indexPrefix": Restricts the
- // indexes returned to be those with a specified prefix. The prefix has
- // the form "/label_value/label_value/...", in order corresponding to
- // the [`LogService
- // indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty
- // prefixes must begin with `/` . Example prefixes: + "/myModule/"
- // retrieves App Engine versions associated with `myModule`. The
- // trailing slash terminates the value. + "/myModule" retrieves App
- // Engine modules with names beginning with `myModule`. + "" retrieves
- // all indexes.
- func (c *ProjectsLogServicesIndexesListCall) IndexPrefix(indexPrefix string) *ProjectsLogServicesIndexesListCall {
- c.urlParams_.Set("indexPrefix", indexPrefix)
- return c
- }
-
- // Log sets the optional parameter "log": A log resource like
- // `/projects/project_id/logs/log_name`, identifying the log for which
- // to list service indexes.
- func (c *ProjectsLogServicesIndexesListCall) Log(log string) *ProjectsLogServicesIndexesListCall {
- c.urlParams_.Set("log", log)
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of log service index resources to return in one operation.
- func (c *ProjectsLogServicesIndexesListCall) PageSize(pageSize int64) *ProjectsLogServicesIndexesListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": An opaque token,
- // returned as `nextPageToken` by a prior `ListLogServiceIndexes`
- // operation. If `pageToken` is supplied, then the other fields of this
- // request are ignored, and instead the previous `ListLogServiceIndexes`
- // operation is continued.
- func (c *ProjectsLogServicesIndexesListCall) PageToken(pageToken string) *ProjectsLogServicesIndexesListCall {
- 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 *ProjectsLogServicesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesIndexesListCall {
- 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 *ProjectsLogServicesIndexesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesIndexesListCall {
- 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 *ProjectsLogServicesIndexesListCall) Context(ctx context.Context) *ProjectsLogServicesIndexesListCall {
- 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 *ProjectsLogServicesIndexesListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesIndexesListCall) 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, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logServicesId": c.logServicesId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.indexes.list" call.
- // Exactly one of *ListLogServiceIndexesResponse or error will be
- // non-nil. Any non-2xx status code is an error. Response headers are in
- // either *ListLogServiceIndexesResponse.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 *ProjectsLogServicesIndexesListCall) Do(opts ...googleapi.CallOption) (*ListLogServiceIndexesResponse, 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 := &ListLogServiceIndexesResponse{
- 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 log service indexes associated with a log service.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logServices.indexes.list",
- // "parameterOrder": [
- // "projectsId",
- // "logServicesId"
- // ],
- // "parameters": {
- // "depth": {
- // "description": "A limit to the number of levels of the index hierarchy that are expanded. If `depth` is 0, it defaults to the level specified by the prefix field (the number of slash separators). The default empty prefix implies a `depth` of 1. It is an error for `depth` to be any non-zero value less than the number of components in `indexPrefix`.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "indexPrefix": {
- // "description": "Restricts the indexes returned to be those with a specified prefix. The prefix has the form `\"/label_value/label_value/...\"`, in order corresponding to the [`LogService indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes must begin with `/` . Example prefixes: + `\"/myModule/\"` retrieves App Engine versions associated with `myModule`. The trailing slash terminates the value. + `\"/myModule\"` retrieves App Engine modules with names beginning with `myModule`. + `\"\"` retrieves all indexes.",
- // "location": "query",
- // "type": "string"
- // },
- // "log": {
- // "description": "A log resource like `/projects/project_id/logs/log_name`, identifying the log for which to list service indexes.",
- // "location": "query",
- // "type": "string"
- // },
- // "logServicesId": {
- // "description": "Part of `serviceName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "pageSize": {
- // "description": "The maximum number of log service index resources to return in one operation.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.",
- // "location": "query",
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `serviceName`. A log service resource of the form `/projects/*/logServices/*`. The service indexes of the log service are returned. Example: `\"/projects/myProj/logServices/appengine.googleapis.com\"`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes",
- // "response": {
- // "$ref": "ListLogServiceIndexesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // 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 *ProjectsLogServicesIndexesListCall) Pages(ctx context.Context, f func(*ListLogServiceIndexesResponse) 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 "logging.projects.logServices.sinks.create":
-
- type ProjectsLogServicesSinksCreateCall struct {
- s *Service
- projectsId string
- logServicesId string
- logsink *LogSink
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Create: Creates the specified log service sink resource.
- func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall {
- c := &ProjectsLogServicesSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logServicesId = logServicesId
- c.logsink = logsink
- 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 *ProjectsLogServicesSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksCreateCall {
- 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 *ProjectsLogServicesSinksCreateCall) Context(ctx context.Context) *ProjectsLogServicesSinksCreateCall {
- 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 *ProjectsLogServicesSinksCreateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesSinksCreateCall) 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.logsink)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logServicesId": c.logServicesId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.sinks.create" call.
- // Exactly one of *LogSink or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *LogSink.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 *ProjectsLogServicesSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{
- 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 the specified log service sink resource.",
- // "httpMethod": "POST",
- // "id": "logging.projects.logServices.sinks.create",
- // "parameterOrder": [
- // "projectsId",
- // "logServicesId"
- // ],
- // "parameters": {
- // "logServicesId": {
- // "description": "Part of `serviceName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `serviceName`. The name of the service in which to create a sink.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks",
- // "request": {
- // "$ref": "LogSink"
- // },
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logServices.sinks.delete":
-
- type ProjectsLogServicesSinksDeleteCall struct {
- s *Service
- projectsId string
- logServicesId string
- sinksId string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes the specified log service sink.
- func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall {
- c := &ProjectsLogServicesSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logServicesId = logServicesId
- c.sinksId = sinksId
- 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 *ProjectsLogServicesSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksDeleteCall {
- 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 *ProjectsLogServicesSinksDeleteCall) Context(ctx context.Context) *ProjectsLogServicesSinksDeleteCall {
- 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 *ProjectsLogServicesSinksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesSinksDeleteCall) 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, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logServicesId": c.logServicesId,
- "sinksId": c.sinksId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.sinks.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 *ProjectsLogServicesSinksDeleteCall) 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 the specified log service sink.",
- // "httpMethod": "DELETE",
- // "id": "logging.projects.logServices.sinks.delete",
- // "parameterOrder": [
- // "projectsId",
- // "logServicesId",
- // "sinksId"
- // ],
- // "parameters": {
- // "logServicesId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `sinkName`. The name of the sink to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sinksId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logServices.sinks.get":
-
- type ProjectsLogServicesSinksGetCall struct {
- s *Service
- projectsId string
- logServicesId string
- sinksId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets the specified log service sink resource.
- func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall {
- c := &ProjectsLogServicesSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logServicesId = logServicesId
- c.sinksId = sinksId
- 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 *ProjectsLogServicesSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksGetCall {
- 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 *ProjectsLogServicesSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksGetCall {
- 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 *ProjectsLogServicesSinksGetCall) Context(ctx context.Context) *ProjectsLogServicesSinksGetCall {
- 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 *ProjectsLogServicesSinksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesSinksGetCall) 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, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logServicesId": c.logServicesId,
- "sinksId": c.sinksId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.sinks.get" call.
- // Exactly one of *LogSink or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *LogSink.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 *ProjectsLogServicesSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{
- 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 specified log service sink resource.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logServices.sinks.get",
- // "parameterOrder": [
- // "projectsId",
- // "logServicesId",
- // "sinksId"
- // ],
- // "parameters": {
- // "logServicesId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `sinkName`. The name of the sink to return.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sinksId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logServices.sinks.list":
-
- type ProjectsLogServicesSinksListCall struct {
- s *Service
- projectsId string
- logServicesId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists log service sinks associated with the specified service.
- func (r *ProjectsLogServicesSinksService) List(projectsId string, logServicesId string) *ProjectsLogServicesSinksListCall {
- c := &ProjectsLogServicesSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logServicesId = logServicesId
- 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 *ProjectsLogServicesSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksListCall {
- 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 *ProjectsLogServicesSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksListCall {
- 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 *ProjectsLogServicesSinksListCall) Context(ctx context.Context) *ProjectsLogServicesSinksListCall {
- 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 *ProjectsLogServicesSinksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesSinksListCall) 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, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logServicesId": c.logServicesId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.sinks.list" call.
- // Exactly one of *ListLogServiceSinksResponse or error will be non-nil.
- // Any non-2xx status code is an error. Response headers are in either
- // *ListLogServiceSinksResponse.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 *ProjectsLogServicesSinksListCall) Do(opts ...googleapi.CallOption) (*ListLogServiceSinksResponse, 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 := &ListLogServiceSinksResponse{
- 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 log service sinks associated with the specified service.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logServices.sinks.list",
- // "parameterOrder": [
- // "projectsId",
- // "logServicesId"
- // ],
- // "parameters": {
- // "logServicesId": {
- // "description": "Part of `serviceName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `serviceName`. The name of the service for which to list sinks.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks",
- // "response": {
- // "$ref": "ListLogServiceSinksResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logServices.sinks.update":
-
- type ProjectsLogServicesSinksUpdateCall struct {
- s *Service
- projectsId string
- logServicesId string
- sinksId string
- logsink *LogSink
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Update: Creates or update the specified log service sink resource.
- func (r *ProjectsLogServicesSinksService) Update(projectsId string, logServicesId string, sinksId string, logsink *LogSink) *ProjectsLogServicesSinksUpdateCall {
- c := &ProjectsLogServicesSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logServicesId = logServicesId
- c.sinksId = sinksId
- c.logsink = logsink
- 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 *ProjectsLogServicesSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksUpdateCall {
- 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 *ProjectsLogServicesSinksUpdateCall) Context(ctx context.Context) *ProjectsLogServicesSinksUpdateCall {
- 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 *ProjectsLogServicesSinksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogServicesSinksUpdateCall) 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.logsink)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logServicesId": c.logServicesId,
- "sinksId": c.sinksId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logServices.sinks.update" call.
- // Exactly one of *LogSink or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *LogSink.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 *ProjectsLogServicesSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{
- 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 or update the specified log service sink resource.",
- // "httpMethod": "PUT",
- // "id": "logging.projects.logServices.sinks.update",
- // "parameterOrder": [
- // "projectsId",
- // "logServicesId",
- // "sinksId"
- // ],
- // "parameters": {
- // "logServicesId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `sinkName`. The name of the sink to update.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sinksId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
- // "request": {
- // "$ref": "LogSink"
- // },
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.delete":
-
- type ProjectsLogsDeleteCall struct {
- s *Service
- projectsId string
- logsId string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes the specified log resource and all log entries
- // contained in it.
- func (r *ProjectsLogsService) Delete(projectsId string, logsId string) *ProjectsLogsDeleteCall {
- c := &ProjectsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- 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 *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall {
- 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 *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall {
- 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 *ProjectsLogsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsDeleteCall) 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, "v1beta3/projects/{projectsId}/logs/{logsId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.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 *ProjectsLogsDeleteCall) 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 the specified log resource and all log entries contained in it.",
- // "httpMethod": "DELETE",
- // "id": "logging.projects.logs.delete",
- // "parameterOrder": [
- // "projectsId",
- // "logsId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `logName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `logName`. The log resource to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.list":
-
- type ProjectsLogsListCall struct {
- s *Service
- projectsId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists log resources belonging to the specified project.
- func (r *ProjectsLogsService) List(projectsId string) *ProjectsLogsListCall {
- c := &ProjectsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- return c
- }
-
- // PageSize sets the optional parameter "pageSize": The maximum number
- // of results to return.
- func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall {
- c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
- return c
- }
-
- // PageToken sets the optional parameter "pageToken": An opaque token,
- // returned as `nextPageToken` by a prior `ListLogs` operation. If
- // `pageToken` is supplied, then the other fields of this request are
- // ignored, and instead the previous `ListLogs` operation is continued.
- func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
- }
-
- // ServiceIndexPrefix sets the optional parameter "serviceIndexPrefix":
- // A log service index prefix for which to list logs. Only logs
- // containing entries whose metadata that includes these label values
- // (associated with index keys) are returned. The prefix is a slash
- // separated list of values, and need not specify all index labels. An
- // empty index (or a single slash) matches all log service indexes.
- func (c *ProjectsLogsListCall) ServiceIndexPrefix(serviceIndexPrefix string) *ProjectsLogsListCall {
- c.urlParams_.Set("serviceIndexPrefix", serviceIndexPrefix)
- return c
- }
-
- // ServiceName sets the optional parameter "serviceName": A service name
- // for which to list logs. Only logs containing entries whose metadata
- // includes this service name are returned. If `serviceName` and
- // `serviceIndexPrefix` are both empty, then all log names are returned.
- // To list all log names, regardless of service, leave both the
- // `serviceName` and `serviceIndexPrefix` empty. To list log names
- // containing entries with a particular service name (or explicitly
- // empty service name) set `serviceName` to the desired value and
- // `serviceIndexPrefix` to "/".
- func (c *ProjectsLogsListCall) ServiceName(serviceName string) *ProjectsLogsListCall {
- c.urlParams_.Set("serviceName", serviceName)
- 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 *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall {
- 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 *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall {
- 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 *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall {
- 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 *ProjectsLogsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsListCall) 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, "v1beta3/projects/{projectsId}/logs")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.list" call.
- // Exactly one of *ListLogsResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListLogsResponse.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 *ProjectsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, 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 := &ListLogsResponse{
- 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 log resources belonging to the specified project.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logs.list",
- // "parameterOrder": [
- // "projectsId"
- // ],
- // "parameters": {
- // "pageSize": {
- // "description": "The maximum number of results to return.",
- // "format": "int32",
- // "location": "query",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.",
- // "location": "query",
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `projectName`. The project name for which to list the log resources.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "serviceIndexPrefix": {
- // "description": "A log service index prefix for which to list logs. Only logs containing entries whose metadata that includes these label values (associated with index keys) are returned. The prefix is a slash separated list of values, and need not specify all index labels. An empty index (or a single slash) matches all log service indexes.",
- // "location": "query",
- // "type": "string"
- // },
- // "serviceName": {
- // "description": "A service name for which to list logs. Only logs containing entries whose metadata includes this service name are returned. If `serviceName` and `serviceIndexPrefix` are both empty, then all log names are returned. To list all log names, regardless of service, leave both the `serviceName` and `serviceIndexPrefix` empty. To list log names containing entries with a particular service name (or explicitly empty service name) set `serviceName` to the desired value and `serviceIndexPrefix` to `\"/\"`.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs",
- // "response": {
- // "$ref": "ListLogsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // 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 *ProjectsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) 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 "logging.projects.logs.entries.write":
-
- type ProjectsLogsEntriesWriteCall struct {
- s *Service
- projectsId string
- logsId string
- writelogentriesrequest *WriteLogEntriesRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Write: Creates one or more log entries in a log. You must supply a
- // list of `LogEntry` objects, named `entries`. Each `LogEntry` object
- // must contain a payload object and a `LogEntryMetadata` object that
- // describes the entry. You must fill in all the fields of the entry,
- // metadata, and payload. You can also supply a map, `commonLabels`,
- // that supplies default (key, value) data for the
- // `entries[].metadata.labels` maps, saving you the trouble of creating
- // identical copies for each entry.
- func (r *ProjectsLogsEntriesService) Write(projectsId string, logsId string, writelogentriesrequest *WriteLogEntriesRequest) *ProjectsLogsEntriesWriteCall {
- c := &ProjectsLogsEntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- c.writelogentriesrequest = writelogentriesrequest
- 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 *ProjectsLogsEntriesWriteCall) Fields(s ...googleapi.Field) *ProjectsLogsEntriesWriteCall {
- 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 *ProjectsLogsEntriesWriteCall) Context(ctx context.Context) *ProjectsLogsEntriesWriteCall {
- 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 *ProjectsLogsEntriesWriteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsEntriesWriteCall) 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.writelogentriesrequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.entries.write" call.
- // Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *WriteLogEntriesResponse.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 *ProjectsLogsEntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, 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 := &WriteLogEntriesResponse{
- 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 one or more log entries in a log. You must supply a list of `LogEntry` objects, named `entries`. Each `LogEntry` object must contain a payload object and a `LogEntryMetadata` object that describes the entry. You must fill in all the fields of the entry, metadata, and payload. You can also supply a map, `commonLabels`, that supplies default (key, value) data for the `entries[].metadata.labels` maps, saving you the trouble of creating identical copies for each entry.",
- // "httpMethod": "POST",
- // "id": "logging.projects.logs.entries.write",
- // "parameterOrder": [
- // "projectsId",
- // "logsId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `logName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `logName`. The name of the log resource into which to insert the log entries.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write",
- // "request": {
- // "$ref": "WriteLogEntriesRequest"
- // },
- // "response": {
- // "$ref": "WriteLogEntriesResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.sinks.create":
-
- type ProjectsLogsSinksCreateCall struct {
- s *Service
- projectsId string
- logsId string
- logsink *LogSink
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Create: Creates the specified log sink resource.
- func (r *ProjectsLogsSinksService) Create(projectsId string, logsId string, logsink *LogSink) *ProjectsLogsSinksCreateCall {
- c := &ProjectsLogsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- c.logsink = logsink
- 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 *ProjectsLogsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksCreateCall {
- 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 *ProjectsLogsSinksCreateCall) Context(ctx context.Context) *ProjectsLogsSinksCreateCall {
- 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 *ProjectsLogsSinksCreateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsSinksCreateCall) 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.logsink)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.sinks.create" call.
- // Exactly one of *LogSink or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *LogSink.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 *ProjectsLogsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{
- 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 the specified log sink resource.",
- // "httpMethod": "POST",
- // "id": "logging.projects.logs.sinks.create",
- // "parameterOrder": [
- // "projectsId",
- // "logsId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `logName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `logName`. The log in which to create a sink resource.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks",
- // "request": {
- // "$ref": "LogSink"
- // },
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.sinks.delete":
-
- type ProjectsLogsSinksDeleteCall struct {
- s *Service
- projectsId string
- logsId string
- sinksId string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Delete: Deletes the specified log sink resource.
- func (r *ProjectsLogsSinksService) Delete(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksDeleteCall {
- c := &ProjectsLogsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- c.sinksId = sinksId
- 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 *ProjectsLogsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksDeleteCall {
- 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 *ProjectsLogsSinksDeleteCall) Context(ctx context.Context) *ProjectsLogsSinksDeleteCall {
- 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 *ProjectsLogsSinksDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsSinksDeleteCall) 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, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- "sinksId": c.sinksId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.sinks.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 *ProjectsLogsSinksDeleteCall) 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 the specified log sink resource.",
- // "httpMethod": "DELETE",
- // "id": "logging.projects.logs.sinks.delete",
- // "parameterOrder": [
- // "projectsId",
- // "logsId",
- // "sinksId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `sinkName`. The name of the sink to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sinksId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}",
- // "response": {
- // "$ref": "Empty"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.sinks.get":
-
- type ProjectsLogsSinksGetCall struct {
- s *Service
- projectsId string
- logsId string
- sinksId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // Get: Gets the specified log sink resource.
- func (r *ProjectsLogsSinksService) Get(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksGetCall {
- c := &ProjectsLogsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- c.sinksId = sinksId
- 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 *ProjectsLogsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksGetCall {
- 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 *ProjectsLogsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksGetCall {
- 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 *ProjectsLogsSinksGetCall) Context(ctx context.Context) *ProjectsLogsSinksGetCall {
- 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 *ProjectsLogsSinksGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsSinksGetCall) 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, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- "sinksId": c.sinksId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.sinks.get" call.
- // Exactly one of *LogSink or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *LogSink.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 *ProjectsLogsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{
- 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 specified log sink resource.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logs.sinks.get",
- // "parameterOrder": [
- // "projectsId",
- // "logsId",
- // "sinksId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `sinkName`. The name of the sink resource to return.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sinksId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}",
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.sinks.list":
-
- type ProjectsLogsSinksListCall struct {
- s *Service
- projectsId string
- logsId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
- }
-
- // List: Lists log sinks associated with the specified log.
- func (r *ProjectsLogsSinksService) List(projectsId string, logsId string) *ProjectsLogsSinksListCall {
- c := &ProjectsLogsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- 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 *ProjectsLogsSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksListCall {
- 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 *ProjectsLogsSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksListCall {
- 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 *ProjectsLogsSinksListCall) Context(ctx context.Context) *ProjectsLogsSinksListCall {
- 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 *ProjectsLogsSinksListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsSinksListCall) 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, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.sinks.list" call.
- // Exactly one of *ListLogSinksResponse or error will be non-nil. Any
- // non-2xx status code is an error. Response headers are in either
- // *ListLogSinksResponse.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 *ProjectsLogsSinksListCall) Do(opts ...googleapi.CallOption) (*ListLogSinksResponse, 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 := &ListLogSinksResponse{
- 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 log sinks associated with the specified log.",
- // "httpMethod": "GET",
- // "id": "logging.projects.logs.sinks.list",
- // "parameterOrder": [
- // "projectsId",
- // "logsId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `logName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `logName`. The log for which to list sinks.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks",
- // "response": {
- // "$ref": "ListLogSinksResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
-
- // method id "logging.projects.logs.sinks.update":
-
- type ProjectsLogsSinksUpdateCall struct {
- s *Service
- projectsId string
- logsId string
- sinksId string
- logsink *LogSink
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
- }
-
- // Update: Creates or updates the specified log sink resource.
- func (r *ProjectsLogsSinksService) Update(projectsId string, logsId string, sinksId string, logsink *LogSink) *ProjectsLogsSinksUpdateCall {
- c := &ProjectsLogsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectsId = projectsId
- c.logsId = logsId
- c.sinksId = sinksId
- c.logsink = logsink
- 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 *ProjectsLogsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksUpdateCall {
- 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 *ProjectsLogsSinksUpdateCall) Context(ctx context.Context) *ProjectsLogsSinksUpdateCall {
- 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 *ProjectsLogsSinksUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
- }
-
- func (c *ProjectsLogsSinksUpdateCall) 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.logsink)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectsId": c.projectsId,
- "logsId": c.logsId,
- "sinksId": c.sinksId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
- }
-
- // Do executes the "logging.projects.logs.sinks.update" call.
- // Exactly one of *LogSink or error will be non-nil. Any non-2xx status
- // code is an error. Response headers are in either
- // *LogSink.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 *ProjectsLogsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, 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 := &LogSink{
- 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 or updates the specified log sink resource.",
- // "httpMethod": "PUT",
- // "id": "logging.projects.logs.sinks.update",
- // "parameterOrder": [
- // "projectsId",
- // "logsId",
- // "sinksId"
- // ],
- // "parameters": {
- // "logsId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projectsId": {
- // "description": "Part of `sinkName`. The name of the sink to update.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sinksId": {
- // "description": "Part of `sinkName`. See documentation of `projectsId`.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // }
- // },
- // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}",
- // "request": {
- // "$ref": "LogSink"
- // },
- // "response": {
- // "$ref": "LogSink"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform"
- // ]
- // }
-
- }
|