storage-gen.go 127 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109
  1. // Package storage provides access to the Cloud Storage JSON API.
  2. //
  3. // See https://developers.google.com/storage/docs/json_api/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/storage/v1beta1"
  8. // ...
  9. // storageService, err := storage.New(oauthHttpClient)
  10. package storage // import "google.golang.org/api/storage/v1beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "storage:v1beta1"
  41. const apiName = "storage"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://www.googleapis.com/storage/v1beta1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your data and permissions in Google Cloud Storage
  47. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  48. // View your data in Google Cloud Storage
  49. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  50. // Manage your data in Google Cloud Storage
  51. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  52. )
  53. func New(client *http.Client) (*Service, error) {
  54. if client == nil {
  55. return nil, errors.New("client is nil")
  56. }
  57. s := &Service{client: client, BasePath: basePath}
  58. s.BucketAccessControls = NewBucketAccessControlsService(s)
  59. s.Buckets = NewBucketsService(s)
  60. s.ObjectAccessControls = NewObjectAccessControlsService(s)
  61. s.Objects = NewObjectsService(s)
  62. return s, nil
  63. }
  64. type Service struct {
  65. client *http.Client
  66. BasePath string // API endpoint base URL
  67. UserAgent string // optional additional User-Agent fragment
  68. BucketAccessControls *BucketAccessControlsService
  69. Buckets *BucketsService
  70. ObjectAccessControls *ObjectAccessControlsService
  71. Objects *ObjectsService
  72. }
  73. func (s *Service) userAgent() string {
  74. if s.UserAgent == "" {
  75. return googleapi.UserAgent
  76. }
  77. return googleapi.UserAgent + " " + s.UserAgent
  78. }
  79. func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
  80. rs := &BucketAccessControlsService{s: s}
  81. return rs
  82. }
  83. type BucketAccessControlsService struct {
  84. s *Service
  85. }
  86. func NewBucketsService(s *Service) *BucketsService {
  87. rs := &BucketsService{s: s}
  88. return rs
  89. }
  90. type BucketsService struct {
  91. s *Service
  92. }
  93. func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
  94. rs := &ObjectAccessControlsService{s: s}
  95. return rs
  96. }
  97. type ObjectAccessControlsService struct {
  98. s *Service
  99. }
  100. func NewObjectsService(s *Service) *ObjectsService {
  101. rs := &ObjectsService{s: s}
  102. return rs
  103. }
  104. type ObjectsService struct {
  105. s *Service
  106. }
  107. // Bucket: A bucket.
  108. type Bucket struct {
  109. // Acl: Access controls on the bucket.
  110. Acl []*BucketAccessControl `json:"acl,omitempty"`
  111. // DefaultObjectAcl: Default access controls to apply to new objects
  112. // when no ACL is provided.
  113. DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
  114. // Id: The name of the bucket.
  115. Id string `json:"id,omitempty"`
  116. // Kind: The kind of item this is. For buckets, this is always
  117. // storage#bucket.
  118. Kind string `json:"kind,omitempty"`
  119. // Location: The location of the bucket. Object data for objects in the
  120. // bucket resides in physical storage in this location. Can be US or EU.
  121. // Defaults to US.
  122. Location string `json:"location,omitempty"`
  123. // Owner: The owner of the bucket. This will always be the project
  124. // team's owner group.
  125. Owner *BucketOwner `json:"owner,omitempty"`
  126. // ProjectId: The project the bucket belongs to.
  127. ProjectId uint64 `json:"projectId,omitempty,string"`
  128. // SelfLink: The URI of this bucket.
  129. SelfLink string `json:"selfLink,omitempty"`
  130. // TimeCreated: Creation time of the bucket in RFC 3339 format.
  131. TimeCreated string `json:"timeCreated,omitempty"`
  132. // Website: The bucket's website configuration.
  133. Website *BucketWebsite `json:"website,omitempty"`
  134. // ServerResponse contains the HTTP response code and headers from the
  135. // server.
  136. googleapi.ServerResponse `json:"-"`
  137. // ForceSendFields is a list of field names (e.g. "Acl") to
  138. // unconditionally include in API requests. By default, fields with
  139. // empty values are omitted from API requests. However, any non-pointer,
  140. // non-interface field appearing in ForceSendFields will be sent to the
  141. // server regardless of whether the field is empty or not. This may be
  142. // used to include empty fields in Patch requests.
  143. ForceSendFields []string `json:"-"`
  144. }
  145. func (s *Bucket) MarshalJSON() ([]byte, error) {
  146. type noMethod Bucket
  147. raw := noMethod(*s)
  148. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  149. }
  150. // BucketOwner: The owner of the bucket. This will always be the project
  151. // team's owner group.
  152. type BucketOwner struct {
  153. // Entity: The entity, in the form group-groupId.
  154. Entity string `json:"entity,omitempty"`
  155. // EntityId: The ID for the entity.
  156. EntityId string `json:"entityId,omitempty"`
  157. // ForceSendFields is a list of field names (e.g. "Entity") to
  158. // unconditionally include in API requests. By default, fields with
  159. // empty values are omitted from API requests. However, any non-pointer,
  160. // non-interface field appearing in ForceSendFields will be sent to the
  161. // server regardless of whether the field is empty or not. This may be
  162. // used to include empty fields in Patch requests.
  163. ForceSendFields []string `json:"-"`
  164. }
  165. func (s *BucketOwner) MarshalJSON() ([]byte, error) {
  166. type noMethod BucketOwner
  167. raw := noMethod(*s)
  168. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  169. }
  170. // BucketWebsite: The bucket's website configuration.
  171. type BucketWebsite struct {
  172. // MainPageSuffix: Behaves as the bucket's directory index where missing
  173. // objects are treated as potential directories.
  174. MainPageSuffix string `json:"mainPageSuffix,omitempty"`
  175. // NotFoundPage: The custom object to return when a requested resource
  176. // is not found.
  177. NotFoundPage string `json:"notFoundPage,omitempty"`
  178. // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
  179. // unconditionally include in API requests. By default, fields with
  180. // empty values are omitted from API requests. However, any non-pointer,
  181. // non-interface field appearing in ForceSendFields will be sent to the
  182. // server regardless of whether the field is empty or not. This may be
  183. // used to include empty fields in Patch requests.
  184. ForceSendFields []string `json:"-"`
  185. }
  186. func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
  187. type noMethod BucketWebsite
  188. raw := noMethod(*s)
  189. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  190. }
  191. // BucketAccessControl: An access-control entry.
  192. type BucketAccessControl struct {
  193. // Bucket: The name of the bucket.
  194. Bucket string `json:"bucket,omitempty"`
  195. // Domain: The domain associated with the entity, if any.
  196. Domain string `json:"domain,omitempty"`
  197. // Email: The email address associated with the entity, if any.
  198. Email string `json:"email,omitempty"`
  199. // Entity: The entity holding the permission, in one of the following
  200. // forms:
  201. // - user-userId
  202. // - user-email
  203. // - group-groupId
  204. // - group-email
  205. // - domain-domain
  206. // - allUsers
  207. // - allAuthenticatedUsers Examples:
  208. // - The user liz@example.com would be user-liz@example.com.
  209. // - The group example@googlegroups.com would be
  210. // group-example@googlegroups.com.
  211. // - To refer to all members of the Google Apps for Business domain
  212. // example.com, the entity would be domain-example.com.
  213. Entity string `json:"entity,omitempty"`
  214. // EntityId: The ID for the entity, if any.
  215. EntityId string `json:"entityId,omitempty"`
  216. // Id: The ID of the access-control entry.
  217. Id string `json:"id,omitempty"`
  218. // Kind: The kind of item this is. For bucket access control entries,
  219. // this is always storage#bucketAccessControl.
  220. Kind string `json:"kind,omitempty"`
  221. // Role: The access permission for the entity. Can be READER, WRITER, or
  222. // OWNER.
  223. Role string `json:"role,omitempty"`
  224. // SelfLink: The link to this access-control entry.
  225. SelfLink string `json:"selfLink,omitempty"`
  226. // ServerResponse contains the HTTP response code and headers from the
  227. // server.
  228. googleapi.ServerResponse `json:"-"`
  229. // ForceSendFields is a list of field names (e.g. "Bucket") to
  230. // unconditionally include in API requests. By default, fields with
  231. // empty values are omitted from API requests. However, any non-pointer,
  232. // non-interface field appearing in ForceSendFields will be sent to the
  233. // server regardless of whether the field is empty or not. This may be
  234. // used to include empty fields in Patch requests.
  235. ForceSendFields []string `json:"-"`
  236. }
  237. func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
  238. type noMethod BucketAccessControl
  239. raw := noMethod(*s)
  240. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  241. }
  242. // BucketAccessControls: An access-control list.
  243. type BucketAccessControls struct {
  244. // Items: The list of items.
  245. Items []*BucketAccessControl `json:"items,omitempty"`
  246. // Kind: The kind of item this is. For lists of bucket access control
  247. // entries, this is always storage#bucketAccessControls.
  248. Kind string `json:"kind,omitempty"`
  249. // ServerResponse contains the HTTP response code and headers from the
  250. // server.
  251. googleapi.ServerResponse `json:"-"`
  252. // ForceSendFields is a list of field names (e.g. "Items") to
  253. // unconditionally include in API requests. By default, fields with
  254. // empty values are omitted from API requests. However, any non-pointer,
  255. // non-interface field appearing in ForceSendFields will be sent to the
  256. // server regardless of whether the field is empty or not. This may be
  257. // used to include empty fields in Patch requests.
  258. ForceSendFields []string `json:"-"`
  259. }
  260. func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
  261. type noMethod BucketAccessControls
  262. raw := noMethod(*s)
  263. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  264. }
  265. // Buckets: A list of buckets.
  266. type Buckets struct {
  267. // Items: The list of items.
  268. Items []*Bucket `json:"items,omitempty"`
  269. // Kind: The kind of item this is. For lists of buckets, this is always
  270. // storage#buckets.
  271. Kind string `json:"kind,omitempty"`
  272. // NextPageToken: The continuation token, used to page through large
  273. // result sets. Provide this value in a subsequent request to return the
  274. // next page of results.
  275. NextPageToken string `json:"nextPageToken,omitempty"`
  276. // ServerResponse contains the HTTP response code and headers from the
  277. // server.
  278. googleapi.ServerResponse `json:"-"`
  279. // ForceSendFields is a list of field names (e.g. "Items") to
  280. // unconditionally include in API requests. By default, fields with
  281. // empty values are omitted from API requests. However, any non-pointer,
  282. // non-interface field appearing in ForceSendFields will be sent to the
  283. // server regardless of whether the field is empty or not. This may be
  284. // used to include empty fields in Patch requests.
  285. ForceSendFields []string `json:"-"`
  286. }
  287. func (s *Buckets) MarshalJSON() ([]byte, error) {
  288. type noMethod Buckets
  289. raw := noMethod(*s)
  290. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  291. }
  292. // Object: An object.
  293. type Object struct {
  294. // Acl: Access controls on the object.
  295. Acl []*ObjectAccessControl `json:"acl,omitempty"`
  296. // Bucket: The bucket containing this object.
  297. Bucket string `json:"bucket,omitempty"`
  298. // CacheControl: Cache-Control directive for the object data.
  299. CacheControl string `json:"cacheControl,omitempty"`
  300. // ContentDisposition: Content-Disposition of the object data.
  301. ContentDisposition string `json:"contentDisposition,omitempty"`
  302. // ContentEncoding: Content-Encoding of the object data.
  303. ContentEncoding string `json:"contentEncoding,omitempty"`
  304. // ContentLanguage: Content-Language of the object data.
  305. ContentLanguage string `json:"contentLanguage,omitempty"`
  306. // Id: The ID of the object.
  307. Id string `json:"id,omitempty"`
  308. // Kind: The kind of item this is. For objects, this is always
  309. // storage#object.
  310. Kind string `json:"kind,omitempty"`
  311. // Media: Object media data. Provided on your behalf when uploading raw
  312. // media or multipart/related with an auxiliary media part.
  313. Media *ObjectMedia `json:"media,omitempty"`
  314. // Metadata: User-provided metadata, in key/value pairs.
  315. Metadata map[string]string `json:"metadata,omitempty"`
  316. // Name: The name of this object. Required if not specified by URL
  317. // parameter.
  318. Name string `json:"name,omitempty"`
  319. // Owner: The owner of the object. This will always be the uploader of
  320. // the object.
  321. Owner *ObjectOwner `json:"owner,omitempty"`
  322. // SelfLink: The link to this object.
  323. SelfLink string `json:"selfLink,omitempty"`
  324. // ServerResponse contains the HTTP response code and headers from the
  325. // server.
  326. googleapi.ServerResponse `json:"-"`
  327. // ForceSendFields is a list of field names (e.g. "Acl") to
  328. // unconditionally include in API requests. By default, fields with
  329. // empty values are omitted from API requests. However, any non-pointer,
  330. // non-interface field appearing in ForceSendFields will be sent to the
  331. // server regardless of whether the field is empty or not. This may be
  332. // used to include empty fields in Patch requests.
  333. ForceSendFields []string `json:"-"`
  334. }
  335. func (s *Object) MarshalJSON() ([]byte, error) {
  336. type noMethod Object
  337. raw := noMethod(*s)
  338. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  339. }
  340. // ObjectMedia: Object media data. Provided on your behalf when
  341. // uploading raw media or multipart/related with an auxiliary media
  342. // part.
  343. type ObjectMedia struct {
  344. // Algorithm: Hash algorithm used. Currently only MD5 is supported.
  345. // Required if a hash is provided.
  346. Algorithm string `json:"algorithm,omitempty"`
  347. // ContentType: Content-Type of the object data.
  348. ContentType string `json:"contentType,omitempty"`
  349. // Data: URL-safe Base64-encoded data. This property can be used to
  350. // insert objects under 64KB in size, and will only be returned in
  351. // response to the get method for objects so created. When this resource
  352. // is returned in response to the list method, this property is omitted.
  353. Data string `json:"data,omitempty"`
  354. // Hash: Hash of the data. Required if a hash algorithm is provided.
  355. Hash string `json:"hash,omitempty"`
  356. // Length: Content-Length of the data in bytes.
  357. Length uint64 `json:"length,omitempty,string"`
  358. // Link: Media download link.
  359. Link string `json:"link,omitempty"`
  360. // TimeCreated: Creation time of the data in RFC 3339 format.
  361. TimeCreated string `json:"timeCreated,omitempty"`
  362. // ForceSendFields is a list of field names (e.g. "Algorithm") to
  363. // unconditionally include in API requests. By default, fields with
  364. // empty values are omitted from API requests. However, any non-pointer,
  365. // non-interface field appearing in ForceSendFields will be sent to the
  366. // server regardless of whether the field is empty or not. This may be
  367. // used to include empty fields in Patch requests.
  368. ForceSendFields []string `json:"-"`
  369. }
  370. func (s *ObjectMedia) MarshalJSON() ([]byte, error) {
  371. type noMethod ObjectMedia
  372. raw := noMethod(*s)
  373. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  374. }
  375. // ObjectOwner: The owner of the object. This will always be the
  376. // uploader of the object.
  377. type ObjectOwner struct {
  378. // Entity: The entity, in the form user-userId.
  379. Entity string `json:"entity,omitempty"`
  380. // EntityId: The ID for the entity.
  381. EntityId string `json:"entityId,omitempty"`
  382. // ForceSendFields is a list of field names (e.g. "Entity") to
  383. // unconditionally include in API requests. By default, fields with
  384. // empty values are omitted from API requests. However, any non-pointer,
  385. // non-interface field appearing in ForceSendFields will be sent to the
  386. // server regardless of whether the field is empty or not. This may be
  387. // used to include empty fields in Patch requests.
  388. ForceSendFields []string `json:"-"`
  389. }
  390. func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
  391. type noMethod ObjectOwner
  392. raw := noMethod(*s)
  393. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  394. }
  395. // ObjectAccessControl: An access-control entry.
  396. type ObjectAccessControl struct {
  397. // Bucket: The name of the bucket.
  398. Bucket string `json:"bucket,omitempty"`
  399. // Domain: The domain associated with the entity, if any.
  400. Domain string `json:"domain,omitempty"`
  401. // Email: The email address associated with the entity, if any.
  402. Email string `json:"email,omitempty"`
  403. // Entity: The entity holding the permission, in one of the following
  404. // forms:
  405. // - user-userId
  406. // - user-email
  407. // - group-groupId
  408. // - group-email
  409. // - domain-domain
  410. // - allUsers
  411. // - allAuthenticatedUsers Examples:
  412. // - The user liz@example.com would be user-liz@example.com.
  413. // - The group example@googlegroups.com would be
  414. // group-example@googlegroups.com.
  415. // - To refer to all members of the Google Apps for Business domain
  416. // example.com, the entity would be domain-example.com.
  417. Entity string `json:"entity,omitempty"`
  418. // EntityId: The ID for the entity, if any.
  419. EntityId string `json:"entityId,omitempty"`
  420. // Id: The ID of the access-control entry.
  421. Id string `json:"id,omitempty"`
  422. // Kind: The kind of item this is. For object access control entries,
  423. // this is always storage#objectAccessControl.
  424. Kind string `json:"kind,omitempty"`
  425. // Object: The name of the object.
  426. Object string `json:"object,omitempty"`
  427. // Role: The access permission for the entity. Can be READER or OWNER.
  428. Role string `json:"role,omitempty"`
  429. // SelfLink: The link to this access-control entry.
  430. SelfLink string `json:"selfLink,omitempty"`
  431. // ServerResponse contains the HTTP response code and headers from the
  432. // server.
  433. googleapi.ServerResponse `json:"-"`
  434. // ForceSendFields is a list of field names (e.g. "Bucket") to
  435. // unconditionally include in API requests. By default, fields with
  436. // empty values are omitted from API requests. However, any non-pointer,
  437. // non-interface field appearing in ForceSendFields will be sent to the
  438. // server regardless of whether the field is empty or not. This may be
  439. // used to include empty fields in Patch requests.
  440. ForceSendFields []string `json:"-"`
  441. }
  442. func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
  443. type noMethod ObjectAccessControl
  444. raw := noMethod(*s)
  445. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  446. }
  447. // ObjectAccessControls: An access-control list.
  448. type ObjectAccessControls struct {
  449. // Items: The list of items.
  450. Items []*ObjectAccessControl `json:"items,omitempty"`
  451. // Kind: The kind of item this is. For lists of object access control
  452. // entries, this is always storage#objectAccessControls.
  453. Kind string `json:"kind,omitempty"`
  454. // ServerResponse contains the HTTP response code and headers from the
  455. // server.
  456. googleapi.ServerResponse `json:"-"`
  457. // ForceSendFields is a list of field names (e.g. "Items") to
  458. // unconditionally include in API requests. By default, fields with
  459. // empty values are omitted from API requests. However, any non-pointer,
  460. // non-interface field appearing in ForceSendFields will be sent to the
  461. // server regardless of whether the field is empty or not. This may be
  462. // used to include empty fields in Patch requests.
  463. ForceSendFields []string `json:"-"`
  464. }
  465. func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
  466. type noMethod ObjectAccessControls
  467. raw := noMethod(*s)
  468. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  469. }
  470. // Objects: A list of objects.
  471. type Objects struct {
  472. // Items: The list of items.
  473. Items []*Object `json:"items,omitempty"`
  474. // Kind: The kind of item this is. For lists of objects, this is always
  475. // storage#objects.
  476. Kind string `json:"kind,omitempty"`
  477. // NextPageToken: The continuation token, used to page through large
  478. // result sets. Provide this value in a subsequent request to return the
  479. // next page of results.
  480. NextPageToken string `json:"nextPageToken,omitempty"`
  481. // Prefixes: The list of prefixes of objects matching-but-not-listed up
  482. // to and including the requested delimiter.
  483. Prefixes []string `json:"prefixes,omitempty"`
  484. // ServerResponse contains the HTTP response code and headers from the
  485. // server.
  486. googleapi.ServerResponse `json:"-"`
  487. // ForceSendFields is a list of field names (e.g. "Items") to
  488. // unconditionally include in API requests. By default, fields with
  489. // empty values are omitted from API requests. However, any non-pointer,
  490. // non-interface field appearing in ForceSendFields will be sent to the
  491. // server regardless of whether the field is empty or not. This may be
  492. // used to include empty fields in Patch requests.
  493. ForceSendFields []string `json:"-"`
  494. }
  495. func (s *Objects) MarshalJSON() ([]byte, error) {
  496. type noMethod Objects
  497. raw := noMethod(*s)
  498. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  499. }
  500. // method id "storage.bucketAccessControls.delete":
  501. type BucketAccessControlsDeleteCall struct {
  502. s *Service
  503. bucket string
  504. entity string
  505. urlParams_ gensupport.URLParams
  506. ctx_ context.Context
  507. }
  508. // Delete: Deletes the ACL entry for the specified entity on the
  509. // specified bucket.
  510. func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
  511. c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  512. c.bucket = bucket
  513. c.entity = entity
  514. return c
  515. }
  516. // Fields allows partial responses to be retrieved. See
  517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  518. // for more information.
  519. func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
  520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  521. return c
  522. }
  523. // Context sets the context to be used in this call's Do method. Any
  524. // pending HTTP request will be aborted if the provided context is
  525. // canceled.
  526. func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
  527. c.ctx_ = ctx
  528. return c
  529. }
  530. func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  531. var body io.Reader = nil
  532. c.urlParams_.Set("alt", alt)
  533. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  534. urls += "?" + c.urlParams_.Encode()
  535. req, _ := http.NewRequest("DELETE", urls, body)
  536. googleapi.Expand(req.URL, map[string]string{
  537. "bucket": c.bucket,
  538. "entity": c.entity,
  539. })
  540. req.Header.Set("User-Agent", c.s.userAgent())
  541. if c.ctx_ != nil {
  542. return ctxhttp.Do(c.ctx_, c.s.client, req)
  543. }
  544. return c.s.client.Do(req)
  545. }
  546. // Do executes the "storage.bucketAccessControls.delete" call.
  547. func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  548. gensupport.SetOptions(c.urlParams_, opts...)
  549. res, err := c.doRequest("json")
  550. if err != nil {
  551. return err
  552. }
  553. defer googleapi.CloseBody(res)
  554. if err := googleapi.CheckResponse(res); err != nil {
  555. return err
  556. }
  557. return nil
  558. // {
  559. // "description": "Deletes the ACL entry for the specified entity on the specified bucket.",
  560. // "httpMethod": "DELETE",
  561. // "id": "storage.bucketAccessControls.delete",
  562. // "parameterOrder": [
  563. // "bucket",
  564. // "entity"
  565. // ],
  566. // "parameters": {
  567. // "bucket": {
  568. // "description": "Name of a bucket.",
  569. // "location": "path",
  570. // "required": true,
  571. // "type": "string"
  572. // },
  573. // "entity": {
  574. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  575. // "location": "path",
  576. // "required": true,
  577. // "type": "string"
  578. // }
  579. // },
  580. // "path": "b/{bucket}/acl/{entity}",
  581. // "scopes": [
  582. // "https://www.googleapis.com/auth/devstorage.full_control"
  583. // ]
  584. // }
  585. }
  586. // method id "storage.bucketAccessControls.get":
  587. type BucketAccessControlsGetCall struct {
  588. s *Service
  589. bucket string
  590. entity string
  591. urlParams_ gensupport.URLParams
  592. ifNoneMatch_ string
  593. ctx_ context.Context
  594. }
  595. // Get: Returns the ACL entry for the specified entity on the specified
  596. // bucket.
  597. func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
  598. c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  599. c.bucket = bucket
  600. c.entity = entity
  601. return c
  602. }
  603. // Fields allows partial responses to be retrieved. See
  604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  605. // for more information.
  606. func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
  607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  608. return c
  609. }
  610. // IfNoneMatch sets the optional parameter which makes the operation
  611. // fail if the object's ETag matches the given value. This is useful for
  612. // getting updates only after the object has changed since the last
  613. // request. Use googleapi.IsNotModified to check whether the response
  614. // error from Do is the result of In-None-Match.
  615. func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
  616. c.ifNoneMatch_ = entityTag
  617. return c
  618. }
  619. // Context sets the context to be used in this call's Do method. Any
  620. // pending HTTP request will be aborted if the provided context is
  621. // canceled.
  622. func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
  623. c.ctx_ = ctx
  624. return c
  625. }
  626. func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  627. var body io.Reader = nil
  628. c.urlParams_.Set("alt", alt)
  629. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  630. urls += "?" + c.urlParams_.Encode()
  631. req, _ := http.NewRequest("GET", urls, body)
  632. googleapi.Expand(req.URL, map[string]string{
  633. "bucket": c.bucket,
  634. "entity": c.entity,
  635. })
  636. req.Header.Set("User-Agent", c.s.userAgent())
  637. if c.ifNoneMatch_ != "" {
  638. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  639. }
  640. if c.ctx_ != nil {
  641. return ctxhttp.Do(c.ctx_, c.s.client, req)
  642. }
  643. return c.s.client.Do(req)
  644. }
  645. // Do executes the "storage.bucketAccessControls.get" call.
  646. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  647. // non-2xx status code is an error. Response headers are in either
  648. // *BucketAccessControl.ServerResponse.Header or (if a response was
  649. // returned at all) in error.(*googleapi.Error).Header. Use
  650. // googleapi.IsNotModified to check whether the returned error was
  651. // because http.StatusNotModified was returned.
  652. func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  653. gensupport.SetOptions(c.urlParams_, opts...)
  654. res, err := c.doRequest("json")
  655. if res != nil && res.StatusCode == http.StatusNotModified {
  656. if res.Body != nil {
  657. res.Body.Close()
  658. }
  659. return nil, &googleapi.Error{
  660. Code: res.StatusCode,
  661. Header: res.Header,
  662. }
  663. }
  664. if err != nil {
  665. return nil, err
  666. }
  667. defer googleapi.CloseBody(res)
  668. if err := googleapi.CheckResponse(res); err != nil {
  669. return nil, err
  670. }
  671. ret := &BucketAccessControl{
  672. ServerResponse: googleapi.ServerResponse{
  673. Header: res.Header,
  674. HTTPStatusCode: res.StatusCode,
  675. },
  676. }
  677. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  678. return nil, err
  679. }
  680. return ret, nil
  681. // {
  682. // "description": "Returns the ACL entry for the specified entity on the specified bucket.",
  683. // "httpMethod": "GET",
  684. // "id": "storage.bucketAccessControls.get",
  685. // "parameterOrder": [
  686. // "bucket",
  687. // "entity"
  688. // ],
  689. // "parameters": {
  690. // "bucket": {
  691. // "description": "Name of a bucket.",
  692. // "location": "path",
  693. // "required": true,
  694. // "type": "string"
  695. // },
  696. // "entity": {
  697. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  698. // "location": "path",
  699. // "required": true,
  700. // "type": "string"
  701. // }
  702. // },
  703. // "path": "b/{bucket}/acl/{entity}",
  704. // "response": {
  705. // "$ref": "BucketAccessControl"
  706. // },
  707. // "scopes": [
  708. // "https://www.googleapis.com/auth/devstorage.full_control"
  709. // ]
  710. // }
  711. }
  712. // method id "storage.bucketAccessControls.insert":
  713. type BucketAccessControlsInsertCall struct {
  714. s *Service
  715. bucket string
  716. bucketaccesscontrol *BucketAccessControl
  717. urlParams_ gensupport.URLParams
  718. ctx_ context.Context
  719. }
  720. // Insert: Creates a new ACL entry on the specified bucket.
  721. func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
  722. c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  723. c.bucket = bucket
  724. c.bucketaccesscontrol = bucketaccesscontrol
  725. return c
  726. }
  727. // Fields allows partial responses to be retrieved. See
  728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  729. // for more information.
  730. func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
  731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  732. return c
  733. }
  734. // Context sets the context to be used in this call's Do method. Any
  735. // pending HTTP request will be aborted if the provided context is
  736. // canceled.
  737. func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
  738. c.ctx_ = ctx
  739. return c
  740. }
  741. func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  742. var body io.Reader = nil
  743. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  744. if err != nil {
  745. return nil, err
  746. }
  747. ctype := "application/json"
  748. c.urlParams_.Set("alt", alt)
  749. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  750. urls += "?" + c.urlParams_.Encode()
  751. req, _ := http.NewRequest("POST", urls, body)
  752. googleapi.Expand(req.URL, map[string]string{
  753. "bucket": c.bucket,
  754. })
  755. req.Header.Set("Content-Type", ctype)
  756. req.Header.Set("User-Agent", c.s.userAgent())
  757. if c.ctx_ != nil {
  758. return ctxhttp.Do(c.ctx_, c.s.client, req)
  759. }
  760. return c.s.client.Do(req)
  761. }
  762. // Do executes the "storage.bucketAccessControls.insert" call.
  763. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  764. // non-2xx status code is an error. Response headers are in either
  765. // *BucketAccessControl.ServerResponse.Header or (if a response was
  766. // returned at all) in error.(*googleapi.Error).Header. Use
  767. // googleapi.IsNotModified to check whether the returned error was
  768. // because http.StatusNotModified was returned.
  769. func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  770. gensupport.SetOptions(c.urlParams_, opts...)
  771. res, err := c.doRequest("json")
  772. if res != nil && res.StatusCode == http.StatusNotModified {
  773. if res.Body != nil {
  774. res.Body.Close()
  775. }
  776. return nil, &googleapi.Error{
  777. Code: res.StatusCode,
  778. Header: res.Header,
  779. }
  780. }
  781. if err != nil {
  782. return nil, err
  783. }
  784. defer googleapi.CloseBody(res)
  785. if err := googleapi.CheckResponse(res); err != nil {
  786. return nil, err
  787. }
  788. ret := &BucketAccessControl{
  789. ServerResponse: googleapi.ServerResponse{
  790. Header: res.Header,
  791. HTTPStatusCode: res.StatusCode,
  792. },
  793. }
  794. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  795. return nil, err
  796. }
  797. return ret, nil
  798. // {
  799. // "description": "Creates a new ACL entry on the specified bucket.",
  800. // "httpMethod": "POST",
  801. // "id": "storage.bucketAccessControls.insert",
  802. // "parameterOrder": [
  803. // "bucket"
  804. // ],
  805. // "parameters": {
  806. // "bucket": {
  807. // "description": "Name of a bucket.",
  808. // "location": "path",
  809. // "required": true,
  810. // "type": "string"
  811. // }
  812. // },
  813. // "path": "b/{bucket}/acl",
  814. // "request": {
  815. // "$ref": "BucketAccessControl"
  816. // },
  817. // "response": {
  818. // "$ref": "BucketAccessControl"
  819. // },
  820. // "scopes": [
  821. // "https://www.googleapis.com/auth/devstorage.full_control"
  822. // ]
  823. // }
  824. }
  825. // method id "storage.bucketAccessControls.list":
  826. type BucketAccessControlsListCall struct {
  827. s *Service
  828. bucket string
  829. urlParams_ gensupport.URLParams
  830. ifNoneMatch_ string
  831. ctx_ context.Context
  832. }
  833. // List: Retrieves ACL entries on the specified bucket.
  834. func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
  835. c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  836. c.bucket = bucket
  837. return c
  838. }
  839. // Fields allows partial responses to be retrieved. See
  840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  841. // for more information.
  842. func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
  843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  844. return c
  845. }
  846. // IfNoneMatch sets the optional parameter which makes the operation
  847. // fail if the object's ETag matches the given value. This is useful for
  848. // getting updates only after the object has changed since the last
  849. // request. Use googleapi.IsNotModified to check whether the response
  850. // error from Do is the result of In-None-Match.
  851. func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
  852. c.ifNoneMatch_ = entityTag
  853. return c
  854. }
  855. // Context sets the context to be used in this call's Do method. Any
  856. // pending HTTP request will be aborted if the provided context is
  857. // canceled.
  858. func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
  859. c.ctx_ = ctx
  860. return c
  861. }
  862. func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  863. var body io.Reader = nil
  864. c.urlParams_.Set("alt", alt)
  865. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  866. urls += "?" + c.urlParams_.Encode()
  867. req, _ := http.NewRequest("GET", urls, body)
  868. googleapi.Expand(req.URL, map[string]string{
  869. "bucket": c.bucket,
  870. })
  871. req.Header.Set("User-Agent", c.s.userAgent())
  872. if c.ifNoneMatch_ != "" {
  873. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  874. }
  875. if c.ctx_ != nil {
  876. return ctxhttp.Do(c.ctx_, c.s.client, req)
  877. }
  878. return c.s.client.Do(req)
  879. }
  880. // Do executes the "storage.bucketAccessControls.list" call.
  881. // Exactly one of *BucketAccessControls or error will be non-nil. Any
  882. // non-2xx status code is an error. Response headers are in either
  883. // *BucketAccessControls.ServerResponse.Header or (if a response was
  884. // returned at all) in error.(*googleapi.Error).Header. Use
  885. // googleapi.IsNotModified to check whether the returned error was
  886. // because http.StatusNotModified was returned.
  887. func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
  888. gensupport.SetOptions(c.urlParams_, opts...)
  889. res, err := c.doRequest("json")
  890. if res != nil && res.StatusCode == http.StatusNotModified {
  891. if res.Body != nil {
  892. res.Body.Close()
  893. }
  894. return nil, &googleapi.Error{
  895. Code: res.StatusCode,
  896. Header: res.Header,
  897. }
  898. }
  899. if err != nil {
  900. return nil, err
  901. }
  902. defer googleapi.CloseBody(res)
  903. if err := googleapi.CheckResponse(res); err != nil {
  904. return nil, err
  905. }
  906. ret := &BucketAccessControls{
  907. ServerResponse: googleapi.ServerResponse{
  908. Header: res.Header,
  909. HTTPStatusCode: res.StatusCode,
  910. },
  911. }
  912. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  913. return nil, err
  914. }
  915. return ret, nil
  916. // {
  917. // "description": "Retrieves ACL entries on the specified bucket.",
  918. // "httpMethod": "GET",
  919. // "id": "storage.bucketAccessControls.list",
  920. // "parameterOrder": [
  921. // "bucket"
  922. // ],
  923. // "parameters": {
  924. // "bucket": {
  925. // "description": "Name of a bucket.",
  926. // "location": "path",
  927. // "required": true,
  928. // "type": "string"
  929. // }
  930. // },
  931. // "path": "b/{bucket}/acl",
  932. // "response": {
  933. // "$ref": "BucketAccessControls"
  934. // },
  935. // "scopes": [
  936. // "https://www.googleapis.com/auth/devstorage.full_control"
  937. // ]
  938. // }
  939. }
  940. // method id "storage.bucketAccessControls.patch":
  941. type BucketAccessControlsPatchCall struct {
  942. s *Service
  943. bucket string
  944. entity string
  945. bucketaccesscontrol *BucketAccessControl
  946. urlParams_ gensupport.URLParams
  947. ctx_ context.Context
  948. }
  949. // Patch: Updates an ACL entry on the specified bucket. This method
  950. // supports patch semantics.
  951. func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
  952. c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  953. c.bucket = bucket
  954. c.entity = entity
  955. c.bucketaccesscontrol = bucketaccesscontrol
  956. return c
  957. }
  958. // Fields allows partial responses to be retrieved. See
  959. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  960. // for more information.
  961. func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
  962. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  963. return c
  964. }
  965. // Context sets the context to be used in this call's Do method. Any
  966. // pending HTTP request will be aborted if the provided context is
  967. // canceled.
  968. func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
  969. c.ctx_ = ctx
  970. return c
  971. }
  972. func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  973. var body io.Reader = nil
  974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  975. if err != nil {
  976. return nil, err
  977. }
  978. ctype := "application/json"
  979. c.urlParams_.Set("alt", alt)
  980. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  981. urls += "?" + c.urlParams_.Encode()
  982. req, _ := http.NewRequest("PATCH", urls, body)
  983. googleapi.Expand(req.URL, map[string]string{
  984. "bucket": c.bucket,
  985. "entity": c.entity,
  986. })
  987. req.Header.Set("Content-Type", ctype)
  988. req.Header.Set("User-Agent", c.s.userAgent())
  989. if c.ctx_ != nil {
  990. return ctxhttp.Do(c.ctx_, c.s.client, req)
  991. }
  992. return c.s.client.Do(req)
  993. }
  994. // Do executes the "storage.bucketAccessControls.patch" call.
  995. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  996. // non-2xx status code is an error. Response headers are in either
  997. // *BucketAccessControl.ServerResponse.Header or (if a response was
  998. // returned at all) in error.(*googleapi.Error).Header. Use
  999. // googleapi.IsNotModified to check whether the returned error was
  1000. // because http.StatusNotModified was returned.
  1001. func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1002. gensupport.SetOptions(c.urlParams_, opts...)
  1003. res, err := c.doRequest("json")
  1004. if res != nil && res.StatusCode == http.StatusNotModified {
  1005. if res.Body != nil {
  1006. res.Body.Close()
  1007. }
  1008. return nil, &googleapi.Error{
  1009. Code: res.StatusCode,
  1010. Header: res.Header,
  1011. }
  1012. }
  1013. if err != nil {
  1014. return nil, err
  1015. }
  1016. defer googleapi.CloseBody(res)
  1017. if err := googleapi.CheckResponse(res); err != nil {
  1018. return nil, err
  1019. }
  1020. ret := &BucketAccessControl{
  1021. ServerResponse: googleapi.ServerResponse{
  1022. Header: res.Header,
  1023. HTTPStatusCode: res.StatusCode,
  1024. },
  1025. }
  1026. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1027. return nil, err
  1028. }
  1029. return ret, nil
  1030. // {
  1031. // "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.",
  1032. // "httpMethod": "PATCH",
  1033. // "id": "storage.bucketAccessControls.patch",
  1034. // "parameterOrder": [
  1035. // "bucket",
  1036. // "entity"
  1037. // ],
  1038. // "parameters": {
  1039. // "bucket": {
  1040. // "description": "Name of a bucket.",
  1041. // "location": "path",
  1042. // "required": true,
  1043. // "type": "string"
  1044. // },
  1045. // "entity": {
  1046. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1047. // "location": "path",
  1048. // "required": true,
  1049. // "type": "string"
  1050. // }
  1051. // },
  1052. // "path": "b/{bucket}/acl/{entity}",
  1053. // "request": {
  1054. // "$ref": "BucketAccessControl"
  1055. // },
  1056. // "response": {
  1057. // "$ref": "BucketAccessControl"
  1058. // },
  1059. // "scopes": [
  1060. // "https://www.googleapis.com/auth/devstorage.full_control"
  1061. // ]
  1062. // }
  1063. }
  1064. // method id "storage.bucketAccessControls.update":
  1065. type BucketAccessControlsUpdateCall struct {
  1066. s *Service
  1067. bucket string
  1068. entity string
  1069. bucketaccesscontrol *BucketAccessControl
  1070. urlParams_ gensupport.URLParams
  1071. ctx_ context.Context
  1072. }
  1073. // Update: Updates an ACL entry on the specified bucket.
  1074. func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
  1075. c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1076. c.bucket = bucket
  1077. c.entity = entity
  1078. c.bucketaccesscontrol = bucketaccesscontrol
  1079. return c
  1080. }
  1081. // Fields allows partial responses to be retrieved. See
  1082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1083. // for more information.
  1084. func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
  1085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1086. return c
  1087. }
  1088. // Context sets the context to be used in this call's Do method. Any
  1089. // pending HTTP request will be aborted if the provided context is
  1090. // canceled.
  1091. func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
  1092. c.ctx_ = ctx
  1093. return c
  1094. }
  1095. func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1096. var body io.Reader = nil
  1097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1098. if err != nil {
  1099. return nil, err
  1100. }
  1101. ctype := "application/json"
  1102. c.urlParams_.Set("alt", alt)
  1103. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1104. urls += "?" + c.urlParams_.Encode()
  1105. req, _ := http.NewRequest("PUT", urls, body)
  1106. googleapi.Expand(req.URL, map[string]string{
  1107. "bucket": c.bucket,
  1108. "entity": c.entity,
  1109. })
  1110. req.Header.Set("Content-Type", ctype)
  1111. req.Header.Set("User-Agent", c.s.userAgent())
  1112. if c.ctx_ != nil {
  1113. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1114. }
  1115. return c.s.client.Do(req)
  1116. }
  1117. // Do executes the "storage.bucketAccessControls.update" call.
  1118. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1119. // non-2xx status code is an error. Response headers are in either
  1120. // *BucketAccessControl.ServerResponse.Header or (if a response was
  1121. // returned at all) in error.(*googleapi.Error).Header. Use
  1122. // googleapi.IsNotModified to check whether the returned error was
  1123. // because http.StatusNotModified was returned.
  1124. func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1125. gensupport.SetOptions(c.urlParams_, opts...)
  1126. res, err := c.doRequest("json")
  1127. if res != nil && res.StatusCode == http.StatusNotModified {
  1128. if res.Body != nil {
  1129. res.Body.Close()
  1130. }
  1131. return nil, &googleapi.Error{
  1132. Code: res.StatusCode,
  1133. Header: res.Header,
  1134. }
  1135. }
  1136. if err != nil {
  1137. return nil, err
  1138. }
  1139. defer googleapi.CloseBody(res)
  1140. if err := googleapi.CheckResponse(res); err != nil {
  1141. return nil, err
  1142. }
  1143. ret := &BucketAccessControl{
  1144. ServerResponse: googleapi.ServerResponse{
  1145. Header: res.Header,
  1146. HTTPStatusCode: res.StatusCode,
  1147. },
  1148. }
  1149. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1150. return nil, err
  1151. }
  1152. return ret, nil
  1153. // {
  1154. // "description": "Updates an ACL entry on the specified bucket.",
  1155. // "httpMethod": "PUT",
  1156. // "id": "storage.bucketAccessControls.update",
  1157. // "parameterOrder": [
  1158. // "bucket",
  1159. // "entity"
  1160. // ],
  1161. // "parameters": {
  1162. // "bucket": {
  1163. // "description": "Name of a bucket.",
  1164. // "location": "path",
  1165. // "required": true,
  1166. // "type": "string"
  1167. // },
  1168. // "entity": {
  1169. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1170. // "location": "path",
  1171. // "required": true,
  1172. // "type": "string"
  1173. // }
  1174. // },
  1175. // "path": "b/{bucket}/acl/{entity}",
  1176. // "request": {
  1177. // "$ref": "BucketAccessControl"
  1178. // },
  1179. // "response": {
  1180. // "$ref": "BucketAccessControl"
  1181. // },
  1182. // "scopes": [
  1183. // "https://www.googleapis.com/auth/devstorage.full_control"
  1184. // ]
  1185. // }
  1186. }
  1187. // method id "storage.buckets.delete":
  1188. type BucketsDeleteCall struct {
  1189. s *Service
  1190. bucket string
  1191. urlParams_ gensupport.URLParams
  1192. ctx_ context.Context
  1193. }
  1194. // Delete: Deletes an empty bucket.
  1195. func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
  1196. c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1197. c.bucket = bucket
  1198. return c
  1199. }
  1200. // Fields allows partial responses to be retrieved. See
  1201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1202. // for more information.
  1203. func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
  1204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1205. return c
  1206. }
  1207. // Context sets the context to be used in this call's Do method. Any
  1208. // pending HTTP request will be aborted if the provided context is
  1209. // canceled.
  1210. func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
  1211. c.ctx_ = ctx
  1212. return c
  1213. }
  1214. func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1215. var body io.Reader = nil
  1216. c.urlParams_.Set("alt", alt)
  1217. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  1218. urls += "?" + c.urlParams_.Encode()
  1219. req, _ := http.NewRequest("DELETE", urls, body)
  1220. googleapi.Expand(req.URL, map[string]string{
  1221. "bucket": c.bucket,
  1222. })
  1223. req.Header.Set("User-Agent", c.s.userAgent())
  1224. if c.ctx_ != nil {
  1225. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1226. }
  1227. return c.s.client.Do(req)
  1228. }
  1229. // Do executes the "storage.buckets.delete" call.
  1230. func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1231. gensupport.SetOptions(c.urlParams_, opts...)
  1232. res, err := c.doRequest("json")
  1233. if err != nil {
  1234. return err
  1235. }
  1236. defer googleapi.CloseBody(res)
  1237. if err := googleapi.CheckResponse(res); err != nil {
  1238. return err
  1239. }
  1240. return nil
  1241. // {
  1242. // "description": "Deletes an empty bucket.",
  1243. // "httpMethod": "DELETE",
  1244. // "id": "storage.buckets.delete",
  1245. // "parameterOrder": [
  1246. // "bucket"
  1247. // ],
  1248. // "parameters": {
  1249. // "bucket": {
  1250. // "description": "Name of a bucket.",
  1251. // "location": "path",
  1252. // "required": true,
  1253. // "type": "string"
  1254. // }
  1255. // },
  1256. // "path": "b/{bucket}",
  1257. // "scopes": [
  1258. // "https://www.googleapis.com/auth/devstorage.full_control",
  1259. // "https://www.googleapis.com/auth/devstorage.read_write"
  1260. // ]
  1261. // }
  1262. }
  1263. // method id "storage.buckets.get":
  1264. type BucketsGetCall struct {
  1265. s *Service
  1266. bucket string
  1267. urlParams_ gensupport.URLParams
  1268. ifNoneMatch_ string
  1269. ctx_ context.Context
  1270. }
  1271. // Get: Returns metadata for the specified bucket.
  1272. func (r *BucketsService) Get(bucket string) *BucketsGetCall {
  1273. c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1274. c.bucket = bucket
  1275. return c
  1276. }
  1277. // Projection sets the optional parameter "projection": Set of
  1278. // properties to return. Defaults to no_acl.
  1279. //
  1280. // Possible values:
  1281. // "full" - Include all properties.
  1282. // "no_acl" - Omit acl and defaultObjectAcl properties.
  1283. func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
  1284. c.urlParams_.Set("projection", projection)
  1285. return c
  1286. }
  1287. // Fields allows partial responses to be retrieved. See
  1288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1289. // for more information.
  1290. func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
  1291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1292. return c
  1293. }
  1294. // IfNoneMatch sets the optional parameter which makes the operation
  1295. // fail if the object's ETag matches the given value. This is useful for
  1296. // getting updates only after the object has changed since the last
  1297. // request. Use googleapi.IsNotModified to check whether the response
  1298. // error from Do is the result of In-None-Match.
  1299. func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
  1300. c.ifNoneMatch_ = entityTag
  1301. return c
  1302. }
  1303. // Context sets the context to be used in this call's Do method. Any
  1304. // pending HTTP request will be aborted if the provided context is
  1305. // canceled.
  1306. func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
  1307. c.ctx_ = ctx
  1308. return c
  1309. }
  1310. func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
  1311. var body io.Reader = nil
  1312. c.urlParams_.Set("alt", alt)
  1313. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  1314. urls += "?" + c.urlParams_.Encode()
  1315. req, _ := http.NewRequest("GET", urls, body)
  1316. googleapi.Expand(req.URL, map[string]string{
  1317. "bucket": c.bucket,
  1318. })
  1319. req.Header.Set("User-Agent", c.s.userAgent())
  1320. if c.ifNoneMatch_ != "" {
  1321. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1322. }
  1323. if c.ctx_ != nil {
  1324. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1325. }
  1326. return c.s.client.Do(req)
  1327. }
  1328. // Do executes the "storage.buckets.get" call.
  1329. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  1330. // code is an error. Response headers are in either
  1331. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  1332. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1333. // check whether the returned error was because http.StatusNotModified
  1334. // was returned.
  1335. func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  1336. gensupport.SetOptions(c.urlParams_, opts...)
  1337. res, err := c.doRequest("json")
  1338. if res != nil && res.StatusCode == http.StatusNotModified {
  1339. if res.Body != nil {
  1340. res.Body.Close()
  1341. }
  1342. return nil, &googleapi.Error{
  1343. Code: res.StatusCode,
  1344. Header: res.Header,
  1345. }
  1346. }
  1347. if err != nil {
  1348. return nil, err
  1349. }
  1350. defer googleapi.CloseBody(res)
  1351. if err := googleapi.CheckResponse(res); err != nil {
  1352. return nil, err
  1353. }
  1354. ret := &Bucket{
  1355. ServerResponse: googleapi.ServerResponse{
  1356. Header: res.Header,
  1357. HTTPStatusCode: res.StatusCode,
  1358. },
  1359. }
  1360. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1361. return nil, err
  1362. }
  1363. return ret, nil
  1364. // {
  1365. // "description": "Returns metadata for the specified bucket.",
  1366. // "httpMethod": "GET",
  1367. // "id": "storage.buckets.get",
  1368. // "parameterOrder": [
  1369. // "bucket"
  1370. // ],
  1371. // "parameters": {
  1372. // "bucket": {
  1373. // "description": "Name of a bucket.",
  1374. // "location": "path",
  1375. // "required": true,
  1376. // "type": "string"
  1377. // },
  1378. // "projection": {
  1379. // "description": "Set of properties to return. Defaults to no_acl.",
  1380. // "enum": [
  1381. // "full",
  1382. // "no_acl"
  1383. // ],
  1384. // "enumDescriptions": [
  1385. // "Include all properties.",
  1386. // "Omit acl and defaultObjectAcl properties."
  1387. // ],
  1388. // "location": "query",
  1389. // "type": "string"
  1390. // }
  1391. // },
  1392. // "path": "b/{bucket}",
  1393. // "response": {
  1394. // "$ref": "Bucket"
  1395. // },
  1396. // "scopes": [
  1397. // "https://www.googleapis.com/auth/devstorage.full_control",
  1398. // "https://www.googleapis.com/auth/devstorage.read_only",
  1399. // "https://www.googleapis.com/auth/devstorage.read_write"
  1400. // ]
  1401. // }
  1402. }
  1403. // method id "storage.buckets.insert":
  1404. type BucketsInsertCall struct {
  1405. s *Service
  1406. bucket *Bucket
  1407. urlParams_ gensupport.URLParams
  1408. ctx_ context.Context
  1409. }
  1410. // Insert: Creates a new bucket.
  1411. func (r *BucketsService) Insert(bucket *Bucket) *BucketsInsertCall {
  1412. c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1413. c.bucket = bucket
  1414. return c
  1415. }
  1416. // Projection sets the optional parameter "projection": Set of
  1417. // properties to return. Defaults to no_acl, unless the bucket resource
  1418. // specifies acl or defaultObjectAcl properties, when it defaults to
  1419. // full.
  1420. //
  1421. // Possible values:
  1422. // "full" - Include all properties.
  1423. // "no_acl" - Omit acl and defaultObjectAcl properties.
  1424. func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
  1425. c.urlParams_.Set("projection", projection)
  1426. return c
  1427. }
  1428. // Fields allows partial responses to be retrieved. See
  1429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1430. // for more information.
  1431. func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
  1432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1433. return c
  1434. }
  1435. // Context sets the context to be used in this call's Do method. Any
  1436. // pending HTTP request will be aborted if the provided context is
  1437. // canceled.
  1438. func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
  1439. c.ctx_ = ctx
  1440. return c
  1441. }
  1442. func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  1443. var body io.Reader = nil
  1444. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
  1445. if err != nil {
  1446. return nil, err
  1447. }
  1448. ctype := "application/json"
  1449. c.urlParams_.Set("alt", alt)
  1450. urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  1451. urls += "?" + c.urlParams_.Encode()
  1452. req, _ := http.NewRequest("POST", urls, body)
  1453. googleapi.SetOpaque(req.URL)
  1454. req.Header.Set("Content-Type", ctype)
  1455. req.Header.Set("User-Agent", c.s.userAgent())
  1456. if c.ctx_ != nil {
  1457. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1458. }
  1459. return c.s.client.Do(req)
  1460. }
  1461. // Do executes the "storage.buckets.insert" call.
  1462. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  1463. // code is an error. Response headers are in either
  1464. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  1465. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1466. // check whether the returned error was because http.StatusNotModified
  1467. // was returned.
  1468. func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  1469. gensupport.SetOptions(c.urlParams_, opts...)
  1470. res, err := c.doRequest("json")
  1471. if res != nil && res.StatusCode == http.StatusNotModified {
  1472. if res.Body != nil {
  1473. res.Body.Close()
  1474. }
  1475. return nil, &googleapi.Error{
  1476. Code: res.StatusCode,
  1477. Header: res.Header,
  1478. }
  1479. }
  1480. if err != nil {
  1481. return nil, err
  1482. }
  1483. defer googleapi.CloseBody(res)
  1484. if err := googleapi.CheckResponse(res); err != nil {
  1485. return nil, err
  1486. }
  1487. ret := &Bucket{
  1488. ServerResponse: googleapi.ServerResponse{
  1489. Header: res.Header,
  1490. HTTPStatusCode: res.StatusCode,
  1491. },
  1492. }
  1493. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1494. return nil, err
  1495. }
  1496. return ret, nil
  1497. // {
  1498. // "description": "Creates a new bucket.",
  1499. // "httpMethod": "POST",
  1500. // "id": "storage.buckets.insert",
  1501. // "parameters": {
  1502. // "projection": {
  1503. // "description": "Set of properties to return. Defaults to no_acl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
  1504. // "enum": [
  1505. // "full",
  1506. // "no_acl"
  1507. // ],
  1508. // "enumDescriptions": [
  1509. // "Include all properties.",
  1510. // "Omit acl and defaultObjectAcl properties."
  1511. // ],
  1512. // "location": "query",
  1513. // "type": "string"
  1514. // }
  1515. // },
  1516. // "path": "b",
  1517. // "request": {
  1518. // "$ref": "Bucket"
  1519. // },
  1520. // "response": {
  1521. // "$ref": "Bucket"
  1522. // },
  1523. // "scopes": [
  1524. // "https://www.googleapis.com/auth/devstorage.full_control",
  1525. // "https://www.googleapis.com/auth/devstorage.read_write"
  1526. // ]
  1527. // }
  1528. }
  1529. // method id "storage.buckets.list":
  1530. type BucketsListCall struct {
  1531. s *Service
  1532. urlParams_ gensupport.URLParams
  1533. ifNoneMatch_ string
  1534. ctx_ context.Context
  1535. }
  1536. // List: Retrieves a list of buckets for a given project.
  1537. func (r *BucketsService) List(projectId uint64) *BucketsListCall {
  1538. c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1539. c.urlParams_.Set("projectId", fmt.Sprint(projectId))
  1540. return c
  1541. }
  1542. // MaxResults sets the optional parameter "max-results": Maximum number
  1543. // of buckets to return.
  1544. func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
  1545. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  1546. return c
  1547. }
  1548. // PageToken sets the optional parameter "pageToken": A
  1549. // previously-returned page token representing part of the larger set of
  1550. // results to view.
  1551. func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
  1552. c.urlParams_.Set("pageToken", pageToken)
  1553. return c
  1554. }
  1555. // Projection sets the optional parameter "projection": Set of
  1556. // properties to return. Defaults to no_acl.
  1557. //
  1558. // Possible values:
  1559. // "full" - Include all properties.
  1560. // "no_acl" - Omit acl and defaultObjectAcl properties.
  1561. func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
  1562. c.urlParams_.Set("projection", projection)
  1563. return c
  1564. }
  1565. // Fields allows partial responses to be retrieved. See
  1566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1567. // for more information.
  1568. func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
  1569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1570. return c
  1571. }
  1572. // IfNoneMatch sets the optional parameter which makes the operation
  1573. // fail if the object's ETag matches the given value. This is useful for
  1574. // getting updates only after the object has changed since the last
  1575. // request. Use googleapi.IsNotModified to check whether the response
  1576. // error from Do is the result of In-None-Match.
  1577. func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
  1578. c.ifNoneMatch_ = entityTag
  1579. return c
  1580. }
  1581. // Context sets the context to be used in this call's Do method. Any
  1582. // pending HTTP request will be aborted if the provided context is
  1583. // canceled.
  1584. func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
  1585. c.ctx_ = ctx
  1586. return c
  1587. }
  1588. func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
  1589. var body io.Reader = nil
  1590. c.urlParams_.Set("alt", alt)
  1591. urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  1592. urls += "?" + c.urlParams_.Encode()
  1593. req, _ := http.NewRequest("GET", urls, body)
  1594. googleapi.SetOpaque(req.URL)
  1595. req.Header.Set("User-Agent", c.s.userAgent())
  1596. if c.ifNoneMatch_ != "" {
  1597. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1598. }
  1599. if c.ctx_ != nil {
  1600. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1601. }
  1602. return c.s.client.Do(req)
  1603. }
  1604. // Do executes the "storage.buckets.list" call.
  1605. // Exactly one of *Buckets or error will be non-nil. Any non-2xx status
  1606. // code is an error. Response headers are in either
  1607. // *Buckets.ServerResponse.Header or (if a response was returned at all)
  1608. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1609. // check whether the returned error was because http.StatusNotModified
  1610. // was returned.
  1611. func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
  1612. gensupport.SetOptions(c.urlParams_, opts...)
  1613. res, err := c.doRequest("json")
  1614. if res != nil && res.StatusCode == http.StatusNotModified {
  1615. if res.Body != nil {
  1616. res.Body.Close()
  1617. }
  1618. return nil, &googleapi.Error{
  1619. Code: res.StatusCode,
  1620. Header: res.Header,
  1621. }
  1622. }
  1623. if err != nil {
  1624. return nil, err
  1625. }
  1626. defer googleapi.CloseBody(res)
  1627. if err := googleapi.CheckResponse(res); err != nil {
  1628. return nil, err
  1629. }
  1630. ret := &Buckets{
  1631. ServerResponse: googleapi.ServerResponse{
  1632. Header: res.Header,
  1633. HTTPStatusCode: res.StatusCode,
  1634. },
  1635. }
  1636. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1637. return nil, err
  1638. }
  1639. return ret, nil
  1640. // {
  1641. // "description": "Retrieves a list of buckets for a given project.",
  1642. // "httpMethod": "GET",
  1643. // "id": "storage.buckets.list",
  1644. // "parameterOrder": [
  1645. // "projectId"
  1646. // ],
  1647. // "parameters": {
  1648. // "max-results": {
  1649. // "description": "Maximum number of buckets to return.",
  1650. // "format": "uint32",
  1651. // "location": "query",
  1652. // "minimum": "0",
  1653. // "type": "integer"
  1654. // },
  1655. // "pageToken": {
  1656. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  1657. // "location": "query",
  1658. // "type": "string"
  1659. // },
  1660. // "projectId": {
  1661. // "description": "A valid API project identifier.",
  1662. // "format": "uint64",
  1663. // "location": "query",
  1664. // "required": true,
  1665. // "type": "string"
  1666. // },
  1667. // "projection": {
  1668. // "description": "Set of properties to return. Defaults to no_acl.",
  1669. // "enum": [
  1670. // "full",
  1671. // "no_acl"
  1672. // ],
  1673. // "enumDescriptions": [
  1674. // "Include all properties.",
  1675. // "Omit acl and defaultObjectAcl properties."
  1676. // ],
  1677. // "location": "query",
  1678. // "type": "string"
  1679. // }
  1680. // },
  1681. // "path": "b",
  1682. // "response": {
  1683. // "$ref": "Buckets"
  1684. // },
  1685. // "scopes": [
  1686. // "https://www.googleapis.com/auth/devstorage.full_control",
  1687. // "https://www.googleapis.com/auth/devstorage.read_only",
  1688. // "https://www.googleapis.com/auth/devstorage.read_write"
  1689. // ]
  1690. // }
  1691. }
  1692. // Pages invokes f for each page of results.
  1693. // A non-nil error returned from f will halt the iteration.
  1694. // The provided context supersedes any context provided to the Context method.
  1695. func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
  1696. c.ctx_ = ctx
  1697. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1698. for {
  1699. x, err := c.Do()
  1700. if err != nil {
  1701. return err
  1702. }
  1703. if err := f(x); err != nil {
  1704. return err
  1705. }
  1706. if x.NextPageToken == "" {
  1707. return nil
  1708. }
  1709. c.PageToken(x.NextPageToken)
  1710. }
  1711. }
  1712. // method id "storage.buckets.patch":
  1713. type BucketsPatchCall struct {
  1714. s *Service
  1715. bucket string
  1716. bucket2 *Bucket
  1717. urlParams_ gensupport.URLParams
  1718. ctx_ context.Context
  1719. }
  1720. // Patch: Updates a bucket. This method supports patch semantics.
  1721. func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
  1722. c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1723. c.bucket = bucket
  1724. c.bucket2 = bucket2
  1725. return c
  1726. }
  1727. // Projection sets the optional parameter "projection": Set of
  1728. // properties to return. Defaults to full.
  1729. //
  1730. // Possible values:
  1731. // "full" - Include all properties.
  1732. // "no_acl" - Omit acl and defaultObjectAcl properties.
  1733. func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
  1734. c.urlParams_.Set("projection", projection)
  1735. return c
  1736. }
  1737. // Fields allows partial responses to be retrieved. See
  1738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1739. // for more information.
  1740. func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
  1741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1742. return c
  1743. }
  1744. // Context sets the context to be used in this call's Do method. Any
  1745. // pending HTTP request will be aborted if the provided context is
  1746. // canceled.
  1747. func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
  1748. c.ctx_ = ctx
  1749. return c
  1750. }
  1751. func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  1752. var body io.Reader = nil
  1753. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  1754. if err != nil {
  1755. return nil, err
  1756. }
  1757. ctype := "application/json"
  1758. c.urlParams_.Set("alt", alt)
  1759. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  1760. urls += "?" + c.urlParams_.Encode()
  1761. req, _ := http.NewRequest("PATCH", urls, body)
  1762. googleapi.Expand(req.URL, map[string]string{
  1763. "bucket": c.bucket,
  1764. })
  1765. req.Header.Set("Content-Type", ctype)
  1766. req.Header.Set("User-Agent", c.s.userAgent())
  1767. if c.ctx_ != nil {
  1768. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1769. }
  1770. return c.s.client.Do(req)
  1771. }
  1772. // Do executes the "storage.buckets.patch" call.
  1773. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  1774. // code is an error. Response headers are in either
  1775. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  1776. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1777. // check whether the returned error was because http.StatusNotModified
  1778. // was returned.
  1779. func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  1780. gensupport.SetOptions(c.urlParams_, opts...)
  1781. res, err := c.doRequest("json")
  1782. if res != nil && res.StatusCode == http.StatusNotModified {
  1783. if res.Body != nil {
  1784. res.Body.Close()
  1785. }
  1786. return nil, &googleapi.Error{
  1787. Code: res.StatusCode,
  1788. Header: res.Header,
  1789. }
  1790. }
  1791. if err != nil {
  1792. return nil, err
  1793. }
  1794. defer googleapi.CloseBody(res)
  1795. if err := googleapi.CheckResponse(res); err != nil {
  1796. return nil, err
  1797. }
  1798. ret := &Bucket{
  1799. ServerResponse: googleapi.ServerResponse{
  1800. Header: res.Header,
  1801. HTTPStatusCode: res.StatusCode,
  1802. },
  1803. }
  1804. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1805. return nil, err
  1806. }
  1807. return ret, nil
  1808. // {
  1809. // "description": "Updates a bucket. This method supports patch semantics.",
  1810. // "httpMethod": "PATCH",
  1811. // "id": "storage.buckets.patch",
  1812. // "parameterOrder": [
  1813. // "bucket"
  1814. // ],
  1815. // "parameters": {
  1816. // "bucket": {
  1817. // "description": "Name of a bucket.",
  1818. // "location": "path",
  1819. // "required": true,
  1820. // "type": "string"
  1821. // },
  1822. // "projection": {
  1823. // "description": "Set of properties to return. Defaults to full.",
  1824. // "enum": [
  1825. // "full",
  1826. // "no_acl"
  1827. // ],
  1828. // "enumDescriptions": [
  1829. // "Include all properties.",
  1830. // "Omit acl and defaultObjectAcl properties."
  1831. // ],
  1832. // "location": "query",
  1833. // "type": "string"
  1834. // }
  1835. // },
  1836. // "path": "b/{bucket}",
  1837. // "request": {
  1838. // "$ref": "Bucket"
  1839. // },
  1840. // "response": {
  1841. // "$ref": "Bucket"
  1842. // },
  1843. // "scopes": [
  1844. // "https://www.googleapis.com/auth/devstorage.full_control",
  1845. // "https://www.googleapis.com/auth/devstorage.read_write"
  1846. // ]
  1847. // }
  1848. }
  1849. // method id "storage.buckets.update":
  1850. type BucketsUpdateCall struct {
  1851. s *Service
  1852. bucket string
  1853. bucket2 *Bucket
  1854. urlParams_ gensupport.URLParams
  1855. ctx_ context.Context
  1856. }
  1857. // Update: Updates a bucket.
  1858. func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
  1859. c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1860. c.bucket = bucket
  1861. c.bucket2 = bucket2
  1862. return c
  1863. }
  1864. // Projection sets the optional parameter "projection": Set of
  1865. // properties to return. Defaults to full.
  1866. //
  1867. // Possible values:
  1868. // "full" - Include all properties.
  1869. // "no_acl" - Omit acl and defaultObjectAcl properties.
  1870. func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
  1871. c.urlParams_.Set("projection", projection)
  1872. return c
  1873. }
  1874. // Fields allows partial responses to be retrieved. See
  1875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1876. // for more information.
  1877. func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
  1878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1879. return c
  1880. }
  1881. // Context sets the context to be used in this call's Do method. Any
  1882. // pending HTTP request will be aborted if the provided context is
  1883. // canceled.
  1884. func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
  1885. c.ctx_ = ctx
  1886. return c
  1887. }
  1888. func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1889. var body io.Reader = nil
  1890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  1891. if err != nil {
  1892. return nil, err
  1893. }
  1894. ctype := "application/json"
  1895. c.urlParams_.Set("alt", alt)
  1896. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  1897. urls += "?" + c.urlParams_.Encode()
  1898. req, _ := http.NewRequest("PUT", urls, body)
  1899. googleapi.Expand(req.URL, map[string]string{
  1900. "bucket": c.bucket,
  1901. })
  1902. req.Header.Set("Content-Type", ctype)
  1903. req.Header.Set("User-Agent", c.s.userAgent())
  1904. if c.ctx_ != nil {
  1905. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1906. }
  1907. return c.s.client.Do(req)
  1908. }
  1909. // Do executes the "storage.buckets.update" call.
  1910. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  1911. // code is an error. Response headers are in either
  1912. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  1913. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1914. // check whether the returned error was because http.StatusNotModified
  1915. // was returned.
  1916. func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  1917. gensupport.SetOptions(c.urlParams_, opts...)
  1918. res, err := c.doRequest("json")
  1919. if res != nil && res.StatusCode == http.StatusNotModified {
  1920. if res.Body != nil {
  1921. res.Body.Close()
  1922. }
  1923. return nil, &googleapi.Error{
  1924. Code: res.StatusCode,
  1925. Header: res.Header,
  1926. }
  1927. }
  1928. if err != nil {
  1929. return nil, err
  1930. }
  1931. defer googleapi.CloseBody(res)
  1932. if err := googleapi.CheckResponse(res); err != nil {
  1933. return nil, err
  1934. }
  1935. ret := &Bucket{
  1936. ServerResponse: googleapi.ServerResponse{
  1937. Header: res.Header,
  1938. HTTPStatusCode: res.StatusCode,
  1939. },
  1940. }
  1941. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1942. return nil, err
  1943. }
  1944. return ret, nil
  1945. // {
  1946. // "description": "Updates a bucket.",
  1947. // "httpMethod": "PUT",
  1948. // "id": "storage.buckets.update",
  1949. // "parameterOrder": [
  1950. // "bucket"
  1951. // ],
  1952. // "parameters": {
  1953. // "bucket": {
  1954. // "description": "Name of a bucket.",
  1955. // "location": "path",
  1956. // "required": true,
  1957. // "type": "string"
  1958. // },
  1959. // "projection": {
  1960. // "description": "Set of properties to return. Defaults to full.",
  1961. // "enum": [
  1962. // "full",
  1963. // "no_acl"
  1964. // ],
  1965. // "enumDescriptions": [
  1966. // "Include all properties.",
  1967. // "Omit acl and defaultObjectAcl properties."
  1968. // ],
  1969. // "location": "query",
  1970. // "type": "string"
  1971. // }
  1972. // },
  1973. // "path": "b/{bucket}",
  1974. // "request": {
  1975. // "$ref": "Bucket"
  1976. // },
  1977. // "response": {
  1978. // "$ref": "Bucket"
  1979. // },
  1980. // "scopes": [
  1981. // "https://www.googleapis.com/auth/devstorage.full_control",
  1982. // "https://www.googleapis.com/auth/devstorage.read_write"
  1983. // ]
  1984. // }
  1985. }
  1986. // method id "storage.objectAccessControls.delete":
  1987. type ObjectAccessControlsDeleteCall struct {
  1988. s *Service
  1989. bucket string
  1990. object string
  1991. entity string
  1992. urlParams_ gensupport.URLParams
  1993. ctx_ context.Context
  1994. }
  1995. // Delete: Deletes the ACL entry for the specified entity on the
  1996. // specified object.
  1997. func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
  1998. c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1999. c.bucket = bucket
  2000. c.object = object
  2001. c.entity = entity
  2002. return c
  2003. }
  2004. // Fields allows partial responses to be retrieved. See
  2005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2006. // for more information.
  2007. func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
  2008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2009. return c
  2010. }
  2011. // Context sets the context to be used in this call's Do method. Any
  2012. // pending HTTP request will be aborted if the provided context is
  2013. // canceled.
  2014. func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
  2015. c.ctx_ = ctx
  2016. return c
  2017. }
  2018. func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2019. var body io.Reader = nil
  2020. c.urlParams_.Set("alt", alt)
  2021. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  2022. urls += "?" + c.urlParams_.Encode()
  2023. req, _ := http.NewRequest("DELETE", urls, body)
  2024. googleapi.Expand(req.URL, map[string]string{
  2025. "bucket": c.bucket,
  2026. "object": c.object,
  2027. "entity": c.entity,
  2028. })
  2029. req.Header.Set("User-Agent", c.s.userAgent())
  2030. if c.ctx_ != nil {
  2031. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2032. }
  2033. return c.s.client.Do(req)
  2034. }
  2035. // Do executes the "storage.objectAccessControls.delete" call.
  2036. func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2037. gensupport.SetOptions(c.urlParams_, opts...)
  2038. res, err := c.doRequest("json")
  2039. if err != nil {
  2040. return err
  2041. }
  2042. defer googleapi.CloseBody(res)
  2043. if err := googleapi.CheckResponse(res); err != nil {
  2044. return err
  2045. }
  2046. return nil
  2047. // {
  2048. // "description": "Deletes the ACL entry for the specified entity on the specified object.",
  2049. // "httpMethod": "DELETE",
  2050. // "id": "storage.objectAccessControls.delete",
  2051. // "parameterOrder": [
  2052. // "bucket",
  2053. // "object",
  2054. // "entity"
  2055. // ],
  2056. // "parameters": {
  2057. // "bucket": {
  2058. // "description": "Name of a bucket.",
  2059. // "location": "path",
  2060. // "required": true,
  2061. // "type": "string"
  2062. // },
  2063. // "entity": {
  2064. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  2065. // "location": "path",
  2066. // "required": true,
  2067. // "type": "string"
  2068. // },
  2069. // "object": {
  2070. // "description": "Name of the object.",
  2071. // "location": "path",
  2072. // "required": true,
  2073. // "type": "string"
  2074. // }
  2075. // },
  2076. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  2077. // "scopes": [
  2078. // "https://www.googleapis.com/auth/devstorage.full_control"
  2079. // ]
  2080. // }
  2081. }
  2082. // method id "storage.objectAccessControls.get":
  2083. type ObjectAccessControlsGetCall struct {
  2084. s *Service
  2085. bucket string
  2086. object string
  2087. entity string
  2088. urlParams_ gensupport.URLParams
  2089. ifNoneMatch_ string
  2090. ctx_ context.Context
  2091. }
  2092. // Get: Returns the ACL entry for the specified entity on the specified
  2093. // object.
  2094. func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
  2095. c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2096. c.bucket = bucket
  2097. c.object = object
  2098. c.entity = entity
  2099. return c
  2100. }
  2101. // Fields allows partial responses to be retrieved. See
  2102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2103. // for more information.
  2104. func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
  2105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2106. return c
  2107. }
  2108. // IfNoneMatch sets the optional parameter which makes the operation
  2109. // fail if the object's ETag matches the given value. This is useful for
  2110. // getting updates only after the object has changed since the last
  2111. // request. Use googleapi.IsNotModified to check whether the response
  2112. // error from Do is the result of In-None-Match.
  2113. func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
  2114. c.ifNoneMatch_ = entityTag
  2115. return c
  2116. }
  2117. // Context sets the context to be used in this call's Do method. Any
  2118. // pending HTTP request will be aborted if the provided context is
  2119. // canceled.
  2120. func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
  2121. c.ctx_ = ctx
  2122. return c
  2123. }
  2124. func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  2125. var body io.Reader = nil
  2126. c.urlParams_.Set("alt", alt)
  2127. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  2128. urls += "?" + c.urlParams_.Encode()
  2129. req, _ := http.NewRequest("GET", urls, body)
  2130. googleapi.Expand(req.URL, map[string]string{
  2131. "bucket": c.bucket,
  2132. "object": c.object,
  2133. "entity": c.entity,
  2134. })
  2135. req.Header.Set("User-Agent", c.s.userAgent())
  2136. if c.ifNoneMatch_ != "" {
  2137. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2138. }
  2139. if c.ctx_ != nil {
  2140. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2141. }
  2142. return c.s.client.Do(req)
  2143. }
  2144. // Do executes the "storage.objectAccessControls.get" call.
  2145. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  2146. // non-2xx status code is an error. Response headers are in either
  2147. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  2148. // returned at all) in error.(*googleapi.Error).Header. Use
  2149. // googleapi.IsNotModified to check whether the returned error was
  2150. // because http.StatusNotModified was returned.
  2151. func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  2152. gensupport.SetOptions(c.urlParams_, opts...)
  2153. res, err := c.doRequest("json")
  2154. if res != nil && res.StatusCode == http.StatusNotModified {
  2155. if res.Body != nil {
  2156. res.Body.Close()
  2157. }
  2158. return nil, &googleapi.Error{
  2159. Code: res.StatusCode,
  2160. Header: res.Header,
  2161. }
  2162. }
  2163. if err != nil {
  2164. return nil, err
  2165. }
  2166. defer googleapi.CloseBody(res)
  2167. if err := googleapi.CheckResponse(res); err != nil {
  2168. return nil, err
  2169. }
  2170. ret := &ObjectAccessControl{
  2171. ServerResponse: googleapi.ServerResponse{
  2172. Header: res.Header,
  2173. HTTPStatusCode: res.StatusCode,
  2174. },
  2175. }
  2176. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2177. return nil, err
  2178. }
  2179. return ret, nil
  2180. // {
  2181. // "description": "Returns the ACL entry for the specified entity on the specified object.",
  2182. // "httpMethod": "GET",
  2183. // "id": "storage.objectAccessControls.get",
  2184. // "parameterOrder": [
  2185. // "bucket",
  2186. // "object",
  2187. // "entity"
  2188. // ],
  2189. // "parameters": {
  2190. // "bucket": {
  2191. // "description": "Name of a bucket.",
  2192. // "location": "path",
  2193. // "required": true,
  2194. // "type": "string"
  2195. // },
  2196. // "entity": {
  2197. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  2198. // "location": "path",
  2199. // "required": true,
  2200. // "type": "string"
  2201. // },
  2202. // "object": {
  2203. // "description": "Name of the object.",
  2204. // "location": "path",
  2205. // "required": true,
  2206. // "type": "string"
  2207. // }
  2208. // },
  2209. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  2210. // "response": {
  2211. // "$ref": "ObjectAccessControl"
  2212. // },
  2213. // "scopes": [
  2214. // "https://www.googleapis.com/auth/devstorage.full_control"
  2215. // ]
  2216. // }
  2217. }
  2218. // method id "storage.objectAccessControls.insert":
  2219. type ObjectAccessControlsInsertCall struct {
  2220. s *Service
  2221. bucket string
  2222. object string
  2223. objectaccesscontrol *ObjectAccessControl
  2224. urlParams_ gensupport.URLParams
  2225. ctx_ context.Context
  2226. }
  2227. // Insert: Creates a new ACL entry on the specified object.
  2228. func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
  2229. c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2230. c.bucket = bucket
  2231. c.object = object
  2232. c.objectaccesscontrol = objectaccesscontrol
  2233. return c
  2234. }
  2235. // Fields allows partial responses to be retrieved. See
  2236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2237. // for more information.
  2238. func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
  2239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2240. return c
  2241. }
  2242. // Context sets the context to be used in this call's Do method. Any
  2243. // pending HTTP request will be aborted if the provided context is
  2244. // canceled.
  2245. func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
  2246. c.ctx_ = ctx
  2247. return c
  2248. }
  2249. func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  2250. var body io.Reader = nil
  2251. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  2252. if err != nil {
  2253. return nil, err
  2254. }
  2255. ctype := "application/json"
  2256. c.urlParams_.Set("alt", alt)
  2257. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  2258. urls += "?" + c.urlParams_.Encode()
  2259. req, _ := http.NewRequest("POST", urls, body)
  2260. googleapi.Expand(req.URL, map[string]string{
  2261. "bucket": c.bucket,
  2262. "object": c.object,
  2263. })
  2264. req.Header.Set("Content-Type", ctype)
  2265. req.Header.Set("User-Agent", c.s.userAgent())
  2266. if c.ctx_ != nil {
  2267. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2268. }
  2269. return c.s.client.Do(req)
  2270. }
  2271. // Do executes the "storage.objectAccessControls.insert" call.
  2272. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  2273. // non-2xx status code is an error. Response headers are in either
  2274. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  2275. // returned at all) in error.(*googleapi.Error).Header. Use
  2276. // googleapi.IsNotModified to check whether the returned error was
  2277. // because http.StatusNotModified was returned.
  2278. func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  2279. gensupport.SetOptions(c.urlParams_, opts...)
  2280. res, err := c.doRequest("json")
  2281. if res != nil && res.StatusCode == http.StatusNotModified {
  2282. if res.Body != nil {
  2283. res.Body.Close()
  2284. }
  2285. return nil, &googleapi.Error{
  2286. Code: res.StatusCode,
  2287. Header: res.Header,
  2288. }
  2289. }
  2290. if err != nil {
  2291. return nil, err
  2292. }
  2293. defer googleapi.CloseBody(res)
  2294. if err := googleapi.CheckResponse(res); err != nil {
  2295. return nil, err
  2296. }
  2297. ret := &ObjectAccessControl{
  2298. ServerResponse: googleapi.ServerResponse{
  2299. Header: res.Header,
  2300. HTTPStatusCode: res.StatusCode,
  2301. },
  2302. }
  2303. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2304. return nil, err
  2305. }
  2306. return ret, nil
  2307. // {
  2308. // "description": "Creates a new ACL entry on the specified object.",
  2309. // "httpMethod": "POST",
  2310. // "id": "storage.objectAccessControls.insert",
  2311. // "parameterOrder": [
  2312. // "bucket",
  2313. // "object"
  2314. // ],
  2315. // "parameters": {
  2316. // "bucket": {
  2317. // "description": "Name of a bucket.",
  2318. // "location": "path",
  2319. // "required": true,
  2320. // "type": "string"
  2321. // },
  2322. // "object": {
  2323. // "description": "Name of the object.",
  2324. // "location": "path",
  2325. // "required": true,
  2326. // "type": "string"
  2327. // }
  2328. // },
  2329. // "path": "b/{bucket}/o/{object}/acl",
  2330. // "request": {
  2331. // "$ref": "ObjectAccessControl"
  2332. // },
  2333. // "response": {
  2334. // "$ref": "ObjectAccessControl"
  2335. // },
  2336. // "scopes": [
  2337. // "https://www.googleapis.com/auth/devstorage.full_control"
  2338. // ]
  2339. // }
  2340. }
  2341. // method id "storage.objectAccessControls.list":
  2342. type ObjectAccessControlsListCall struct {
  2343. s *Service
  2344. bucket string
  2345. object string
  2346. urlParams_ gensupport.URLParams
  2347. ifNoneMatch_ string
  2348. ctx_ context.Context
  2349. }
  2350. // List: Retrieves ACL entries on the specified object.
  2351. func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
  2352. c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2353. c.bucket = bucket
  2354. c.object = object
  2355. return c
  2356. }
  2357. // Fields allows partial responses to be retrieved. See
  2358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2359. // for more information.
  2360. func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
  2361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2362. return c
  2363. }
  2364. // IfNoneMatch sets the optional parameter which makes the operation
  2365. // fail if the object's ETag matches the given value. This is useful for
  2366. // getting updates only after the object has changed since the last
  2367. // request. Use googleapi.IsNotModified to check whether the response
  2368. // error from Do is the result of In-None-Match.
  2369. func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
  2370. c.ifNoneMatch_ = entityTag
  2371. return c
  2372. }
  2373. // Context sets the context to be used in this call's Do method. Any
  2374. // pending HTTP request will be aborted if the provided context is
  2375. // canceled.
  2376. func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
  2377. c.ctx_ = ctx
  2378. return c
  2379. }
  2380. func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  2381. var body io.Reader = nil
  2382. c.urlParams_.Set("alt", alt)
  2383. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  2384. urls += "?" + c.urlParams_.Encode()
  2385. req, _ := http.NewRequest("GET", urls, body)
  2386. googleapi.Expand(req.URL, map[string]string{
  2387. "bucket": c.bucket,
  2388. "object": c.object,
  2389. })
  2390. req.Header.Set("User-Agent", c.s.userAgent())
  2391. if c.ifNoneMatch_ != "" {
  2392. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2393. }
  2394. if c.ctx_ != nil {
  2395. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2396. }
  2397. return c.s.client.Do(req)
  2398. }
  2399. // Do executes the "storage.objectAccessControls.list" call.
  2400. // Exactly one of *ObjectAccessControls or error will be non-nil. Any
  2401. // non-2xx status code is an error. Response headers are in either
  2402. // *ObjectAccessControls.ServerResponse.Header or (if a response was
  2403. // returned at all) in error.(*googleapi.Error).Header. Use
  2404. // googleapi.IsNotModified to check whether the returned error was
  2405. // because http.StatusNotModified was returned.
  2406. func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  2407. gensupport.SetOptions(c.urlParams_, opts...)
  2408. res, err := c.doRequest("json")
  2409. if res != nil && res.StatusCode == http.StatusNotModified {
  2410. if res.Body != nil {
  2411. res.Body.Close()
  2412. }
  2413. return nil, &googleapi.Error{
  2414. Code: res.StatusCode,
  2415. Header: res.Header,
  2416. }
  2417. }
  2418. if err != nil {
  2419. return nil, err
  2420. }
  2421. defer googleapi.CloseBody(res)
  2422. if err := googleapi.CheckResponse(res); err != nil {
  2423. return nil, err
  2424. }
  2425. ret := &ObjectAccessControls{
  2426. ServerResponse: googleapi.ServerResponse{
  2427. Header: res.Header,
  2428. HTTPStatusCode: res.StatusCode,
  2429. },
  2430. }
  2431. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2432. return nil, err
  2433. }
  2434. return ret, nil
  2435. // {
  2436. // "description": "Retrieves ACL entries on the specified object.",
  2437. // "httpMethod": "GET",
  2438. // "id": "storage.objectAccessControls.list",
  2439. // "parameterOrder": [
  2440. // "bucket",
  2441. // "object"
  2442. // ],
  2443. // "parameters": {
  2444. // "bucket": {
  2445. // "description": "Name of a bucket.",
  2446. // "location": "path",
  2447. // "required": true,
  2448. // "type": "string"
  2449. // },
  2450. // "object": {
  2451. // "description": "Name of the object.",
  2452. // "location": "path",
  2453. // "required": true,
  2454. // "type": "string"
  2455. // }
  2456. // },
  2457. // "path": "b/{bucket}/o/{object}/acl",
  2458. // "response": {
  2459. // "$ref": "ObjectAccessControls"
  2460. // },
  2461. // "scopes": [
  2462. // "https://www.googleapis.com/auth/devstorage.full_control"
  2463. // ]
  2464. // }
  2465. }
  2466. // method id "storage.objectAccessControls.patch":
  2467. type ObjectAccessControlsPatchCall struct {
  2468. s *Service
  2469. bucket string
  2470. object string
  2471. entity string
  2472. objectaccesscontrol *ObjectAccessControl
  2473. urlParams_ gensupport.URLParams
  2474. ctx_ context.Context
  2475. }
  2476. // Patch: Updates an ACL entry on the specified object. This method
  2477. // supports patch semantics.
  2478. func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
  2479. c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2480. c.bucket = bucket
  2481. c.object = object
  2482. c.entity = entity
  2483. c.objectaccesscontrol = objectaccesscontrol
  2484. return c
  2485. }
  2486. // Fields allows partial responses to be retrieved. See
  2487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2488. // for more information.
  2489. func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
  2490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2491. return c
  2492. }
  2493. // Context sets the context to be used in this call's Do method. Any
  2494. // pending HTTP request will be aborted if the provided context is
  2495. // canceled.
  2496. func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
  2497. c.ctx_ = ctx
  2498. return c
  2499. }
  2500. func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  2501. var body io.Reader = nil
  2502. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  2503. if err != nil {
  2504. return nil, err
  2505. }
  2506. ctype := "application/json"
  2507. c.urlParams_.Set("alt", alt)
  2508. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  2509. urls += "?" + c.urlParams_.Encode()
  2510. req, _ := http.NewRequest("PATCH", urls, body)
  2511. googleapi.Expand(req.URL, map[string]string{
  2512. "bucket": c.bucket,
  2513. "object": c.object,
  2514. "entity": c.entity,
  2515. })
  2516. req.Header.Set("Content-Type", ctype)
  2517. req.Header.Set("User-Agent", c.s.userAgent())
  2518. if c.ctx_ != nil {
  2519. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2520. }
  2521. return c.s.client.Do(req)
  2522. }
  2523. // Do executes the "storage.objectAccessControls.patch" call.
  2524. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  2525. // non-2xx status code is an error. Response headers are in either
  2526. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  2527. // returned at all) in error.(*googleapi.Error).Header. Use
  2528. // googleapi.IsNotModified to check whether the returned error was
  2529. // because http.StatusNotModified was returned.
  2530. func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  2531. gensupport.SetOptions(c.urlParams_, opts...)
  2532. res, err := c.doRequest("json")
  2533. if res != nil && res.StatusCode == http.StatusNotModified {
  2534. if res.Body != nil {
  2535. res.Body.Close()
  2536. }
  2537. return nil, &googleapi.Error{
  2538. Code: res.StatusCode,
  2539. Header: res.Header,
  2540. }
  2541. }
  2542. if err != nil {
  2543. return nil, err
  2544. }
  2545. defer googleapi.CloseBody(res)
  2546. if err := googleapi.CheckResponse(res); err != nil {
  2547. return nil, err
  2548. }
  2549. ret := &ObjectAccessControl{
  2550. ServerResponse: googleapi.ServerResponse{
  2551. Header: res.Header,
  2552. HTTPStatusCode: res.StatusCode,
  2553. },
  2554. }
  2555. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2556. return nil, err
  2557. }
  2558. return ret, nil
  2559. // {
  2560. // "description": "Updates an ACL entry on the specified object. This method supports patch semantics.",
  2561. // "httpMethod": "PATCH",
  2562. // "id": "storage.objectAccessControls.patch",
  2563. // "parameterOrder": [
  2564. // "bucket",
  2565. // "object",
  2566. // "entity"
  2567. // ],
  2568. // "parameters": {
  2569. // "bucket": {
  2570. // "description": "Name of a bucket.",
  2571. // "location": "path",
  2572. // "required": true,
  2573. // "type": "string"
  2574. // },
  2575. // "entity": {
  2576. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  2577. // "location": "path",
  2578. // "required": true,
  2579. // "type": "string"
  2580. // },
  2581. // "object": {
  2582. // "description": "Name of the object.",
  2583. // "location": "path",
  2584. // "required": true,
  2585. // "type": "string"
  2586. // }
  2587. // },
  2588. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  2589. // "request": {
  2590. // "$ref": "ObjectAccessControl"
  2591. // },
  2592. // "response": {
  2593. // "$ref": "ObjectAccessControl"
  2594. // },
  2595. // "scopes": [
  2596. // "https://www.googleapis.com/auth/devstorage.full_control"
  2597. // ]
  2598. // }
  2599. }
  2600. // method id "storage.objectAccessControls.update":
  2601. type ObjectAccessControlsUpdateCall struct {
  2602. s *Service
  2603. bucket string
  2604. object string
  2605. entity string
  2606. objectaccesscontrol *ObjectAccessControl
  2607. urlParams_ gensupport.URLParams
  2608. ctx_ context.Context
  2609. }
  2610. // Update: Updates an ACL entry on the specified object.
  2611. func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
  2612. c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2613. c.bucket = bucket
  2614. c.object = object
  2615. c.entity = entity
  2616. c.objectaccesscontrol = objectaccesscontrol
  2617. return c
  2618. }
  2619. // Fields allows partial responses to be retrieved. See
  2620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2621. // for more information.
  2622. func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
  2623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2624. return c
  2625. }
  2626. // Context sets the context to be used in this call's Do method. Any
  2627. // pending HTTP request will be aborted if the provided context is
  2628. // canceled.
  2629. func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
  2630. c.ctx_ = ctx
  2631. return c
  2632. }
  2633. func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2634. var body io.Reader = nil
  2635. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  2636. if err != nil {
  2637. return nil, err
  2638. }
  2639. ctype := "application/json"
  2640. c.urlParams_.Set("alt", alt)
  2641. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  2642. urls += "?" + c.urlParams_.Encode()
  2643. req, _ := http.NewRequest("PUT", urls, body)
  2644. googleapi.Expand(req.URL, map[string]string{
  2645. "bucket": c.bucket,
  2646. "object": c.object,
  2647. "entity": c.entity,
  2648. })
  2649. req.Header.Set("Content-Type", ctype)
  2650. req.Header.Set("User-Agent", c.s.userAgent())
  2651. if c.ctx_ != nil {
  2652. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2653. }
  2654. return c.s.client.Do(req)
  2655. }
  2656. // Do executes the "storage.objectAccessControls.update" call.
  2657. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  2658. // non-2xx status code is an error. Response headers are in either
  2659. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  2660. // returned at all) in error.(*googleapi.Error).Header. Use
  2661. // googleapi.IsNotModified to check whether the returned error was
  2662. // because http.StatusNotModified was returned.
  2663. func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  2664. gensupport.SetOptions(c.urlParams_, opts...)
  2665. res, err := c.doRequest("json")
  2666. if res != nil && res.StatusCode == http.StatusNotModified {
  2667. if res.Body != nil {
  2668. res.Body.Close()
  2669. }
  2670. return nil, &googleapi.Error{
  2671. Code: res.StatusCode,
  2672. Header: res.Header,
  2673. }
  2674. }
  2675. if err != nil {
  2676. return nil, err
  2677. }
  2678. defer googleapi.CloseBody(res)
  2679. if err := googleapi.CheckResponse(res); err != nil {
  2680. return nil, err
  2681. }
  2682. ret := &ObjectAccessControl{
  2683. ServerResponse: googleapi.ServerResponse{
  2684. Header: res.Header,
  2685. HTTPStatusCode: res.StatusCode,
  2686. },
  2687. }
  2688. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2689. return nil, err
  2690. }
  2691. return ret, nil
  2692. // {
  2693. // "description": "Updates an ACL entry on the specified object.",
  2694. // "httpMethod": "PUT",
  2695. // "id": "storage.objectAccessControls.update",
  2696. // "parameterOrder": [
  2697. // "bucket",
  2698. // "object",
  2699. // "entity"
  2700. // ],
  2701. // "parameters": {
  2702. // "bucket": {
  2703. // "description": "Name of a bucket.",
  2704. // "location": "path",
  2705. // "required": true,
  2706. // "type": "string"
  2707. // },
  2708. // "entity": {
  2709. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  2710. // "location": "path",
  2711. // "required": true,
  2712. // "type": "string"
  2713. // },
  2714. // "object": {
  2715. // "description": "Name of the object.",
  2716. // "location": "path",
  2717. // "required": true,
  2718. // "type": "string"
  2719. // }
  2720. // },
  2721. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  2722. // "request": {
  2723. // "$ref": "ObjectAccessControl"
  2724. // },
  2725. // "response": {
  2726. // "$ref": "ObjectAccessControl"
  2727. // },
  2728. // "scopes": [
  2729. // "https://www.googleapis.com/auth/devstorage.full_control"
  2730. // ]
  2731. // }
  2732. }
  2733. // method id "storage.objects.delete":
  2734. type ObjectsDeleteCall struct {
  2735. s *Service
  2736. bucket string
  2737. object string
  2738. urlParams_ gensupport.URLParams
  2739. ctx_ context.Context
  2740. }
  2741. // Delete: Deletes data blobs and associated metadata.
  2742. func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
  2743. c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2744. c.bucket = bucket
  2745. c.object = object
  2746. return c
  2747. }
  2748. // Fields allows partial responses to be retrieved. See
  2749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2750. // for more information.
  2751. func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
  2752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2753. return c
  2754. }
  2755. // Context sets the context to be used in this call's Do method. Any
  2756. // pending HTTP request will be aborted if the provided context is
  2757. // canceled.
  2758. func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
  2759. c.ctx_ = ctx
  2760. return c
  2761. }
  2762. func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2763. var body io.Reader = nil
  2764. c.urlParams_.Set("alt", alt)
  2765. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  2766. urls += "?" + c.urlParams_.Encode()
  2767. req, _ := http.NewRequest("DELETE", urls, body)
  2768. googleapi.Expand(req.URL, map[string]string{
  2769. "bucket": c.bucket,
  2770. "object": c.object,
  2771. })
  2772. req.Header.Set("User-Agent", c.s.userAgent())
  2773. if c.ctx_ != nil {
  2774. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2775. }
  2776. return c.s.client.Do(req)
  2777. }
  2778. // Do executes the "storage.objects.delete" call.
  2779. func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2780. gensupport.SetOptions(c.urlParams_, opts...)
  2781. res, err := c.doRequest("json")
  2782. if err != nil {
  2783. return err
  2784. }
  2785. defer googleapi.CloseBody(res)
  2786. if err := googleapi.CheckResponse(res); err != nil {
  2787. return err
  2788. }
  2789. return nil
  2790. // {
  2791. // "description": "Deletes data blobs and associated metadata.",
  2792. // "httpMethod": "DELETE",
  2793. // "id": "storage.objects.delete",
  2794. // "parameterOrder": [
  2795. // "bucket",
  2796. // "object"
  2797. // ],
  2798. // "parameters": {
  2799. // "bucket": {
  2800. // "description": "Name of the bucket in which the object resides.",
  2801. // "location": "path",
  2802. // "required": true,
  2803. // "type": "string"
  2804. // },
  2805. // "object": {
  2806. // "description": "Name of the object.",
  2807. // "location": "path",
  2808. // "required": true,
  2809. // "type": "string"
  2810. // }
  2811. // },
  2812. // "path": "b/{bucket}/o/{object}",
  2813. // "scopes": [
  2814. // "https://www.googleapis.com/auth/devstorage.full_control",
  2815. // "https://www.googleapis.com/auth/devstorage.read_write"
  2816. // ]
  2817. // }
  2818. }
  2819. // method id "storage.objects.get":
  2820. type ObjectsGetCall struct {
  2821. s *Service
  2822. bucket string
  2823. object string
  2824. urlParams_ gensupport.URLParams
  2825. ifNoneMatch_ string
  2826. ctx_ context.Context
  2827. }
  2828. // Get: Retrieves objects or their associated metadata.
  2829. func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
  2830. c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2831. c.bucket = bucket
  2832. c.object = object
  2833. return c
  2834. }
  2835. // Projection sets the optional parameter "projection": Set of
  2836. // properties to return. Defaults to no_acl.
  2837. //
  2838. // Possible values:
  2839. // "full" - Include all properties.
  2840. // "no_acl" - Omit the acl property.
  2841. func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
  2842. c.urlParams_.Set("projection", projection)
  2843. return c
  2844. }
  2845. // Fields allows partial responses to be retrieved. See
  2846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2847. // for more information.
  2848. func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
  2849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2850. return c
  2851. }
  2852. // IfNoneMatch sets the optional parameter which makes the operation
  2853. // fail if the object's ETag matches the given value. This is useful for
  2854. // getting updates only after the object has changed since the last
  2855. // request. Use googleapi.IsNotModified to check whether the response
  2856. // error from Do is the result of In-None-Match.
  2857. func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
  2858. c.ifNoneMatch_ = entityTag
  2859. return c
  2860. }
  2861. // Context sets the context to be used in this call's Do and Download
  2862. // methods. Any pending HTTP request will be aborted if the provided
  2863. // context is canceled.
  2864. func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
  2865. c.ctx_ = ctx
  2866. return c
  2867. }
  2868. func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
  2869. var body io.Reader = nil
  2870. c.urlParams_.Set("alt", alt)
  2871. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  2872. urls += "?" + c.urlParams_.Encode()
  2873. req, _ := http.NewRequest("GET", urls, body)
  2874. googleapi.Expand(req.URL, map[string]string{
  2875. "bucket": c.bucket,
  2876. "object": c.object,
  2877. })
  2878. req.Header.Set("User-Agent", c.s.userAgent())
  2879. if c.ifNoneMatch_ != "" {
  2880. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2881. }
  2882. if c.ctx_ != nil {
  2883. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2884. }
  2885. return c.s.client.Do(req)
  2886. }
  2887. // Download fetches the API endpoint's "media" value, instead of the normal
  2888. // API response value. If the returned error is nil, the Response is guaranteed to
  2889. // have a 2xx status code. Callers must close the Response.Body as usual.
  2890. func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  2891. gensupport.SetOptions(c.urlParams_, opts...)
  2892. res, err := c.doRequest("media")
  2893. if err != nil {
  2894. return nil, err
  2895. }
  2896. if err := googleapi.CheckMediaResponse(res); err != nil {
  2897. res.Body.Close()
  2898. return nil, err
  2899. }
  2900. return res, nil
  2901. }
  2902. // Do executes the "storage.objects.get" call.
  2903. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  2904. // code is an error. Response headers are in either
  2905. // *Object.ServerResponse.Header or (if a response was returned at all)
  2906. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2907. // check whether the returned error was because http.StatusNotModified
  2908. // was returned.
  2909. func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  2910. gensupport.SetOptions(c.urlParams_, opts...)
  2911. res, err := c.doRequest("json")
  2912. if res != nil && res.StatusCode == http.StatusNotModified {
  2913. if res.Body != nil {
  2914. res.Body.Close()
  2915. }
  2916. return nil, &googleapi.Error{
  2917. Code: res.StatusCode,
  2918. Header: res.Header,
  2919. }
  2920. }
  2921. if err != nil {
  2922. return nil, err
  2923. }
  2924. defer googleapi.CloseBody(res)
  2925. if err := googleapi.CheckResponse(res); err != nil {
  2926. return nil, err
  2927. }
  2928. ret := &Object{
  2929. ServerResponse: googleapi.ServerResponse{
  2930. Header: res.Header,
  2931. HTTPStatusCode: res.StatusCode,
  2932. },
  2933. }
  2934. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2935. return nil, err
  2936. }
  2937. return ret, nil
  2938. // {
  2939. // "description": "Retrieves objects or their associated metadata.",
  2940. // "httpMethod": "GET",
  2941. // "id": "storage.objects.get",
  2942. // "parameterOrder": [
  2943. // "bucket",
  2944. // "object"
  2945. // ],
  2946. // "parameters": {
  2947. // "bucket": {
  2948. // "description": "Name of the bucket in which the object resides.",
  2949. // "location": "path",
  2950. // "required": true,
  2951. // "type": "string"
  2952. // },
  2953. // "object": {
  2954. // "description": "Name of the object.",
  2955. // "location": "path",
  2956. // "required": true,
  2957. // "type": "string"
  2958. // },
  2959. // "projection": {
  2960. // "description": "Set of properties to return. Defaults to no_acl.",
  2961. // "enum": [
  2962. // "full",
  2963. // "no_acl"
  2964. // ],
  2965. // "enumDescriptions": [
  2966. // "Include all properties.",
  2967. // "Omit the acl property."
  2968. // ],
  2969. // "location": "query",
  2970. // "type": "string"
  2971. // }
  2972. // },
  2973. // "path": "b/{bucket}/o/{object}",
  2974. // "response": {
  2975. // "$ref": "Object"
  2976. // },
  2977. // "scopes": [
  2978. // "https://www.googleapis.com/auth/devstorage.full_control",
  2979. // "https://www.googleapis.com/auth/devstorage.read_only",
  2980. // "https://www.googleapis.com/auth/devstorage.read_write"
  2981. // ],
  2982. // "supportsMediaDownload": true
  2983. // }
  2984. }
  2985. // method id "storage.objects.insert":
  2986. type ObjectsInsertCall struct {
  2987. s *Service
  2988. bucket string
  2989. object *Object
  2990. urlParams_ gensupport.URLParams
  2991. media_ io.Reader
  2992. resumableBuffer_ *gensupport.ResumableBuffer
  2993. mediaType_ string
  2994. mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
  2995. progressUpdater_ googleapi.ProgressUpdater
  2996. ctx_ context.Context
  2997. }
  2998. // Insert: Stores new data blobs and associated metadata.
  2999. func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
  3000. c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3001. c.bucket = bucket
  3002. c.object = object
  3003. return c
  3004. }
  3005. // Name sets the optional parameter "name": Name of the object. Required
  3006. // when the object metadata is not otherwise provided. Overrides the
  3007. // object metadata's name value, if any.
  3008. func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
  3009. c.urlParams_.Set("name", name)
  3010. return c
  3011. }
  3012. // Projection sets the optional parameter "projection": Set of
  3013. // properties to return. Defaults to no_acl, unless the object resource
  3014. // specifies the acl property, when it defaults to full.
  3015. //
  3016. // Possible values:
  3017. // "full" - Include all properties.
  3018. // "no_acl" - Omit the acl property.
  3019. func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
  3020. c.urlParams_.Set("projection", projection)
  3021. return c
  3022. }
  3023. // Media specifies the media to upload in one or more chunks. The chunk
  3024. // size may be controlled by supplying a MediaOption generated by
  3025. // googleapi.ChunkSize. The chunk size defaults to
  3026. // googleapi.DefaultUploadChunkSize.
  3027. // At most one of Media and ResumableMedia may be set.
  3028. func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
  3029. opts := googleapi.ProcessMediaOptions(options)
  3030. chunkSize := opts.ChunkSize
  3031. r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
  3032. c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
  3033. return c
  3034. }
  3035. // ResumableMedia specifies the media to upload in chunks and can be
  3036. // canceled with ctx.
  3037. //
  3038. // Deprecated: use Media instead.
  3039. //
  3040. // At most one of Media and ResumableMedia may be set. mediaType
  3041. // identifies the MIME media type of the upload, such as "image/png". If
  3042. // mediaType is "", it will be auto-detected. The provided ctx will
  3043. // supersede any context previously provided to the Context method.
  3044. func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
  3045. c.ctx_ = ctx
  3046. rdr := gensupport.ReaderAtToReader(r, size)
  3047. rdr, c.mediaType_ = gensupport.DetermineContentType(rdr, mediaType)
  3048. c.resumableBuffer_ = gensupport.NewResumableBuffer(rdr, googleapi.DefaultUploadChunkSize)
  3049. c.media_ = nil
  3050. c.mediaSize_ = size
  3051. return c
  3052. }
  3053. // ProgressUpdater provides a callback function that will be called
  3054. // after every chunk. It should be a low-latency function in order to
  3055. // not slow down the upload operation. This should only be called when
  3056. // using ResumableMedia (as opposed to Media).
  3057. func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
  3058. c.progressUpdater_ = pu
  3059. return c
  3060. }
  3061. // Fields allows partial responses to be retrieved. See
  3062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3063. // for more information.
  3064. func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
  3065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3066. return c
  3067. }
  3068. // Context sets the context to be used in this call's Do method. Any
  3069. // pending HTTP request will be aborted if the provided context is
  3070. // canceled.
  3071. // This context will supersede any context previously provided to the
  3072. // ResumableMedia method.
  3073. func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
  3074. c.ctx_ = ctx
  3075. return c
  3076. }
  3077. func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
  3078. var body io.Reader = nil
  3079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
  3080. if err != nil {
  3081. return nil, err
  3082. }
  3083. ctype := "application/json"
  3084. c.urlParams_.Set("alt", alt)
  3085. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
  3086. if c.media_ != nil || c.resumableBuffer_ != nil {
  3087. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3088. protocol := "multipart"
  3089. if c.resumableBuffer_ != nil {
  3090. protocol = "resumable"
  3091. }
  3092. c.urlParams_.Set("uploadType", protocol)
  3093. }
  3094. urls += "?" + c.urlParams_.Encode()
  3095. if c.media_ != nil {
  3096. var combined io.ReadCloser
  3097. combined, ctype = gensupport.CombineBodyMedia(body, ctype, c.media_, c.mediaType_)
  3098. defer combined.Close()
  3099. body = combined
  3100. }
  3101. req, _ := http.NewRequest("POST", urls, body)
  3102. googleapi.Expand(req.URL, map[string]string{
  3103. "bucket": c.bucket,
  3104. })
  3105. if c.resumableBuffer_ != nil {
  3106. req.Header.Set("X-Upload-Content-Type", c.mediaType_)
  3107. }
  3108. req.Header.Set("Content-Type", ctype)
  3109. req.Header.Set("User-Agent", c.s.userAgent())
  3110. if c.ctx_ != nil {
  3111. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3112. }
  3113. return c.s.client.Do(req)
  3114. }
  3115. // Do executes the "storage.objects.insert" call.
  3116. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  3117. // code is an error. Response headers are in either
  3118. // *Object.ServerResponse.Header or (if a response was returned at all)
  3119. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3120. // check whether the returned error was because http.StatusNotModified
  3121. // was returned.
  3122. func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  3123. gensupport.SetOptions(c.urlParams_, opts...)
  3124. res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
  3125. return c.doRequest("json")
  3126. }, gensupport.DefaultBackoffStrategy())
  3127. if res != nil && res.StatusCode == http.StatusNotModified {
  3128. if res.Body != nil {
  3129. res.Body.Close()
  3130. }
  3131. return nil, &googleapi.Error{
  3132. Code: res.StatusCode,
  3133. Header: res.Header,
  3134. }
  3135. }
  3136. if err != nil {
  3137. return nil, err
  3138. }
  3139. defer googleapi.CloseBody(res)
  3140. if err := googleapi.CheckResponse(res); err != nil {
  3141. return nil, err
  3142. }
  3143. if c.resumableBuffer_ != nil {
  3144. loc := res.Header.Get("Location")
  3145. rx := &gensupport.ResumableUpload{
  3146. Client: c.s.client,
  3147. UserAgent: c.s.userAgent(),
  3148. URI: loc,
  3149. Media: c.resumableBuffer_,
  3150. MediaType: c.mediaType_,
  3151. Callback: func(curr int64) {
  3152. if c.progressUpdater_ != nil {
  3153. c.progressUpdater_(curr, c.mediaSize_)
  3154. }
  3155. },
  3156. }
  3157. ctx := c.ctx_
  3158. if ctx == nil {
  3159. ctx = context.TODO()
  3160. }
  3161. res, err = rx.Upload(ctx)
  3162. if err != nil {
  3163. return nil, err
  3164. }
  3165. defer res.Body.Close()
  3166. if err := googleapi.CheckResponse(res); err != nil {
  3167. return nil, err
  3168. }
  3169. }
  3170. ret := &Object{
  3171. ServerResponse: googleapi.ServerResponse{
  3172. Header: res.Header,
  3173. HTTPStatusCode: res.StatusCode,
  3174. },
  3175. }
  3176. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3177. return nil, err
  3178. }
  3179. return ret, nil
  3180. // {
  3181. // "description": "Stores new data blobs and associated metadata.",
  3182. // "httpMethod": "POST",
  3183. // "id": "storage.objects.insert",
  3184. // "mediaUpload": {
  3185. // "accept": [
  3186. // "*/*"
  3187. // ],
  3188. // "protocols": {
  3189. // "resumable": {
  3190. // "multipart": true,
  3191. // "path": "/resumable/upload/storage/v1beta1/b/{bucket}/o"
  3192. // },
  3193. // "simple": {
  3194. // "multipart": true,
  3195. // "path": "/upload/storage/v1beta1/b/{bucket}/o"
  3196. // }
  3197. // }
  3198. // },
  3199. // "parameterOrder": [
  3200. // "bucket"
  3201. // ],
  3202. // "parameters": {
  3203. // "bucket": {
  3204. // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
  3205. // "location": "path",
  3206. // "required": true,
  3207. // "type": "string"
  3208. // },
  3209. // "name": {
  3210. // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
  3211. // "location": "query",
  3212. // "type": "string"
  3213. // },
  3214. // "projection": {
  3215. // "description": "Set of properties to return. Defaults to no_acl, unless the object resource specifies the acl property, when it defaults to full.",
  3216. // "enum": [
  3217. // "full",
  3218. // "no_acl"
  3219. // ],
  3220. // "enumDescriptions": [
  3221. // "Include all properties.",
  3222. // "Omit the acl property."
  3223. // ],
  3224. // "location": "query",
  3225. // "type": "string"
  3226. // }
  3227. // },
  3228. // "path": "b/{bucket}/o",
  3229. // "request": {
  3230. // "$ref": "Object"
  3231. // },
  3232. // "response": {
  3233. // "$ref": "Object"
  3234. // },
  3235. // "scopes": [
  3236. // "https://www.googleapis.com/auth/devstorage.full_control",
  3237. // "https://www.googleapis.com/auth/devstorage.read_write"
  3238. // ],
  3239. // "supportsMediaDownload": true,
  3240. // "supportsMediaUpload": true
  3241. // }
  3242. }
  3243. // method id "storage.objects.list":
  3244. type ObjectsListCall struct {
  3245. s *Service
  3246. bucket string
  3247. urlParams_ gensupport.URLParams
  3248. ifNoneMatch_ string
  3249. ctx_ context.Context
  3250. }
  3251. // List: Retrieves a list of objects matching the criteria.
  3252. func (r *ObjectsService) List(bucket string) *ObjectsListCall {
  3253. c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3254. c.bucket = bucket
  3255. return c
  3256. }
  3257. // Delimiter sets the optional parameter "delimiter": Returns results in
  3258. // a directory-like mode. items will contain only objects whose names,
  3259. // aside from the prefix, do not contain delimiter. Objects whose names,
  3260. // aside from the prefix, contain delimiter will have their name,
  3261. // truncated after the delimiter, returned in prefixes. Duplicate
  3262. // prefixes are omitted.
  3263. func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
  3264. c.urlParams_.Set("delimiter", delimiter)
  3265. return c
  3266. }
  3267. // MaxResults sets the optional parameter "max-results": Maximum number
  3268. // of items plus prefixes to return. As duplicate prefixes are omitted,
  3269. // fewer total results may be returned than requested.
  3270. func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
  3271. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  3272. return c
  3273. }
  3274. // PageToken sets the optional parameter "pageToken": A
  3275. // previously-returned page token representing part of the larger set of
  3276. // results to view.
  3277. func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
  3278. c.urlParams_.Set("pageToken", pageToken)
  3279. return c
  3280. }
  3281. // Prefix sets the optional parameter "prefix": Filter results to
  3282. // objects whose names begin with this prefix.
  3283. func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
  3284. c.urlParams_.Set("prefix", prefix)
  3285. return c
  3286. }
  3287. // Projection sets the optional parameter "projection": Set of
  3288. // properties to return. Defaults to no_acl.
  3289. //
  3290. // Possible values:
  3291. // "full" - Include all properties.
  3292. // "no_acl" - Omit the acl property.
  3293. func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
  3294. c.urlParams_.Set("projection", projection)
  3295. return c
  3296. }
  3297. // Fields allows partial responses to be retrieved. See
  3298. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3299. // for more information.
  3300. func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
  3301. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3302. return c
  3303. }
  3304. // IfNoneMatch sets the optional parameter which makes the operation
  3305. // fail if the object's ETag matches the given value. This is useful for
  3306. // getting updates only after the object has changed since the last
  3307. // request. Use googleapi.IsNotModified to check whether the response
  3308. // error from Do is the result of In-None-Match.
  3309. func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
  3310. c.ifNoneMatch_ = entityTag
  3311. return c
  3312. }
  3313. // Context sets the context to be used in this call's Do method. Any
  3314. // pending HTTP request will be aborted if the provided context is
  3315. // canceled.
  3316. func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
  3317. c.ctx_ = ctx
  3318. return c
  3319. }
  3320. func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
  3321. var body io.Reader = nil
  3322. c.urlParams_.Set("alt", alt)
  3323. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
  3324. urls += "?" + c.urlParams_.Encode()
  3325. req, _ := http.NewRequest("GET", urls, body)
  3326. googleapi.Expand(req.URL, map[string]string{
  3327. "bucket": c.bucket,
  3328. })
  3329. req.Header.Set("User-Agent", c.s.userAgent())
  3330. if c.ifNoneMatch_ != "" {
  3331. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  3332. }
  3333. if c.ctx_ != nil {
  3334. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3335. }
  3336. return c.s.client.Do(req)
  3337. }
  3338. // Do executes the "storage.objects.list" call.
  3339. // Exactly one of *Objects or error will be non-nil. Any non-2xx status
  3340. // code is an error. Response headers are in either
  3341. // *Objects.ServerResponse.Header or (if a response was returned at all)
  3342. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3343. // check whether the returned error was because http.StatusNotModified
  3344. // was returned.
  3345. func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
  3346. gensupport.SetOptions(c.urlParams_, opts...)
  3347. res, err := c.doRequest("json")
  3348. if res != nil && res.StatusCode == http.StatusNotModified {
  3349. if res.Body != nil {
  3350. res.Body.Close()
  3351. }
  3352. return nil, &googleapi.Error{
  3353. Code: res.StatusCode,
  3354. Header: res.Header,
  3355. }
  3356. }
  3357. if err != nil {
  3358. return nil, err
  3359. }
  3360. defer googleapi.CloseBody(res)
  3361. if err := googleapi.CheckResponse(res); err != nil {
  3362. return nil, err
  3363. }
  3364. ret := &Objects{
  3365. ServerResponse: googleapi.ServerResponse{
  3366. Header: res.Header,
  3367. HTTPStatusCode: res.StatusCode,
  3368. },
  3369. }
  3370. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3371. return nil, err
  3372. }
  3373. return ret, nil
  3374. // {
  3375. // "description": "Retrieves a list of objects matching the criteria.",
  3376. // "httpMethod": "GET",
  3377. // "id": "storage.objects.list",
  3378. // "parameterOrder": [
  3379. // "bucket"
  3380. // ],
  3381. // "parameters": {
  3382. // "bucket": {
  3383. // "description": "Name of the bucket in which to look for objects.",
  3384. // "location": "path",
  3385. // "required": true,
  3386. // "type": "string"
  3387. // },
  3388. // "delimiter": {
  3389. // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
  3390. // "location": "query",
  3391. // "type": "string"
  3392. // },
  3393. // "max-results": {
  3394. // "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.",
  3395. // "format": "uint32",
  3396. // "location": "query",
  3397. // "minimum": "0",
  3398. // "type": "integer"
  3399. // },
  3400. // "pageToken": {
  3401. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  3402. // "location": "query",
  3403. // "type": "string"
  3404. // },
  3405. // "prefix": {
  3406. // "description": "Filter results to objects whose names begin with this prefix.",
  3407. // "location": "query",
  3408. // "type": "string"
  3409. // },
  3410. // "projection": {
  3411. // "description": "Set of properties to return. Defaults to no_acl.",
  3412. // "enum": [
  3413. // "full",
  3414. // "no_acl"
  3415. // ],
  3416. // "enumDescriptions": [
  3417. // "Include all properties.",
  3418. // "Omit the acl property."
  3419. // ],
  3420. // "location": "query",
  3421. // "type": "string"
  3422. // }
  3423. // },
  3424. // "path": "b/{bucket}/o",
  3425. // "response": {
  3426. // "$ref": "Objects"
  3427. // },
  3428. // "scopes": [
  3429. // "https://www.googleapis.com/auth/devstorage.full_control",
  3430. // "https://www.googleapis.com/auth/devstorage.read_only",
  3431. // "https://www.googleapis.com/auth/devstorage.read_write"
  3432. // ],
  3433. // "supportsSubscription": true
  3434. // }
  3435. }
  3436. // Pages invokes f for each page of results.
  3437. // A non-nil error returned from f will halt the iteration.
  3438. // The provided context supersedes any context provided to the Context method.
  3439. func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
  3440. c.ctx_ = ctx
  3441. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3442. for {
  3443. x, err := c.Do()
  3444. if err != nil {
  3445. return err
  3446. }
  3447. if err := f(x); err != nil {
  3448. return err
  3449. }
  3450. if x.NextPageToken == "" {
  3451. return nil
  3452. }
  3453. c.PageToken(x.NextPageToken)
  3454. }
  3455. }
  3456. // method id "storage.objects.patch":
  3457. type ObjectsPatchCall struct {
  3458. s *Service
  3459. bucket string
  3460. object string
  3461. object2 *Object
  3462. urlParams_ gensupport.URLParams
  3463. ctx_ context.Context
  3464. }
  3465. // Patch: Updates a data blob's associated metadata. This method
  3466. // supports patch semantics.
  3467. func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
  3468. c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3469. c.bucket = bucket
  3470. c.object = object
  3471. c.object2 = object2
  3472. return c
  3473. }
  3474. // Projection sets the optional parameter "projection": Set of
  3475. // properties to return. Defaults to full.
  3476. //
  3477. // Possible values:
  3478. // "full" - Include all properties.
  3479. // "no_acl" - Omit the acl property.
  3480. func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
  3481. c.urlParams_.Set("projection", projection)
  3482. return c
  3483. }
  3484. // Fields allows partial responses to be retrieved. See
  3485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3486. // for more information.
  3487. func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
  3488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3489. return c
  3490. }
  3491. // Context sets the context to be used in this call's Do method. Any
  3492. // pending HTTP request will be aborted if the provided context is
  3493. // canceled.
  3494. func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
  3495. c.ctx_ = ctx
  3496. return c
  3497. }
  3498. func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
  3499. var body io.Reader = nil
  3500. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
  3501. if err != nil {
  3502. return nil, err
  3503. }
  3504. ctype := "application/json"
  3505. c.urlParams_.Set("alt", alt)
  3506. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  3507. urls += "?" + c.urlParams_.Encode()
  3508. req, _ := http.NewRequest("PATCH", urls, body)
  3509. googleapi.Expand(req.URL, map[string]string{
  3510. "bucket": c.bucket,
  3511. "object": c.object,
  3512. })
  3513. req.Header.Set("Content-Type", ctype)
  3514. req.Header.Set("User-Agent", c.s.userAgent())
  3515. if c.ctx_ != nil {
  3516. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3517. }
  3518. return c.s.client.Do(req)
  3519. }
  3520. // Do executes the "storage.objects.patch" call.
  3521. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  3522. // code is an error. Response headers are in either
  3523. // *Object.ServerResponse.Header or (if a response was returned at all)
  3524. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3525. // check whether the returned error was because http.StatusNotModified
  3526. // was returned.
  3527. func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  3528. gensupport.SetOptions(c.urlParams_, opts...)
  3529. res, err := c.doRequest("json")
  3530. if res != nil && res.StatusCode == http.StatusNotModified {
  3531. if res.Body != nil {
  3532. res.Body.Close()
  3533. }
  3534. return nil, &googleapi.Error{
  3535. Code: res.StatusCode,
  3536. Header: res.Header,
  3537. }
  3538. }
  3539. if err != nil {
  3540. return nil, err
  3541. }
  3542. defer googleapi.CloseBody(res)
  3543. if err := googleapi.CheckResponse(res); err != nil {
  3544. return nil, err
  3545. }
  3546. ret := &Object{
  3547. ServerResponse: googleapi.ServerResponse{
  3548. Header: res.Header,
  3549. HTTPStatusCode: res.StatusCode,
  3550. },
  3551. }
  3552. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3553. return nil, err
  3554. }
  3555. return ret, nil
  3556. // {
  3557. // "description": "Updates a data blob's associated metadata. This method supports patch semantics.",
  3558. // "httpMethod": "PATCH",
  3559. // "id": "storage.objects.patch",
  3560. // "parameterOrder": [
  3561. // "bucket",
  3562. // "object"
  3563. // ],
  3564. // "parameters": {
  3565. // "bucket": {
  3566. // "description": "Name of the bucket in which the object resides.",
  3567. // "location": "path",
  3568. // "required": true,
  3569. // "type": "string"
  3570. // },
  3571. // "object": {
  3572. // "description": "Name of the object.",
  3573. // "location": "path",
  3574. // "required": true,
  3575. // "type": "string"
  3576. // },
  3577. // "projection": {
  3578. // "description": "Set of properties to return. Defaults to full.",
  3579. // "enum": [
  3580. // "full",
  3581. // "no_acl"
  3582. // ],
  3583. // "enumDescriptions": [
  3584. // "Include all properties.",
  3585. // "Omit the acl property."
  3586. // ],
  3587. // "location": "query",
  3588. // "type": "string"
  3589. // }
  3590. // },
  3591. // "path": "b/{bucket}/o/{object}",
  3592. // "request": {
  3593. // "$ref": "Object"
  3594. // },
  3595. // "response": {
  3596. // "$ref": "Object"
  3597. // },
  3598. // "scopes": [
  3599. // "https://www.googleapis.com/auth/devstorage.full_control",
  3600. // "https://www.googleapis.com/auth/devstorage.read_write"
  3601. // ]
  3602. // }
  3603. }
  3604. // method id "storage.objects.update":
  3605. type ObjectsUpdateCall struct {
  3606. s *Service
  3607. bucket string
  3608. object string
  3609. object2 *Object
  3610. urlParams_ gensupport.URLParams
  3611. ctx_ context.Context
  3612. }
  3613. // Update: Updates a data blob's associated metadata.
  3614. func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
  3615. c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3616. c.bucket = bucket
  3617. c.object = object
  3618. c.object2 = object2
  3619. return c
  3620. }
  3621. // Projection sets the optional parameter "projection": Set of
  3622. // properties to return. Defaults to full.
  3623. //
  3624. // Possible values:
  3625. // "full" - Include all properties.
  3626. // "no_acl" - Omit the acl property.
  3627. func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
  3628. c.urlParams_.Set("projection", projection)
  3629. return c
  3630. }
  3631. // Fields allows partial responses to be retrieved. See
  3632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3633. // for more information.
  3634. func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
  3635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3636. return c
  3637. }
  3638. // Context sets the context to be used in this call's Do and Download
  3639. // methods. Any pending HTTP request will be aborted if the provided
  3640. // context is canceled.
  3641. func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
  3642. c.ctx_ = ctx
  3643. return c
  3644. }
  3645. func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3646. var body io.Reader = nil
  3647. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
  3648. if err != nil {
  3649. return nil, err
  3650. }
  3651. ctype := "application/json"
  3652. c.urlParams_.Set("alt", alt)
  3653. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  3654. urls += "?" + c.urlParams_.Encode()
  3655. req, _ := http.NewRequest("PUT", urls, body)
  3656. googleapi.Expand(req.URL, map[string]string{
  3657. "bucket": c.bucket,
  3658. "object": c.object,
  3659. })
  3660. req.Header.Set("Content-Type", ctype)
  3661. req.Header.Set("User-Agent", c.s.userAgent())
  3662. if c.ctx_ != nil {
  3663. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3664. }
  3665. return c.s.client.Do(req)
  3666. }
  3667. // Download fetches the API endpoint's "media" value, instead of the normal
  3668. // API response value. If the returned error is nil, the Response is guaranteed to
  3669. // have a 2xx status code. Callers must close the Response.Body as usual.
  3670. func (c *ObjectsUpdateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  3671. gensupport.SetOptions(c.urlParams_, opts...)
  3672. res, err := c.doRequest("media")
  3673. if err != nil {
  3674. return nil, err
  3675. }
  3676. if err := googleapi.CheckMediaResponse(res); err != nil {
  3677. res.Body.Close()
  3678. return nil, err
  3679. }
  3680. return res, nil
  3681. }
  3682. // Do executes the "storage.objects.update" call.
  3683. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  3684. // code is an error. Response headers are in either
  3685. // *Object.ServerResponse.Header or (if a response was returned at all)
  3686. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3687. // check whether the returned error was because http.StatusNotModified
  3688. // was returned.
  3689. func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  3690. gensupport.SetOptions(c.urlParams_, opts...)
  3691. res, err := c.doRequest("json")
  3692. if res != nil && res.StatusCode == http.StatusNotModified {
  3693. if res.Body != nil {
  3694. res.Body.Close()
  3695. }
  3696. return nil, &googleapi.Error{
  3697. Code: res.StatusCode,
  3698. Header: res.Header,
  3699. }
  3700. }
  3701. if err != nil {
  3702. return nil, err
  3703. }
  3704. defer googleapi.CloseBody(res)
  3705. if err := googleapi.CheckResponse(res); err != nil {
  3706. return nil, err
  3707. }
  3708. ret := &Object{
  3709. ServerResponse: googleapi.ServerResponse{
  3710. Header: res.Header,
  3711. HTTPStatusCode: res.StatusCode,
  3712. },
  3713. }
  3714. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3715. return nil, err
  3716. }
  3717. return ret, nil
  3718. // {
  3719. // "description": "Updates a data blob's associated metadata.",
  3720. // "httpMethod": "PUT",
  3721. // "id": "storage.objects.update",
  3722. // "parameterOrder": [
  3723. // "bucket",
  3724. // "object"
  3725. // ],
  3726. // "parameters": {
  3727. // "bucket": {
  3728. // "description": "Name of the bucket in which the object resides.",
  3729. // "location": "path",
  3730. // "required": true,
  3731. // "type": "string"
  3732. // },
  3733. // "object": {
  3734. // "description": "Name of the object.",
  3735. // "location": "path",
  3736. // "required": true,
  3737. // "type": "string"
  3738. // },
  3739. // "projection": {
  3740. // "description": "Set of properties to return. Defaults to full.",
  3741. // "enum": [
  3742. // "full",
  3743. // "no_acl"
  3744. // ],
  3745. // "enumDescriptions": [
  3746. // "Include all properties.",
  3747. // "Omit the acl property."
  3748. // ],
  3749. // "location": "query",
  3750. // "type": "string"
  3751. // }
  3752. // },
  3753. // "path": "b/{bucket}/o/{object}",
  3754. // "request": {
  3755. // "$ref": "Object"
  3756. // },
  3757. // "response": {
  3758. // "$ref": "Object"
  3759. // },
  3760. // "scopes": [
  3761. // "https://www.googleapis.com/auth/devstorage.full_control",
  3762. // "https://www.googleapis.com/auth/devstorage.read_write"
  3763. // ],
  3764. // "supportsMediaDownload": true
  3765. // }
  3766. }