25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

7195 satır
240 KiB

  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/v1beta2"
  8. // ...
  9. // storageService, err := storage.New(oauthHttpClient)
  10. package storage // import "google.golang.org/api/storage/v1beta2"
  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:v1beta2"
  41. const apiName = "storage"
  42. const apiVersion = "v1beta2"
  43. const basePath = "https://www.googleapis.com/storage/v1beta2/"
  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.Channels = NewChannelsService(s)
  61. s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
  62. s.ObjectAccessControls = NewObjectAccessControlsService(s)
  63. s.Objects = NewObjectsService(s)
  64. return s, nil
  65. }
  66. type Service struct {
  67. client *http.Client
  68. BasePath string // API endpoint base URL
  69. UserAgent string // optional additional User-Agent fragment
  70. BucketAccessControls *BucketAccessControlsService
  71. Buckets *BucketsService
  72. Channels *ChannelsService
  73. DefaultObjectAccessControls *DefaultObjectAccessControlsService
  74. ObjectAccessControls *ObjectAccessControlsService
  75. Objects *ObjectsService
  76. }
  77. func (s *Service) userAgent() string {
  78. if s.UserAgent == "" {
  79. return googleapi.UserAgent
  80. }
  81. return googleapi.UserAgent + " " + s.UserAgent
  82. }
  83. func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
  84. rs := &BucketAccessControlsService{s: s}
  85. return rs
  86. }
  87. type BucketAccessControlsService struct {
  88. s *Service
  89. }
  90. func NewBucketsService(s *Service) *BucketsService {
  91. rs := &BucketsService{s: s}
  92. return rs
  93. }
  94. type BucketsService struct {
  95. s *Service
  96. }
  97. func NewChannelsService(s *Service) *ChannelsService {
  98. rs := &ChannelsService{s: s}
  99. return rs
  100. }
  101. type ChannelsService struct {
  102. s *Service
  103. }
  104. func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
  105. rs := &DefaultObjectAccessControlsService{s: s}
  106. return rs
  107. }
  108. type DefaultObjectAccessControlsService struct {
  109. s *Service
  110. }
  111. func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
  112. rs := &ObjectAccessControlsService{s: s}
  113. return rs
  114. }
  115. type ObjectAccessControlsService struct {
  116. s *Service
  117. }
  118. func NewObjectsService(s *Service) *ObjectsService {
  119. rs := &ObjectsService{s: s}
  120. return rs
  121. }
  122. type ObjectsService struct {
  123. s *Service
  124. }
  125. // Bucket: A bucket.
  126. type Bucket struct {
  127. // Acl: Access controls on the bucket.
  128. Acl []*BucketAccessControl `json:"acl,omitempty"`
  129. // Cors: The bucket's Cross-Origin Resource Sharing (CORS)
  130. // configuration.
  131. Cors []*BucketCors `json:"cors,omitempty"`
  132. // DefaultObjectAcl: Default access controls to apply to new objects
  133. // when no ACL is provided.
  134. DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
  135. // Etag: HTTP 1.1 Entity tag for the bucket.
  136. Etag string `json:"etag,omitempty"`
  137. // Id: The ID of the bucket.
  138. Id string `json:"id,omitempty"`
  139. // Kind: The kind of item this is. For buckets, this is always
  140. // storage#bucket.
  141. Kind string `json:"kind,omitempty"`
  142. // Lifecycle: The bucket's lifecycle configuration. See object lifecycle
  143. // management for more information.
  144. Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
  145. // Location: The location of the bucket. Object data for objects in the
  146. // bucket resides in physical storage within this region. Typical values
  147. // are US and EU. Defaults to US. See the developer's guide for the
  148. // authoritative list.
  149. Location string `json:"location,omitempty"`
  150. // Logging: The bucket's logging configuration, which defines the
  151. // destination bucket and optional name prefix for the current bucket's
  152. // logs.
  153. Logging *BucketLogging `json:"logging,omitempty"`
  154. // Metageneration: The metadata generation of this bucket.
  155. Metageneration int64 `json:"metageneration,omitempty,string"`
  156. // Name: The name of the bucket.
  157. Name string `json:"name,omitempty"`
  158. // Owner: The owner of the bucket. This is always the project team's
  159. // owner group.
  160. Owner *BucketOwner `json:"owner,omitempty"`
  161. // SelfLink: The URI of this bucket.
  162. SelfLink string `json:"selfLink,omitempty"`
  163. // StorageClass: The bucket's storage class. This defines how objects in
  164. // the bucket are stored and determines the SLA and the cost of storage.
  165. // Typical values are STANDARD and DURABLE_REDUCED_AVAILABILITY.
  166. // Defaults to STANDARD. See the developer's guide for the authoritative
  167. // list.
  168. StorageClass string `json:"storageClass,omitempty"`
  169. // TimeCreated: Creation time of the bucket in RFC 3339 format.
  170. TimeCreated string `json:"timeCreated,omitempty"`
  171. // Versioning: The bucket's versioning configuration.
  172. Versioning *BucketVersioning `json:"versioning,omitempty"`
  173. // Website: The bucket's website configuration.
  174. Website *BucketWebsite `json:"website,omitempty"`
  175. // ServerResponse contains the HTTP response code and headers from the
  176. // server.
  177. googleapi.ServerResponse `json:"-"`
  178. // ForceSendFields is a list of field names (e.g. "Acl") 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. // NullFields is a list of field names (e.g. "Acl") to include in API
  186. // requests with the JSON null value. By default, fields with empty
  187. // values are omitted from API requests. However, any field with an
  188. // empty value appearing in NullFields will be sent to the server as
  189. // null. It is an error if a field in this list has a non-empty value.
  190. // This may be used to include null fields in Patch requests.
  191. NullFields []string `json:"-"`
  192. }
  193. func (s *Bucket) MarshalJSON() ([]byte, error) {
  194. type NoMethod Bucket
  195. raw := NoMethod(*s)
  196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  197. }
  198. type BucketCors struct {
  199. // MaxAgeSeconds: The value, in seconds, to return in the
  200. // Access-Control-Max-Age header used in preflight responses.
  201. MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
  202. // Method: The list of HTTP methods on which to include CORS response
  203. // headers: GET, OPTIONS, POST, etc. Note, "*" is permitted in the list
  204. // of methods, and means "any method".
  205. Method []string `json:"method,omitempty"`
  206. // Origin: The list of Origins eligible to receive CORS response
  207. // headers. Note: "*" is permitted in the list of origins, and means
  208. // "any Origin".
  209. Origin []string `json:"origin,omitempty"`
  210. // ResponseHeader: The list of HTTP headers other than the simple
  211. // response headers to give permission for the user-agent to share
  212. // across domains.
  213. ResponseHeader []string `json:"responseHeader,omitempty"`
  214. // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to
  215. // unconditionally include in API requests. By default, fields with
  216. // empty values are omitted from API requests. However, any non-pointer,
  217. // non-interface field appearing in ForceSendFields will be sent to the
  218. // server regardless of whether the field is empty or not. This may be
  219. // used to include empty fields in Patch requests.
  220. ForceSendFields []string `json:"-"`
  221. // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
  222. // in API requests with the JSON null value. By default, fields with
  223. // empty values are omitted from API requests. However, any field with
  224. // an empty value appearing in NullFields will be sent to the server as
  225. // null. It is an error if a field in this list has a non-empty value.
  226. // This may be used to include null fields in Patch requests.
  227. NullFields []string `json:"-"`
  228. }
  229. func (s *BucketCors) MarshalJSON() ([]byte, error) {
  230. type NoMethod BucketCors
  231. raw := NoMethod(*s)
  232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  233. }
  234. // BucketLifecycle: The bucket's lifecycle configuration. See object
  235. // lifecycle management for more information.
  236. type BucketLifecycle struct {
  237. // Rule: A lifecycle management rule, which is made of an action to take
  238. // and the condition(s) under which the action will be taken.
  239. Rule []*BucketLifecycleRule `json:"rule,omitempty"`
  240. // ForceSendFields is a list of field names (e.g. "Rule") to
  241. // unconditionally include in API requests. By default, fields with
  242. // empty values are omitted from API requests. However, any non-pointer,
  243. // non-interface field appearing in ForceSendFields will be sent to the
  244. // server regardless of whether the field is empty or not. This may be
  245. // used to include empty fields in Patch requests.
  246. ForceSendFields []string `json:"-"`
  247. // NullFields is a list of field names (e.g. "Rule") to include in API
  248. // requests with the JSON null value. By default, fields with empty
  249. // values are omitted from API requests. However, any field with an
  250. // empty value appearing in NullFields will be sent to the server as
  251. // null. It is an error if a field in this list has a non-empty value.
  252. // This may be used to include null fields in Patch requests.
  253. NullFields []string `json:"-"`
  254. }
  255. func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
  256. type NoMethod BucketLifecycle
  257. raw := NoMethod(*s)
  258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  259. }
  260. type BucketLifecycleRule struct {
  261. // Action: The action to take.
  262. Action *BucketLifecycleRuleAction `json:"action,omitempty"`
  263. // Condition: The condition(s) under which the action will be taken.
  264. Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
  265. // ForceSendFields is a list of field names (e.g. "Action") to
  266. // unconditionally include in API requests. By default, fields with
  267. // empty values are omitted from API requests. However, any non-pointer,
  268. // non-interface field appearing in ForceSendFields will be sent to the
  269. // server regardless of whether the field is empty or not. This may be
  270. // used to include empty fields in Patch requests.
  271. ForceSendFields []string `json:"-"`
  272. // NullFields is a list of field names (e.g. "Action") to include in API
  273. // requests with the JSON null value. By default, fields with empty
  274. // values are omitted from API requests. However, any field with an
  275. // empty value appearing in NullFields will be sent to the server as
  276. // null. It is an error if a field in this list has a non-empty value.
  277. // This may be used to include null fields in Patch requests.
  278. NullFields []string `json:"-"`
  279. }
  280. func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
  281. type NoMethod BucketLifecycleRule
  282. raw := NoMethod(*s)
  283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  284. }
  285. // BucketLifecycleRuleAction: The action to take.
  286. type BucketLifecycleRuleAction struct {
  287. // Type: Type of the action. Currently only Delete is supported.
  288. Type string `json:"type,omitempty"`
  289. // ForceSendFields is a list of field names (e.g. "Type") to
  290. // unconditionally include in API requests. By default, fields with
  291. // empty values are omitted from API requests. However, any non-pointer,
  292. // non-interface field appearing in ForceSendFields will be sent to the
  293. // server regardless of whether the field is empty or not. This may be
  294. // used to include empty fields in Patch requests.
  295. ForceSendFields []string `json:"-"`
  296. // NullFields is a list of field names (e.g. "Type") to include in API
  297. // requests with the JSON null value. By default, fields with empty
  298. // values are omitted from API requests. However, any field with an
  299. // empty value appearing in NullFields will be sent to the server as
  300. // null. It is an error if a field in this list has a non-empty value.
  301. // This may be used to include null fields in Patch requests.
  302. NullFields []string `json:"-"`
  303. }
  304. func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
  305. type NoMethod BucketLifecycleRuleAction
  306. raw := NoMethod(*s)
  307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  308. }
  309. // BucketLifecycleRuleCondition: The condition(s) under which the action
  310. // will be taken.
  311. type BucketLifecycleRuleCondition struct {
  312. // Age: Age of an object (in days). This condition is satisfied when an
  313. // object reaches the specified age.
  314. Age int64 `json:"age,omitempty"`
  315. // CreatedBefore: A date in RFC 3339 format with only the date part,
  316. // e.g. "2013-01-15". This condition is satisfied when an object is
  317. // created before midnight of the specified date in UTC.
  318. CreatedBefore string `json:"createdBefore,omitempty"`
  319. // IsLive: Relevant only for versioned objects. If the value is true,
  320. // this condition matches live objects; if the value is false, it
  321. // matches archived objects.
  322. IsLive *bool `json:"isLive,omitempty"`
  323. // NumNewerVersions: Relevant only for versioned objects. If the value
  324. // is N, this condition is satisfied when there are at least N versions
  325. // (including the live version) newer than this version of the object.
  326. NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
  327. // ForceSendFields is a list of field names (e.g. "Age") 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. // NullFields is a list of field names (e.g. "Age") to include in API
  335. // requests with the JSON null value. By default, fields with empty
  336. // values are omitted from API requests. However, any field with an
  337. // empty value appearing in NullFields will be sent to the server as
  338. // null. It is an error if a field in this list has a non-empty value.
  339. // This may be used to include null fields in Patch requests.
  340. NullFields []string `json:"-"`
  341. }
  342. func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
  343. type NoMethod BucketLifecycleRuleCondition
  344. raw := NoMethod(*s)
  345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  346. }
  347. // BucketLogging: The bucket's logging configuration, which defines the
  348. // destination bucket and optional name prefix for the current bucket's
  349. // logs.
  350. type BucketLogging struct {
  351. // LogBucket: The destination bucket where the current bucket's logs
  352. // should be placed.
  353. LogBucket string `json:"logBucket,omitempty"`
  354. // LogObjectPrefix: A prefix for log object names.
  355. LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
  356. // ForceSendFields is a list of field names (e.g. "LogBucket") to
  357. // unconditionally include in API requests. By default, fields with
  358. // empty values are omitted from API requests. However, any non-pointer,
  359. // non-interface field appearing in ForceSendFields will be sent to the
  360. // server regardless of whether the field is empty or not. This may be
  361. // used to include empty fields in Patch requests.
  362. ForceSendFields []string `json:"-"`
  363. // NullFields is a list of field names (e.g. "LogBucket") to include in
  364. // API requests with the JSON null value. By default, fields with empty
  365. // values are omitted from API requests. However, any field with an
  366. // empty value appearing in NullFields will be sent to the server as
  367. // null. It is an error if a field in this list has a non-empty value.
  368. // This may be used to include null fields in Patch requests.
  369. NullFields []string `json:"-"`
  370. }
  371. func (s *BucketLogging) MarshalJSON() ([]byte, error) {
  372. type NoMethod BucketLogging
  373. raw := NoMethod(*s)
  374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  375. }
  376. // BucketOwner: The owner of the bucket. This is always the project
  377. // team's owner group.
  378. type BucketOwner struct {
  379. // Entity: The entity, in the form group-groupId.
  380. Entity string `json:"entity,omitempty"`
  381. // EntityId: The ID for the entity.
  382. EntityId string `json:"entityId,omitempty"`
  383. // ForceSendFields is a list of field names (e.g. "Entity") to
  384. // unconditionally include in API requests. By default, fields with
  385. // empty values are omitted from API requests. However, any non-pointer,
  386. // non-interface field appearing in ForceSendFields will be sent to the
  387. // server regardless of whether the field is empty or not. This may be
  388. // used to include empty fields in Patch requests.
  389. ForceSendFields []string `json:"-"`
  390. // NullFields is a list of field names (e.g. "Entity") to include in API
  391. // requests with the JSON null value. By default, fields with empty
  392. // values are omitted from API requests. However, any field with an
  393. // empty value appearing in NullFields will be sent to the server as
  394. // null. It is an error if a field in this list has a non-empty value.
  395. // This may be used to include null fields in Patch requests.
  396. NullFields []string `json:"-"`
  397. }
  398. func (s *BucketOwner) MarshalJSON() ([]byte, error) {
  399. type NoMethod BucketOwner
  400. raw := NoMethod(*s)
  401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  402. }
  403. // BucketVersioning: The bucket's versioning configuration.
  404. type BucketVersioning struct {
  405. // Enabled: While set to true, versioning is fully enabled for this
  406. // bucket.
  407. Enabled bool `json:"enabled,omitempty"`
  408. // ForceSendFields is a list of field names (e.g. "Enabled") to
  409. // unconditionally include in API requests. By default, fields with
  410. // empty values are omitted from API requests. However, any non-pointer,
  411. // non-interface field appearing in ForceSendFields will be sent to the
  412. // server regardless of whether the field is empty or not. This may be
  413. // used to include empty fields in Patch requests.
  414. ForceSendFields []string `json:"-"`
  415. // NullFields is a list of field names (e.g. "Enabled") to include in
  416. // API requests with the JSON null value. By default, fields with empty
  417. // values are omitted from API requests. However, any field with an
  418. // empty value appearing in NullFields will be sent to the server as
  419. // null. It is an error if a field in this list has a non-empty value.
  420. // This may be used to include null fields in Patch requests.
  421. NullFields []string `json:"-"`
  422. }
  423. func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
  424. type NoMethod BucketVersioning
  425. raw := NoMethod(*s)
  426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  427. }
  428. // BucketWebsite: The bucket's website configuration.
  429. type BucketWebsite struct {
  430. // MainPageSuffix: Behaves as the bucket's directory index where missing
  431. // objects are treated as potential directories.
  432. MainPageSuffix string `json:"mainPageSuffix,omitempty"`
  433. // NotFoundPage: The custom object to return when a requested resource
  434. // is not found.
  435. NotFoundPage string `json:"notFoundPage,omitempty"`
  436. // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to
  437. // unconditionally include in API requests. By default, fields with
  438. // empty values are omitted from API requests. However, any non-pointer,
  439. // non-interface field appearing in ForceSendFields will be sent to the
  440. // server regardless of whether the field is empty or not. This may be
  441. // used to include empty fields in Patch requests.
  442. ForceSendFields []string `json:"-"`
  443. // NullFields is a list of field names (e.g. "MainPageSuffix") to
  444. // include in API requests with the JSON null value. By default, fields
  445. // with empty values are omitted from API requests. However, any field
  446. // with an empty value appearing in NullFields will be sent to the
  447. // server as null. It is an error if a field in this list has a
  448. // non-empty value. This may be used to include null fields in Patch
  449. // requests.
  450. NullFields []string `json:"-"`
  451. }
  452. func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
  453. type NoMethod BucketWebsite
  454. raw := NoMethod(*s)
  455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  456. }
  457. // BucketAccessControl: An access-control entry.
  458. type BucketAccessControl struct {
  459. // Bucket: The name of the bucket.
  460. Bucket string `json:"bucket,omitempty"`
  461. // Domain: The domain associated with the entity, if any.
  462. Domain string `json:"domain,omitempty"`
  463. // Email: The email address associated with the entity, if any.
  464. Email string `json:"email,omitempty"`
  465. // Entity: The entity holding the permission, in one of the following
  466. // forms:
  467. // - user-userId
  468. // - user-email
  469. // - group-groupId
  470. // - group-email
  471. // - domain-domain
  472. // - allUsers
  473. // - allAuthenticatedUsers Examples:
  474. // - The user liz@example.com would be user-liz@example.com.
  475. // - The group example@googlegroups.com would be
  476. // group-example@googlegroups.com.
  477. // - To refer to all members of the Google Apps for Business domain
  478. // example.com, the entity would be domain-example.com.
  479. Entity string `json:"entity,omitempty"`
  480. // EntityId: The ID for the entity, if any.
  481. EntityId string `json:"entityId,omitempty"`
  482. // Etag: HTTP 1.1 Entity tag for the access-control entry.
  483. Etag string `json:"etag,omitempty"`
  484. // Id: The ID of the access-control entry.
  485. Id string `json:"id,omitempty"`
  486. // Kind: The kind of item this is. For bucket access control entries,
  487. // this is always storage#bucketAccessControl.
  488. Kind string `json:"kind,omitempty"`
  489. // Role: The access permission for the entity. Can be READER, WRITER, or
  490. // OWNER.
  491. Role string `json:"role,omitempty"`
  492. // SelfLink: The link to this access-control entry.
  493. SelfLink string `json:"selfLink,omitempty"`
  494. // ServerResponse contains the HTTP response code and headers from the
  495. // server.
  496. googleapi.ServerResponse `json:"-"`
  497. // ForceSendFields is a list of field names (e.g. "Bucket") to
  498. // unconditionally include in API requests. By default, fields with
  499. // empty values are omitted from API requests. However, any non-pointer,
  500. // non-interface field appearing in ForceSendFields will be sent to the
  501. // server regardless of whether the field is empty or not. This may be
  502. // used to include empty fields in Patch requests.
  503. ForceSendFields []string `json:"-"`
  504. // NullFields is a list of field names (e.g. "Bucket") to include in API
  505. // requests with the JSON null value. By default, fields with empty
  506. // values are omitted from API requests. However, any field with an
  507. // empty value appearing in NullFields will be sent to the server as
  508. // null. It is an error if a field in this list has a non-empty value.
  509. // This may be used to include null fields in Patch requests.
  510. NullFields []string `json:"-"`
  511. }
  512. func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
  513. type NoMethod BucketAccessControl
  514. raw := NoMethod(*s)
  515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  516. }
  517. // BucketAccessControls: An access-control list.
  518. type BucketAccessControls struct {
  519. // Items: The list of items.
  520. Items []*BucketAccessControl `json:"items,omitempty"`
  521. // Kind: The kind of item this is. For lists of bucket access control
  522. // entries, this is always storage#bucketAccessControls.
  523. Kind string `json:"kind,omitempty"`
  524. // ServerResponse contains the HTTP response code and headers from the
  525. // server.
  526. googleapi.ServerResponse `json:"-"`
  527. // ForceSendFields is a list of field names (e.g. "Items") to
  528. // unconditionally include in API requests. By default, fields with
  529. // empty values are omitted from API requests. However, any non-pointer,
  530. // non-interface field appearing in ForceSendFields will be sent to the
  531. // server regardless of whether the field is empty or not. This may be
  532. // used to include empty fields in Patch requests.
  533. ForceSendFields []string `json:"-"`
  534. // NullFields is a list of field names (e.g. "Items") to include in API
  535. // requests with the JSON null value. By default, fields with empty
  536. // values are omitted from API requests. However, any field with an
  537. // empty value appearing in NullFields will be sent to the server as
  538. // null. It is an error if a field in this list has a non-empty value.
  539. // This may be used to include null fields in Patch requests.
  540. NullFields []string `json:"-"`
  541. }
  542. func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
  543. type NoMethod BucketAccessControls
  544. raw := NoMethod(*s)
  545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  546. }
  547. // Buckets: A list of buckets.
  548. type Buckets struct {
  549. // Items: The list of items.
  550. Items []*Bucket `json:"items,omitempty"`
  551. // Kind: The kind of item this is. For lists of buckets, this is always
  552. // storage#buckets.
  553. Kind string `json:"kind,omitempty"`
  554. // NextPageToken: The continuation token, used to page through large
  555. // result sets. Provide this value in a subsequent request to return the
  556. // next page of results.
  557. NextPageToken string `json:"nextPageToken,omitempty"`
  558. // ServerResponse contains the HTTP response code and headers from the
  559. // server.
  560. googleapi.ServerResponse `json:"-"`
  561. // ForceSendFields is a list of field names (e.g. "Items") to
  562. // unconditionally include in API requests. By default, fields with
  563. // empty values are omitted from API requests. However, any non-pointer,
  564. // non-interface field appearing in ForceSendFields will be sent to the
  565. // server regardless of whether the field is empty or not. This may be
  566. // used to include empty fields in Patch requests.
  567. ForceSendFields []string `json:"-"`
  568. // NullFields is a list of field names (e.g. "Items") to include in API
  569. // requests with the JSON null value. By default, fields with empty
  570. // values are omitted from API requests. However, any field with an
  571. // empty value appearing in NullFields will be sent to the server as
  572. // null. It is an error if a field in this list has a non-empty value.
  573. // This may be used to include null fields in Patch requests.
  574. NullFields []string `json:"-"`
  575. }
  576. func (s *Buckets) MarshalJSON() ([]byte, error) {
  577. type NoMethod Buckets
  578. raw := NoMethod(*s)
  579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  580. }
  581. // Channel: An notification channel used to watch for resource changes.
  582. type Channel struct {
  583. // Address: The address where notifications are delivered for this
  584. // channel.
  585. Address string `json:"address,omitempty"`
  586. // Expiration: Date and time of notification channel expiration,
  587. // expressed as a Unix timestamp, in milliseconds. Optional.
  588. Expiration int64 `json:"expiration,omitempty,string"`
  589. // Id: A UUID or similar unique string that identifies this channel.
  590. Id string `json:"id,omitempty"`
  591. // Kind: Identifies this as a notification channel used to watch for
  592. // changes to a resource. Value: the fixed string "api#channel".
  593. Kind string `json:"kind,omitempty"`
  594. // Params: Additional parameters controlling delivery channel behavior.
  595. // Optional.
  596. Params map[string]string `json:"params,omitempty"`
  597. // Payload: A Boolean value to indicate whether payload is wanted.
  598. // Optional.
  599. Payload bool `json:"payload,omitempty"`
  600. // ResourceId: An opaque ID that identifies the resource being watched
  601. // on this channel. Stable across different API versions.
  602. ResourceId string `json:"resourceId,omitempty"`
  603. // ResourceUri: A version-specific identifier for the watched resource.
  604. ResourceUri string `json:"resourceUri,omitempty"`
  605. // Token: An arbitrary string delivered to the target address with each
  606. // notification delivered over this channel. Optional.
  607. Token string `json:"token,omitempty"`
  608. // Type: The type of delivery mechanism used for this channel.
  609. Type string `json:"type,omitempty"`
  610. // ServerResponse contains the HTTP response code and headers from the
  611. // server.
  612. googleapi.ServerResponse `json:"-"`
  613. // ForceSendFields is a list of field names (e.g. "Address") to
  614. // unconditionally include in API requests. By default, fields with
  615. // empty values are omitted from API requests. However, any non-pointer,
  616. // non-interface field appearing in ForceSendFields will be sent to the
  617. // server regardless of whether the field is empty or not. This may be
  618. // used to include empty fields in Patch requests.
  619. ForceSendFields []string `json:"-"`
  620. // NullFields is a list of field names (e.g. "Address") to include in
  621. // API requests with the JSON null value. By default, fields with empty
  622. // values are omitted from API requests. However, any field with an
  623. // empty value appearing in NullFields will be sent to the server as
  624. // null. It is an error if a field in this list has a non-empty value.
  625. // This may be used to include null fields in Patch requests.
  626. NullFields []string `json:"-"`
  627. }
  628. func (s *Channel) MarshalJSON() ([]byte, error) {
  629. type NoMethod Channel
  630. raw := NoMethod(*s)
  631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  632. }
  633. // ComposeRequest: A Compose request.
  634. type ComposeRequest struct {
  635. // Destination: Properties of the resulting object
  636. Destination *Object `json:"destination,omitempty"`
  637. // Kind: The kind of item this is.
  638. Kind string `json:"kind,omitempty"`
  639. // SourceObjects: The list of source objects that will be concatenated
  640. // into a single object.
  641. SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
  642. // ForceSendFields is a list of field names (e.g. "Destination") to
  643. // unconditionally include in API requests. By default, fields with
  644. // empty values are omitted from API requests. However, any non-pointer,
  645. // non-interface field appearing in ForceSendFields will be sent to the
  646. // server regardless of whether the field is empty or not. This may be
  647. // used to include empty fields in Patch requests.
  648. ForceSendFields []string `json:"-"`
  649. // NullFields is a list of field names (e.g. "Destination") to include
  650. // in API requests with the JSON null value. By default, fields with
  651. // empty values are omitted from API requests. However, any field with
  652. // an empty value appearing in NullFields will be sent to the server as
  653. // null. It is an error if a field in this list has a non-empty value.
  654. // This may be used to include null fields in Patch requests.
  655. NullFields []string `json:"-"`
  656. }
  657. func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
  658. type NoMethod ComposeRequest
  659. raw := NoMethod(*s)
  660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  661. }
  662. type ComposeRequestSourceObjects struct {
  663. // Generation: The generation of this object to use as the source.
  664. Generation int64 `json:"generation,omitempty,string"`
  665. // Name: The source object's name. The source object's bucket is
  666. // implicitly the destination bucket.
  667. Name string `json:"name,omitempty"`
  668. // ObjectPreconditions: Conditions that must be met for this operation
  669. // to execute.
  670. ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
  671. // ForceSendFields is a list of field names (e.g. "Generation") to
  672. // unconditionally include in API requests. By default, fields with
  673. // empty values are omitted from API requests. However, any non-pointer,
  674. // non-interface field appearing in ForceSendFields will be sent to the
  675. // server regardless of whether the field is empty or not. This may be
  676. // used to include empty fields in Patch requests.
  677. ForceSendFields []string `json:"-"`
  678. // NullFields is a list of field names (e.g. "Generation") to include in
  679. // API requests with the JSON null value. By default, fields with empty
  680. // values are omitted from API requests. However, any field with an
  681. // empty value appearing in NullFields will be sent to the server as
  682. // null. It is an error if a field in this list has a non-empty value.
  683. // This may be used to include null fields in Patch requests.
  684. NullFields []string `json:"-"`
  685. }
  686. func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
  687. type NoMethod ComposeRequestSourceObjects
  688. raw := NoMethod(*s)
  689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  690. }
  691. // ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
  692. // be met for this operation to execute.
  693. type ComposeRequestSourceObjectsObjectPreconditions struct {
  694. // IfGenerationMatch: Only perform the composition if the generation of
  695. // the source object that would be used matches this value. If this
  696. // value and a generation are both specified, they must be the same
  697. // value or the call will fail.
  698. IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
  699. // ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
  700. // to unconditionally include in API requests. By default, fields with
  701. // empty values are omitted from API requests. However, any non-pointer,
  702. // non-interface field appearing in ForceSendFields will be sent to the
  703. // server regardless of whether the field is empty or not. This may be
  704. // used to include empty fields in Patch requests.
  705. ForceSendFields []string `json:"-"`
  706. // NullFields is a list of field names (e.g. "IfGenerationMatch") to
  707. // include in API requests with the JSON null value. By default, fields
  708. // with empty values are omitted from API requests. However, any field
  709. // with an empty value appearing in NullFields will be sent to the
  710. // server as null. It is an error if a field in this list has a
  711. // non-empty value. This may be used to include null fields in Patch
  712. // requests.
  713. NullFields []string `json:"-"`
  714. }
  715. func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
  716. type NoMethod ComposeRequestSourceObjectsObjectPreconditions
  717. raw := NoMethod(*s)
  718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  719. }
  720. // Object: An object.
  721. type Object struct {
  722. // Acl: Access controls on the object.
  723. Acl []*ObjectAccessControl `json:"acl,omitempty"`
  724. // Bucket: The bucket containing this object.
  725. Bucket string `json:"bucket,omitempty"`
  726. // CacheControl: Cache-Control directive for the object data.
  727. CacheControl string `json:"cacheControl,omitempty"`
  728. // ComponentCount: Number of underlying components that make up this
  729. // object. Components are accumulated by compose operations and are
  730. // limited to a count of 32.
  731. ComponentCount int64 `json:"componentCount,omitempty"`
  732. // ContentDisposition: Content-Disposition of the object data.
  733. ContentDisposition string `json:"contentDisposition,omitempty"`
  734. // ContentEncoding: Content-Encoding of the object data.
  735. ContentEncoding string `json:"contentEncoding,omitempty"`
  736. // ContentLanguage: Content-Language of the object data.
  737. ContentLanguage string `json:"contentLanguage,omitempty"`
  738. // ContentType: Content-Type of the object data.
  739. ContentType string `json:"contentType,omitempty"`
  740. // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
  741. // encoded using base64.
  742. Crc32c string `json:"crc32c,omitempty"`
  743. // Etag: HTTP 1.1 Entity tag for the object.
  744. Etag string `json:"etag,omitempty"`
  745. // Generation: The content generation of this object. Used for object
  746. // versioning.
  747. Generation int64 `json:"generation,omitempty,string"`
  748. // Id: The ID of the object.
  749. Id string `json:"id,omitempty"`
  750. // Kind: The kind of item this is. For objects, this is always
  751. // storage#object.
  752. Kind string `json:"kind,omitempty"`
  753. // Md5Hash: MD5 hash of the data; encoded using base64.
  754. Md5Hash string `json:"md5Hash,omitempty"`
  755. // MediaLink: Media download link.
  756. MediaLink string `json:"mediaLink,omitempty"`
  757. // Metadata: User-provided metadata, in key/value pairs.
  758. Metadata map[string]string `json:"metadata,omitempty"`
  759. // Metageneration: The generation of the metadata for this object at
  760. // this generation. Used for metadata versioning. Has no meaning outside
  761. // of the context of this generation.
  762. Metageneration int64 `json:"metageneration,omitempty,string"`
  763. // Name: The name of this object. Required if not specified by URL
  764. // parameter.
  765. Name string `json:"name,omitempty"`
  766. // Owner: The owner of the object. This will always be the uploader of
  767. // the object.
  768. Owner *ObjectOwner `json:"owner,omitempty"`
  769. // SelfLink: The link to this object.
  770. SelfLink string `json:"selfLink,omitempty"`
  771. // Size: Content-Length of the data in bytes.
  772. Size uint64 `json:"size,omitempty,string"`
  773. // StorageClass: Storage class of the object.
  774. StorageClass string `json:"storageClass,omitempty"`
  775. // TimeDeleted: Deletion time of the object in RFC 3339 format. Will be
  776. // returned if and only if this version of the object has been deleted.
  777. TimeDeleted string `json:"timeDeleted,omitempty"`
  778. // Updated: Modification time of the object metadata in RFC 3339 format.
  779. Updated string `json:"updated,omitempty"`
  780. // ServerResponse contains the HTTP response code and headers from the
  781. // server.
  782. googleapi.ServerResponse `json:"-"`
  783. // ForceSendFields is a list of field names (e.g. "Acl") to
  784. // unconditionally include in API requests. By default, fields with
  785. // empty values are omitted from API requests. However, any non-pointer,
  786. // non-interface field appearing in ForceSendFields will be sent to the
  787. // server regardless of whether the field is empty or not. This may be
  788. // used to include empty fields in Patch requests.
  789. ForceSendFields []string `json:"-"`
  790. // NullFields is a list of field names (e.g. "Acl") to include in API
  791. // requests with the JSON null value. By default, fields with empty
  792. // values are omitted from API requests. However, any field with an
  793. // empty value appearing in NullFields will be sent to the server as
  794. // null. It is an error if a field in this list has a non-empty value.
  795. // This may be used to include null fields in Patch requests.
  796. NullFields []string `json:"-"`
  797. }
  798. func (s *Object) MarshalJSON() ([]byte, error) {
  799. type NoMethod Object
  800. raw := NoMethod(*s)
  801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  802. }
  803. // ObjectOwner: The owner of the object. This will always be the
  804. // uploader of the object.
  805. type ObjectOwner struct {
  806. // Entity: The entity, in the form user-userId.
  807. Entity string `json:"entity,omitempty"`
  808. // EntityId: The ID for the entity.
  809. EntityId string `json:"entityId,omitempty"`
  810. // ForceSendFields is a list of field names (e.g. "Entity") to
  811. // unconditionally include in API requests. By default, fields with
  812. // empty values are omitted from API requests. However, any non-pointer,
  813. // non-interface field appearing in ForceSendFields will be sent to the
  814. // server regardless of whether the field is empty or not. This may be
  815. // used to include empty fields in Patch requests.
  816. ForceSendFields []string `json:"-"`
  817. // NullFields is a list of field names (e.g. "Entity") to include in API
  818. // requests with the JSON null value. By default, fields with empty
  819. // values are omitted from API requests. However, any field with an
  820. // empty value appearing in NullFields will be sent to the server as
  821. // null. It is an error if a field in this list has a non-empty value.
  822. // This may be used to include null fields in Patch requests.
  823. NullFields []string `json:"-"`
  824. }
  825. func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
  826. type NoMethod ObjectOwner
  827. raw := NoMethod(*s)
  828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  829. }
  830. // ObjectAccessControl: An access-control entry.
  831. type ObjectAccessControl struct {
  832. // Bucket: The name of the bucket.
  833. Bucket string `json:"bucket,omitempty"`
  834. // Domain: The domain associated with the entity, if any.
  835. Domain string `json:"domain,omitempty"`
  836. // Email: The email address associated with the entity, if any.
  837. Email string `json:"email,omitempty"`
  838. // Entity: The entity holding the permission, in one of the following
  839. // forms:
  840. // - user-userId
  841. // - user-email
  842. // - group-groupId
  843. // - group-email
  844. // - domain-domain
  845. // - allUsers
  846. // - allAuthenticatedUsers Examples:
  847. // - The user liz@example.com would be user-liz@example.com.
  848. // - The group example@googlegroups.com would be
  849. // group-example@googlegroups.com.
  850. // - To refer to all members of the Google Apps for Business domain
  851. // example.com, the entity would be domain-example.com.
  852. Entity string `json:"entity,omitempty"`
  853. // EntityId: The ID for the entity, if any.
  854. EntityId string `json:"entityId,omitempty"`
  855. // Etag: HTTP 1.1 Entity tag for the access-control entry.
  856. Etag string `json:"etag,omitempty"`
  857. // Generation: The content generation of the object.
  858. Generation int64 `json:"generation,omitempty,string"`
  859. // Id: The ID of the access-control entry.
  860. Id string `json:"id,omitempty"`
  861. // Kind: The kind of item this is. For object access control entries,
  862. // this is always storage#objectAccessControl.
  863. Kind string `json:"kind,omitempty"`
  864. // Object: The name of the object.
  865. Object string `json:"object,omitempty"`
  866. // Role: The access permission for the entity. Can be READER or OWNER.
  867. Role string `json:"role,omitempty"`
  868. // SelfLink: The link to this access-control entry.
  869. SelfLink string `json:"selfLink,omitempty"`
  870. // ServerResponse contains the HTTP response code and headers from the
  871. // server.
  872. googleapi.ServerResponse `json:"-"`
  873. // ForceSendFields is a list of field names (e.g. "Bucket") to
  874. // unconditionally include in API requests. By default, fields with
  875. // empty values are omitted from API requests. However, any non-pointer,
  876. // non-interface field appearing in ForceSendFields will be sent to the
  877. // server regardless of whether the field is empty or not. This may be
  878. // used to include empty fields in Patch requests.
  879. ForceSendFields []string `json:"-"`
  880. // NullFields is a list of field names (e.g. "Bucket") to include in API
  881. // requests with the JSON null value. By default, fields with empty
  882. // values are omitted from API requests. However, any field with an
  883. // empty value appearing in NullFields will be sent to the server as
  884. // null. It is an error if a field in this list has a non-empty value.
  885. // This may be used to include null fields in Patch requests.
  886. NullFields []string `json:"-"`
  887. }
  888. func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
  889. type NoMethod ObjectAccessControl
  890. raw := NoMethod(*s)
  891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  892. }
  893. // ObjectAccessControls: An access-control list.
  894. type ObjectAccessControls struct {
  895. // Items: The list of items.
  896. Items []interface{} `json:"items,omitempty"`
  897. // Kind: The kind of item this is. For lists of object access control
  898. // entries, this is always storage#objectAccessControls.
  899. Kind string `json:"kind,omitempty"`
  900. // ServerResponse contains the HTTP response code and headers from the
  901. // server.
  902. googleapi.ServerResponse `json:"-"`
  903. // ForceSendFields is a list of field names (e.g. "Items") to
  904. // unconditionally include in API requests. By default, fields with
  905. // empty values are omitted from API requests. However, any non-pointer,
  906. // non-interface field appearing in ForceSendFields will be sent to the
  907. // server regardless of whether the field is empty or not. This may be
  908. // used to include empty fields in Patch requests.
  909. ForceSendFields []string `json:"-"`
  910. // NullFields is a list of field names (e.g. "Items") to include in API
  911. // requests with the JSON null value. By default, fields with empty
  912. // values are omitted from API requests. However, any field with an
  913. // empty value appearing in NullFields will be sent to the server as
  914. // null. It is an error if a field in this list has a non-empty value.
  915. // This may be used to include null fields in Patch requests.
  916. NullFields []string `json:"-"`
  917. }
  918. func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
  919. type NoMethod ObjectAccessControls
  920. raw := NoMethod(*s)
  921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  922. }
  923. // Objects: A list of objects.
  924. type Objects struct {
  925. // Items: The list of items.
  926. Items []*Object `json:"items,omitempty"`
  927. // Kind: The kind of item this is. For lists of objects, this is always
  928. // storage#objects.
  929. Kind string `json:"kind,omitempty"`
  930. // NextPageToken: The continuation token, used to page through large
  931. // result sets. Provide this value in a subsequent request to return the
  932. // next page of results.
  933. NextPageToken string `json:"nextPageToken,omitempty"`
  934. // Prefixes: The list of prefixes of objects matching-but-not-listed up
  935. // to and including the requested delimiter.
  936. Prefixes []string `json:"prefixes,omitempty"`
  937. // ServerResponse contains the HTTP response code and headers from the
  938. // server.
  939. googleapi.ServerResponse `json:"-"`
  940. // ForceSendFields is a list of field names (e.g. "Items") to
  941. // unconditionally include in API requests. By default, fields with
  942. // empty values are omitted from API requests. However, any non-pointer,
  943. // non-interface field appearing in ForceSendFields will be sent to the
  944. // server regardless of whether the field is empty or not. This may be
  945. // used to include empty fields in Patch requests.
  946. ForceSendFields []string `json:"-"`
  947. // NullFields is a list of field names (e.g. "Items") to include in API
  948. // requests with the JSON null value. By default, fields with empty
  949. // values are omitted from API requests. However, any field with an
  950. // empty value appearing in NullFields will be sent to the server as
  951. // null. It is an error if a field in this list has a non-empty value.
  952. // This may be used to include null fields in Patch requests.
  953. NullFields []string `json:"-"`
  954. }
  955. func (s *Objects) MarshalJSON() ([]byte, error) {
  956. type NoMethod Objects
  957. raw := NoMethod(*s)
  958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  959. }
  960. // method id "storage.bucketAccessControls.delete":
  961. type BucketAccessControlsDeleteCall struct {
  962. s *Service
  963. bucket string
  964. entity string
  965. urlParams_ gensupport.URLParams
  966. ctx_ context.Context
  967. header_ http.Header
  968. }
  969. // Delete: Permanently deletes the ACL entry for the specified entity on
  970. // the specified bucket.
  971. func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
  972. c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  973. c.bucket = bucket
  974. c.entity = entity
  975. return c
  976. }
  977. // Fields allows partial responses to be retrieved. See
  978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  979. // for more information.
  980. func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
  981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  982. return c
  983. }
  984. // Context sets the context to be used in this call's Do method. Any
  985. // pending HTTP request will be aborted if the provided context is
  986. // canceled.
  987. func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
  988. c.ctx_ = ctx
  989. return c
  990. }
  991. // Header returns an http.Header that can be modified by the caller to
  992. // add HTTP headers to the request.
  993. func (c *BucketAccessControlsDeleteCall) Header() http.Header {
  994. if c.header_ == nil {
  995. c.header_ = make(http.Header)
  996. }
  997. return c.header_
  998. }
  999. func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1000. reqHeaders := make(http.Header)
  1001. for k, v := range c.header_ {
  1002. reqHeaders[k] = v
  1003. }
  1004. reqHeaders.Set("User-Agent", c.s.userAgent())
  1005. var body io.Reader = nil
  1006. c.urlParams_.Set("alt", alt)
  1007. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1008. urls += "?" + c.urlParams_.Encode()
  1009. req, _ := http.NewRequest("DELETE", urls, body)
  1010. req.Header = reqHeaders
  1011. googleapi.Expand(req.URL, map[string]string{
  1012. "bucket": c.bucket,
  1013. "entity": c.entity,
  1014. })
  1015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1016. }
  1017. // Do executes the "storage.bucketAccessControls.delete" call.
  1018. func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1019. gensupport.SetOptions(c.urlParams_, opts...)
  1020. res, err := c.doRequest("json")
  1021. if err != nil {
  1022. return err
  1023. }
  1024. defer googleapi.CloseBody(res)
  1025. if err := googleapi.CheckResponse(res); err != nil {
  1026. return err
  1027. }
  1028. return nil
  1029. // {
  1030. // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
  1031. // "httpMethod": "DELETE",
  1032. // "id": "storage.bucketAccessControls.delete",
  1033. // "parameterOrder": [
  1034. // "bucket",
  1035. // "entity"
  1036. // ],
  1037. // "parameters": {
  1038. // "bucket": {
  1039. // "description": "Name of a bucket.",
  1040. // "location": "path",
  1041. // "required": true,
  1042. // "type": "string"
  1043. // },
  1044. // "entity": {
  1045. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1046. // "location": "path",
  1047. // "required": true,
  1048. // "type": "string"
  1049. // }
  1050. // },
  1051. // "path": "b/{bucket}/acl/{entity}",
  1052. // "scopes": [
  1053. // "https://www.googleapis.com/auth/devstorage.full_control"
  1054. // ]
  1055. // }
  1056. }
  1057. // method id "storage.bucketAccessControls.get":
  1058. type BucketAccessControlsGetCall struct {
  1059. s *Service
  1060. bucket string
  1061. entity string
  1062. urlParams_ gensupport.URLParams
  1063. ifNoneMatch_ string
  1064. ctx_ context.Context
  1065. header_ http.Header
  1066. }
  1067. // Get: Returns the ACL entry for the specified entity on the specified
  1068. // bucket.
  1069. func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
  1070. c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1071. c.bucket = bucket
  1072. c.entity = entity
  1073. return c
  1074. }
  1075. // Fields allows partial responses to be retrieved. See
  1076. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1077. // for more information.
  1078. func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
  1079. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1080. return c
  1081. }
  1082. // IfNoneMatch sets the optional parameter which makes the operation
  1083. // fail if the object's ETag matches the given value. This is useful for
  1084. // getting updates only after the object has changed since the last
  1085. // request. Use googleapi.IsNotModified to check whether the response
  1086. // error from Do is the result of In-None-Match.
  1087. func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
  1088. c.ifNoneMatch_ = entityTag
  1089. return c
  1090. }
  1091. // Context sets the context to be used in this call's Do method. Any
  1092. // pending HTTP request will be aborted if the provided context is
  1093. // canceled.
  1094. func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
  1095. c.ctx_ = ctx
  1096. return c
  1097. }
  1098. // Header returns an http.Header that can be modified by the caller to
  1099. // add HTTP headers to the request.
  1100. func (c *BucketAccessControlsGetCall) Header() http.Header {
  1101. if c.header_ == nil {
  1102. c.header_ = make(http.Header)
  1103. }
  1104. return c.header_
  1105. }
  1106. func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  1107. reqHeaders := make(http.Header)
  1108. for k, v := range c.header_ {
  1109. reqHeaders[k] = v
  1110. }
  1111. reqHeaders.Set("User-Agent", c.s.userAgent())
  1112. if c.ifNoneMatch_ != "" {
  1113. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1114. }
  1115. var body io.Reader = nil
  1116. c.urlParams_.Set("alt", alt)
  1117. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1118. urls += "?" + c.urlParams_.Encode()
  1119. req, _ := http.NewRequest("GET", urls, body)
  1120. req.Header = reqHeaders
  1121. googleapi.Expand(req.URL, map[string]string{
  1122. "bucket": c.bucket,
  1123. "entity": c.entity,
  1124. })
  1125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1126. }
  1127. // Do executes the "storage.bucketAccessControls.get" call.
  1128. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1129. // non-2xx status code is an error. Response headers are in either
  1130. // *BucketAccessControl.ServerResponse.Header or (if a response was
  1131. // returned at all) in error.(*googleapi.Error).Header. Use
  1132. // googleapi.IsNotModified to check whether the returned error was
  1133. // because http.StatusNotModified was returned.
  1134. func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1135. gensupport.SetOptions(c.urlParams_, opts...)
  1136. res, err := c.doRequest("json")
  1137. if res != nil && res.StatusCode == http.StatusNotModified {
  1138. if res.Body != nil {
  1139. res.Body.Close()
  1140. }
  1141. return nil, &googleapi.Error{
  1142. Code: res.StatusCode,
  1143. Header: res.Header,
  1144. }
  1145. }
  1146. if err != nil {
  1147. return nil, err
  1148. }
  1149. defer googleapi.CloseBody(res)
  1150. if err := googleapi.CheckResponse(res); err != nil {
  1151. return nil, err
  1152. }
  1153. ret := &BucketAccessControl{
  1154. ServerResponse: googleapi.ServerResponse{
  1155. Header: res.Header,
  1156. HTTPStatusCode: res.StatusCode,
  1157. },
  1158. }
  1159. target := &ret
  1160. if err := gensupport.DecodeResponse(target, res); err != nil {
  1161. return nil, err
  1162. }
  1163. return ret, nil
  1164. // {
  1165. // "description": "Returns the ACL entry for the specified entity on the specified bucket.",
  1166. // "httpMethod": "GET",
  1167. // "id": "storage.bucketAccessControls.get",
  1168. // "parameterOrder": [
  1169. // "bucket",
  1170. // "entity"
  1171. // ],
  1172. // "parameters": {
  1173. // "bucket": {
  1174. // "description": "Name of a bucket.",
  1175. // "location": "path",
  1176. // "required": true,
  1177. // "type": "string"
  1178. // },
  1179. // "entity": {
  1180. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1181. // "location": "path",
  1182. // "required": true,
  1183. // "type": "string"
  1184. // }
  1185. // },
  1186. // "path": "b/{bucket}/acl/{entity}",
  1187. // "response": {
  1188. // "$ref": "BucketAccessControl"
  1189. // },
  1190. // "scopes": [
  1191. // "https://www.googleapis.com/auth/devstorage.full_control"
  1192. // ]
  1193. // }
  1194. }
  1195. // method id "storage.bucketAccessControls.insert":
  1196. type BucketAccessControlsInsertCall struct {
  1197. s *Service
  1198. bucket string
  1199. bucketaccesscontrol *BucketAccessControl
  1200. urlParams_ gensupport.URLParams
  1201. ctx_ context.Context
  1202. header_ http.Header
  1203. }
  1204. // Insert: Creates a new ACL entry on the specified bucket.
  1205. func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
  1206. c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1207. c.bucket = bucket
  1208. c.bucketaccesscontrol = bucketaccesscontrol
  1209. return c
  1210. }
  1211. // Fields allows partial responses to be retrieved. See
  1212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1213. // for more information.
  1214. func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
  1215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1216. return c
  1217. }
  1218. // Context sets the context to be used in this call's Do method. Any
  1219. // pending HTTP request will be aborted if the provided context is
  1220. // canceled.
  1221. func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
  1222. c.ctx_ = ctx
  1223. return c
  1224. }
  1225. // Header returns an http.Header that can be modified by the caller to
  1226. // add HTTP headers to the request.
  1227. func (c *BucketAccessControlsInsertCall) Header() http.Header {
  1228. if c.header_ == nil {
  1229. c.header_ = make(http.Header)
  1230. }
  1231. return c.header_
  1232. }
  1233. func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  1234. reqHeaders := make(http.Header)
  1235. for k, v := range c.header_ {
  1236. reqHeaders[k] = v
  1237. }
  1238. reqHeaders.Set("User-Agent", c.s.userAgent())
  1239. var body io.Reader = nil
  1240. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1241. if err != nil {
  1242. return nil, err
  1243. }
  1244. reqHeaders.Set("Content-Type", "application/json")
  1245. c.urlParams_.Set("alt", alt)
  1246. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  1247. urls += "?" + c.urlParams_.Encode()
  1248. req, _ := http.NewRequest("POST", urls, body)
  1249. req.Header = reqHeaders
  1250. googleapi.Expand(req.URL, map[string]string{
  1251. "bucket": c.bucket,
  1252. })
  1253. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1254. }
  1255. // Do executes the "storage.bucketAccessControls.insert" call.
  1256. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1257. // non-2xx status code is an error. Response headers are in either
  1258. // *BucketAccessControl.ServerResponse.Header or (if a response was
  1259. // returned at all) in error.(*googleapi.Error).Header. Use
  1260. // googleapi.IsNotModified to check whether the returned error was
  1261. // because http.StatusNotModified was returned.
  1262. func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1263. gensupport.SetOptions(c.urlParams_, opts...)
  1264. res, err := c.doRequest("json")
  1265. if res != nil && res.StatusCode == http.StatusNotModified {
  1266. if res.Body != nil {
  1267. res.Body.Close()
  1268. }
  1269. return nil, &googleapi.Error{
  1270. Code: res.StatusCode,
  1271. Header: res.Header,
  1272. }
  1273. }
  1274. if err != nil {
  1275. return nil, err
  1276. }
  1277. defer googleapi.CloseBody(res)
  1278. if err := googleapi.CheckResponse(res); err != nil {
  1279. return nil, err
  1280. }
  1281. ret := &BucketAccessControl{
  1282. ServerResponse: googleapi.ServerResponse{
  1283. Header: res.Header,
  1284. HTTPStatusCode: res.StatusCode,
  1285. },
  1286. }
  1287. target := &ret
  1288. if err := gensupport.DecodeResponse(target, res); err != nil {
  1289. return nil, err
  1290. }
  1291. return ret, nil
  1292. // {
  1293. // "description": "Creates a new ACL entry on the specified bucket.",
  1294. // "httpMethod": "POST",
  1295. // "id": "storage.bucketAccessControls.insert",
  1296. // "parameterOrder": [
  1297. // "bucket"
  1298. // ],
  1299. // "parameters": {
  1300. // "bucket": {
  1301. // "description": "Name of a bucket.",
  1302. // "location": "path",
  1303. // "required": true,
  1304. // "type": "string"
  1305. // }
  1306. // },
  1307. // "path": "b/{bucket}/acl",
  1308. // "request": {
  1309. // "$ref": "BucketAccessControl"
  1310. // },
  1311. // "response": {
  1312. // "$ref": "BucketAccessControl"
  1313. // },
  1314. // "scopes": [
  1315. // "https://www.googleapis.com/auth/devstorage.full_control"
  1316. // ]
  1317. // }
  1318. }
  1319. // method id "storage.bucketAccessControls.list":
  1320. type BucketAccessControlsListCall struct {
  1321. s *Service
  1322. bucket string
  1323. urlParams_ gensupport.URLParams
  1324. ifNoneMatch_ string
  1325. ctx_ context.Context
  1326. header_ http.Header
  1327. }
  1328. // List: Retrieves ACL entries on the specified bucket.
  1329. func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
  1330. c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1331. c.bucket = bucket
  1332. return c
  1333. }
  1334. // Fields allows partial responses to be retrieved. See
  1335. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1336. // for more information.
  1337. func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
  1338. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1339. return c
  1340. }
  1341. // IfNoneMatch sets the optional parameter which makes the operation
  1342. // fail if the object's ETag matches the given value. This is useful for
  1343. // getting updates only after the object has changed since the last
  1344. // request. Use googleapi.IsNotModified to check whether the response
  1345. // error from Do is the result of In-None-Match.
  1346. func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
  1347. c.ifNoneMatch_ = entityTag
  1348. return c
  1349. }
  1350. // Context sets the context to be used in this call's Do method. Any
  1351. // pending HTTP request will be aborted if the provided context is
  1352. // canceled.
  1353. func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
  1354. c.ctx_ = ctx
  1355. return c
  1356. }
  1357. // Header returns an http.Header that can be modified by the caller to
  1358. // add HTTP headers to the request.
  1359. func (c *BucketAccessControlsListCall) Header() http.Header {
  1360. if c.header_ == nil {
  1361. c.header_ = make(http.Header)
  1362. }
  1363. return c.header_
  1364. }
  1365. func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  1366. reqHeaders := make(http.Header)
  1367. for k, v := range c.header_ {
  1368. reqHeaders[k] = v
  1369. }
  1370. reqHeaders.Set("User-Agent", c.s.userAgent())
  1371. if c.ifNoneMatch_ != "" {
  1372. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1373. }
  1374. var body io.Reader = nil
  1375. c.urlParams_.Set("alt", alt)
  1376. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
  1377. urls += "?" + c.urlParams_.Encode()
  1378. req, _ := http.NewRequest("GET", urls, body)
  1379. req.Header = reqHeaders
  1380. googleapi.Expand(req.URL, map[string]string{
  1381. "bucket": c.bucket,
  1382. })
  1383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1384. }
  1385. // Do executes the "storage.bucketAccessControls.list" call.
  1386. // Exactly one of *BucketAccessControls or error will be non-nil. Any
  1387. // non-2xx status code is an error. Response headers are in either
  1388. // *BucketAccessControls.ServerResponse.Header or (if a response was
  1389. // returned at all) in error.(*googleapi.Error).Header. Use
  1390. // googleapi.IsNotModified to check whether the returned error was
  1391. // because http.StatusNotModified was returned.
  1392. func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
  1393. gensupport.SetOptions(c.urlParams_, opts...)
  1394. res, err := c.doRequest("json")
  1395. if res != nil && res.StatusCode == http.StatusNotModified {
  1396. if res.Body != nil {
  1397. res.Body.Close()
  1398. }
  1399. return nil, &googleapi.Error{
  1400. Code: res.StatusCode,
  1401. Header: res.Header,
  1402. }
  1403. }
  1404. if err != nil {
  1405. return nil, err
  1406. }
  1407. defer googleapi.CloseBody(res)
  1408. if err := googleapi.CheckResponse(res); err != nil {
  1409. return nil, err
  1410. }
  1411. ret := &BucketAccessControls{
  1412. ServerResponse: googleapi.ServerResponse{
  1413. Header: res.Header,
  1414. HTTPStatusCode: res.StatusCode,
  1415. },
  1416. }
  1417. target := &ret
  1418. if err := gensupport.DecodeResponse(target, res); err != nil {
  1419. return nil, err
  1420. }
  1421. return ret, nil
  1422. // {
  1423. // "description": "Retrieves ACL entries on the specified bucket.",
  1424. // "httpMethod": "GET",
  1425. // "id": "storage.bucketAccessControls.list",
  1426. // "parameterOrder": [
  1427. // "bucket"
  1428. // ],
  1429. // "parameters": {
  1430. // "bucket": {
  1431. // "description": "Name of a bucket.",
  1432. // "location": "path",
  1433. // "required": true,
  1434. // "type": "string"
  1435. // }
  1436. // },
  1437. // "path": "b/{bucket}/acl",
  1438. // "response": {
  1439. // "$ref": "BucketAccessControls"
  1440. // },
  1441. // "scopes": [
  1442. // "https://www.googleapis.com/auth/devstorage.full_control"
  1443. // ]
  1444. // }
  1445. }
  1446. // method id "storage.bucketAccessControls.patch":
  1447. type BucketAccessControlsPatchCall struct {
  1448. s *Service
  1449. bucket string
  1450. entity string
  1451. bucketaccesscontrol *BucketAccessControl
  1452. urlParams_ gensupport.URLParams
  1453. ctx_ context.Context
  1454. header_ http.Header
  1455. }
  1456. // Patch: Updates an ACL entry on the specified bucket. This method
  1457. // supports patch semantics.
  1458. func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
  1459. c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1460. c.bucket = bucket
  1461. c.entity = entity
  1462. c.bucketaccesscontrol = bucketaccesscontrol
  1463. return c
  1464. }
  1465. // Fields allows partial responses to be retrieved. See
  1466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1467. // for more information.
  1468. func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
  1469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1470. return c
  1471. }
  1472. // Context sets the context to be used in this call's Do method. Any
  1473. // pending HTTP request will be aborted if the provided context is
  1474. // canceled.
  1475. func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
  1476. c.ctx_ = ctx
  1477. return c
  1478. }
  1479. // Header returns an http.Header that can be modified by the caller to
  1480. // add HTTP headers to the request.
  1481. func (c *BucketAccessControlsPatchCall) Header() http.Header {
  1482. if c.header_ == nil {
  1483. c.header_ = make(http.Header)
  1484. }
  1485. return c.header_
  1486. }
  1487. func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  1488. reqHeaders := make(http.Header)
  1489. for k, v := range c.header_ {
  1490. reqHeaders[k] = v
  1491. }
  1492. reqHeaders.Set("User-Agent", c.s.userAgent())
  1493. var body io.Reader = nil
  1494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1495. if err != nil {
  1496. return nil, err
  1497. }
  1498. reqHeaders.Set("Content-Type", "application/json")
  1499. c.urlParams_.Set("alt", alt)
  1500. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1501. urls += "?" + c.urlParams_.Encode()
  1502. req, _ := http.NewRequest("PATCH", urls, body)
  1503. req.Header = reqHeaders
  1504. googleapi.Expand(req.URL, map[string]string{
  1505. "bucket": c.bucket,
  1506. "entity": c.entity,
  1507. })
  1508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1509. }
  1510. // Do executes the "storage.bucketAccessControls.patch" call.
  1511. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1512. // non-2xx status code is an error. Response headers are in either
  1513. // *BucketAccessControl.ServerResponse.Header or (if a response was
  1514. // returned at all) in error.(*googleapi.Error).Header. Use
  1515. // googleapi.IsNotModified to check whether the returned error was
  1516. // because http.StatusNotModified was returned.
  1517. func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1518. gensupport.SetOptions(c.urlParams_, opts...)
  1519. res, err := c.doRequest("json")
  1520. if res != nil && res.StatusCode == http.StatusNotModified {
  1521. if res.Body != nil {
  1522. res.Body.Close()
  1523. }
  1524. return nil, &googleapi.Error{
  1525. Code: res.StatusCode,
  1526. Header: res.Header,
  1527. }
  1528. }
  1529. if err != nil {
  1530. return nil, err
  1531. }
  1532. defer googleapi.CloseBody(res)
  1533. if err := googleapi.CheckResponse(res); err != nil {
  1534. return nil, err
  1535. }
  1536. ret := &BucketAccessControl{
  1537. ServerResponse: googleapi.ServerResponse{
  1538. Header: res.Header,
  1539. HTTPStatusCode: res.StatusCode,
  1540. },
  1541. }
  1542. target := &ret
  1543. if err := gensupport.DecodeResponse(target, res); err != nil {
  1544. return nil, err
  1545. }
  1546. return ret, nil
  1547. // {
  1548. // "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.",
  1549. // "httpMethod": "PATCH",
  1550. // "id": "storage.bucketAccessControls.patch",
  1551. // "parameterOrder": [
  1552. // "bucket",
  1553. // "entity"
  1554. // ],
  1555. // "parameters": {
  1556. // "bucket": {
  1557. // "description": "Name of a bucket.",
  1558. // "location": "path",
  1559. // "required": true,
  1560. // "type": "string"
  1561. // },
  1562. // "entity": {
  1563. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1564. // "location": "path",
  1565. // "required": true,
  1566. // "type": "string"
  1567. // }
  1568. // },
  1569. // "path": "b/{bucket}/acl/{entity}",
  1570. // "request": {
  1571. // "$ref": "BucketAccessControl"
  1572. // },
  1573. // "response": {
  1574. // "$ref": "BucketAccessControl"
  1575. // },
  1576. // "scopes": [
  1577. // "https://www.googleapis.com/auth/devstorage.full_control"
  1578. // ]
  1579. // }
  1580. }
  1581. // method id "storage.bucketAccessControls.update":
  1582. type BucketAccessControlsUpdateCall struct {
  1583. s *Service
  1584. bucket string
  1585. entity string
  1586. bucketaccesscontrol *BucketAccessControl
  1587. urlParams_ gensupport.URLParams
  1588. ctx_ context.Context
  1589. header_ http.Header
  1590. }
  1591. // Update: Updates an ACL entry on the specified bucket.
  1592. func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
  1593. c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1594. c.bucket = bucket
  1595. c.entity = entity
  1596. c.bucketaccesscontrol = bucketaccesscontrol
  1597. return c
  1598. }
  1599. // Fields allows partial responses to be retrieved. See
  1600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1601. // for more information.
  1602. func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
  1603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1604. return c
  1605. }
  1606. // Context sets the context to be used in this call's Do method. Any
  1607. // pending HTTP request will be aborted if the provided context is
  1608. // canceled.
  1609. func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
  1610. c.ctx_ = ctx
  1611. return c
  1612. }
  1613. // Header returns an http.Header that can be modified by the caller to
  1614. // add HTTP headers to the request.
  1615. func (c *BucketAccessControlsUpdateCall) Header() http.Header {
  1616. if c.header_ == nil {
  1617. c.header_ = make(http.Header)
  1618. }
  1619. return c.header_
  1620. }
  1621. func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1622. reqHeaders := make(http.Header)
  1623. for k, v := range c.header_ {
  1624. reqHeaders[k] = v
  1625. }
  1626. reqHeaders.Set("User-Agent", c.s.userAgent())
  1627. var body io.Reader = nil
  1628. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
  1629. if err != nil {
  1630. return nil, err
  1631. }
  1632. reqHeaders.Set("Content-Type", "application/json")
  1633. c.urlParams_.Set("alt", alt)
  1634. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
  1635. urls += "?" + c.urlParams_.Encode()
  1636. req, _ := http.NewRequest("PUT", urls, body)
  1637. req.Header = reqHeaders
  1638. googleapi.Expand(req.URL, map[string]string{
  1639. "bucket": c.bucket,
  1640. "entity": c.entity,
  1641. })
  1642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1643. }
  1644. // Do executes the "storage.bucketAccessControls.update" call.
  1645. // Exactly one of *BucketAccessControl or error will be non-nil. Any
  1646. // non-2xx status code is an error. Response headers are in either
  1647. // *BucketAccessControl.ServerResponse.Header or (if a response was
  1648. // returned at all) in error.(*googleapi.Error).Header. Use
  1649. // googleapi.IsNotModified to check whether the returned error was
  1650. // because http.StatusNotModified was returned.
  1651. func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
  1652. gensupport.SetOptions(c.urlParams_, opts...)
  1653. res, err := c.doRequest("json")
  1654. if res != nil && res.StatusCode == http.StatusNotModified {
  1655. if res.Body != nil {
  1656. res.Body.Close()
  1657. }
  1658. return nil, &googleapi.Error{
  1659. Code: res.StatusCode,
  1660. Header: res.Header,
  1661. }
  1662. }
  1663. if err != nil {
  1664. return nil, err
  1665. }
  1666. defer googleapi.CloseBody(res)
  1667. if err := googleapi.CheckResponse(res); err != nil {
  1668. return nil, err
  1669. }
  1670. ret := &BucketAccessControl{
  1671. ServerResponse: googleapi.ServerResponse{
  1672. Header: res.Header,
  1673. HTTPStatusCode: res.StatusCode,
  1674. },
  1675. }
  1676. target := &ret
  1677. if err := gensupport.DecodeResponse(target, res); err != nil {
  1678. return nil, err
  1679. }
  1680. return ret, nil
  1681. // {
  1682. // "description": "Updates an ACL entry on the specified bucket.",
  1683. // "httpMethod": "PUT",
  1684. // "id": "storage.bucketAccessControls.update",
  1685. // "parameterOrder": [
  1686. // "bucket",
  1687. // "entity"
  1688. // ],
  1689. // "parameters": {
  1690. // "bucket": {
  1691. // "description": "Name of a bucket.",
  1692. // "location": "path",
  1693. // "required": true,
  1694. // "type": "string"
  1695. // },
  1696. // "entity": {
  1697. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  1698. // "location": "path",
  1699. // "required": true,
  1700. // "type": "string"
  1701. // }
  1702. // },
  1703. // "path": "b/{bucket}/acl/{entity}",
  1704. // "request": {
  1705. // "$ref": "BucketAccessControl"
  1706. // },
  1707. // "response": {
  1708. // "$ref": "BucketAccessControl"
  1709. // },
  1710. // "scopes": [
  1711. // "https://www.googleapis.com/auth/devstorage.full_control"
  1712. // ]
  1713. // }
  1714. }
  1715. // method id "storage.buckets.delete":
  1716. type BucketsDeleteCall struct {
  1717. s *Service
  1718. bucket string
  1719. urlParams_ gensupport.URLParams
  1720. ctx_ context.Context
  1721. header_ http.Header
  1722. }
  1723. // Delete: Permanently deletes an empty bucket.
  1724. func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
  1725. c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1726. c.bucket = bucket
  1727. return c
  1728. }
  1729. // IfMetagenerationMatch sets the optional parameter
  1730. // "ifMetagenerationMatch": Makes the return of the bucket metadata
  1731. // conditional on whether the bucket's current metageneration matches
  1732. // the given value.
  1733. func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsDeleteCall {
  1734. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  1735. return c
  1736. }
  1737. // IfMetagenerationNotMatch sets the optional parameter
  1738. // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  1739. // conditional on whether the bucket's current metageneration does not
  1740. // match the given value.
  1741. func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsDeleteCall {
  1742. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  1743. return c
  1744. }
  1745. // Fields allows partial responses to be retrieved. See
  1746. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1747. // for more information.
  1748. func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
  1749. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1750. return c
  1751. }
  1752. // Context sets the context to be used in this call's Do method. Any
  1753. // pending HTTP request will be aborted if the provided context is
  1754. // canceled.
  1755. func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
  1756. c.ctx_ = ctx
  1757. return c
  1758. }
  1759. // Header returns an http.Header that can be modified by the caller to
  1760. // add HTTP headers to the request.
  1761. func (c *BucketsDeleteCall) Header() http.Header {
  1762. if c.header_ == nil {
  1763. c.header_ = make(http.Header)
  1764. }
  1765. return c.header_
  1766. }
  1767. func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1768. reqHeaders := make(http.Header)
  1769. for k, v := range c.header_ {
  1770. reqHeaders[k] = v
  1771. }
  1772. reqHeaders.Set("User-Agent", c.s.userAgent())
  1773. var body io.Reader = nil
  1774. c.urlParams_.Set("alt", alt)
  1775. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  1776. urls += "?" + c.urlParams_.Encode()
  1777. req, _ := http.NewRequest("DELETE", urls, body)
  1778. req.Header = reqHeaders
  1779. googleapi.Expand(req.URL, map[string]string{
  1780. "bucket": c.bucket,
  1781. })
  1782. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1783. }
  1784. // Do executes the "storage.buckets.delete" call.
  1785. func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1786. gensupport.SetOptions(c.urlParams_, opts...)
  1787. res, err := c.doRequest("json")
  1788. if err != nil {
  1789. return err
  1790. }
  1791. defer googleapi.CloseBody(res)
  1792. if err := googleapi.CheckResponse(res); err != nil {
  1793. return err
  1794. }
  1795. return nil
  1796. // {
  1797. // "description": "Permanently deletes an empty bucket.",
  1798. // "httpMethod": "DELETE",
  1799. // "id": "storage.buckets.delete",
  1800. // "parameterOrder": [
  1801. // "bucket"
  1802. // ],
  1803. // "parameters": {
  1804. // "bucket": {
  1805. // "description": "Name of a bucket.",
  1806. // "location": "path",
  1807. // "required": true,
  1808. // "type": "string"
  1809. // },
  1810. // "ifMetagenerationMatch": {
  1811. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  1812. // "format": "uint64",
  1813. // "location": "query",
  1814. // "type": "string"
  1815. // },
  1816. // "ifMetagenerationNotMatch": {
  1817. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  1818. // "format": "uint64",
  1819. // "location": "query",
  1820. // "type": "string"
  1821. // }
  1822. // },
  1823. // "path": "b/{bucket}",
  1824. // "scopes": [
  1825. // "https://www.googleapis.com/auth/devstorage.full_control",
  1826. // "https://www.googleapis.com/auth/devstorage.read_write"
  1827. // ]
  1828. // }
  1829. }
  1830. // method id "storage.buckets.get":
  1831. type BucketsGetCall struct {
  1832. s *Service
  1833. bucket string
  1834. urlParams_ gensupport.URLParams
  1835. ifNoneMatch_ string
  1836. ctx_ context.Context
  1837. header_ http.Header
  1838. }
  1839. // Get: Returns metadata for the specified bucket.
  1840. func (r *BucketsService) Get(bucket string) *BucketsGetCall {
  1841. c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1842. c.bucket = bucket
  1843. return c
  1844. }
  1845. // IfMetagenerationMatch sets the optional parameter
  1846. // "ifMetagenerationMatch": Makes the return of the bucket metadata
  1847. // conditional on whether the bucket's current metageneration matches
  1848. // the given value.
  1849. func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsGetCall {
  1850. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  1851. return c
  1852. }
  1853. // IfMetagenerationNotMatch sets the optional parameter
  1854. // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  1855. // conditional on whether the bucket's current metageneration does not
  1856. // match the given value.
  1857. func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsGetCall {
  1858. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  1859. return c
  1860. }
  1861. // Projection sets the optional parameter "projection": Set of
  1862. // properties to return. Defaults to noAcl.
  1863. //
  1864. // Possible values:
  1865. // "full" - Include all properties.
  1866. // "noAcl" - Omit acl and defaultObjectAcl properties.
  1867. func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
  1868. c.urlParams_.Set("projection", projection)
  1869. return c
  1870. }
  1871. // Fields allows partial responses to be retrieved. See
  1872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1873. // for more information.
  1874. func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
  1875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1876. return c
  1877. }
  1878. // IfNoneMatch sets the optional parameter which makes the operation
  1879. // fail if the object's ETag matches the given value. This is useful for
  1880. // getting updates only after the object has changed since the last
  1881. // request. Use googleapi.IsNotModified to check whether the response
  1882. // error from Do is the result of In-None-Match.
  1883. func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
  1884. c.ifNoneMatch_ = entityTag
  1885. return c
  1886. }
  1887. // Context sets the context to be used in this call's Do method. Any
  1888. // pending HTTP request will be aborted if the provided context is
  1889. // canceled.
  1890. func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
  1891. c.ctx_ = ctx
  1892. return c
  1893. }
  1894. // Header returns an http.Header that can be modified by the caller to
  1895. // add HTTP headers to the request.
  1896. func (c *BucketsGetCall) Header() http.Header {
  1897. if c.header_ == nil {
  1898. c.header_ = make(http.Header)
  1899. }
  1900. return c.header_
  1901. }
  1902. func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
  1903. reqHeaders := make(http.Header)
  1904. for k, v := range c.header_ {
  1905. reqHeaders[k] = v
  1906. }
  1907. reqHeaders.Set("User-Agent", c.s.userAgent())
  1908. if c.ifNoneMatch_ != "" {
  1909. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1910. }
  1911. var body io.Reader = nil
  1912. c.urlParams_.Set("alt", alt)
  1913. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  1914. urls += "?" + c.urlParams_.Encode()
  1915. req, _ := http.NewRequest("GET", urls, body)
  1916. req.Header = reqHeaders
  1917. googleapi.Expand(req.URL, map[string]string{
  1918. "bucket": c.bucket,
  1919. })
  1920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1921. }
  1922. // Do executes the "storage.buckets.get" call.
  1923. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  1924. // code is an error. Response headers are in either
  1925. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  1926. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1927. // check whether the returned error was because http.StatusNotModified
  1928. // was returned.
  1929. func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  1930. gensupport.SetOptions(c.urlParams_, opts...)
  1931. res, err := c.doRequest("json")
  1932. if res != nil && res.StatusCode == http.StatusNotModified {
  1933. if res.Body != nil {
  1934. res.Body.Close()
  1935. }
  1936. return nil, &googleapi.Error{
  1937. Code: res.StatusCode,
  1938. Header: res.Header,
  1939. }
  1940. }
  1941. if err != nil {
  1942. return nil, err
  1943. }
  1944. defer googleapi.CloseBody(res)
  1945. if err := googleapi.CheckResponse(res); err != nil {
  1946. return nil, err
  1947. }
  1948. ret := &Bucket{
  1949. ServerResponse: googleapi.ServerResponse{
  1950. Header: res.Header,
  1951. HTTPStatusCode: res.StatusCode,
  1952. },
  1953. }
  1954. target := &ret
  1955. if err := gensupport.DecodeResponse(target, res); err != nil {
  1956. return nil, err
  1957. }
  1958. return ret, nil
  1959. // {
  1960. // "description": "Returns metadata for the specified bucket.",
  1961. // "httpMethod": "GET",
  1962. // "id": "storage.buckets.get",
  1963. // "parameterOrder": [
  1964. // "bucket"
  1965. // ],
  1966. // "parameters": {
  1967. // "bucket": {
  1968. // "description": "Name of a bucket.",
  1969. // "location": "path",
  1970. // "required": true,
  1971. // "type": "string"
  1972. // },
  1973. // "ifMetagenerationMatch": {
  1974. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  1975. // "format": "uint64",
  1976. // "location": "query",
  1977. // "type": "string"
  1978. // },
  1979. // "ifMetagenerationNotMatch": {
  1980. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  1981. // "format": "uint64",
  1982. // "location": "query",
  1983. // "type": "string"
  1984. // },
  1985. // "projection": {
  1986. // "description": "Set of properties to return. Defaults to noAcl.",
  1987. // "enum": [
  1988. // "full",
  1989. // "noAcl"
  1990. // ],
  1991. // "enumDescriptions": [
  1992. // "Include all properties.",
  1993. // "Omit acl and defaultObjectAcl properties."
  1994. // ],
  1995. // "location": "query",
  1996. // "type": "string"
  1997. // }
  1998. // },
  1999. // "path": "b/{bucket}",
  2000. // "response": {
  2001. // "$ref": "Bucket"
  2002. // },
  2003. // "scopes": [
  2004. // "https://www.googleapis.com/auth/devstorage.full_control",
  2005. // "https://www.googleapis.com/auth/devstorage.read_only",
  2006. // "https://www.googleapis.com/auth/devstorage.read_write"
  2007. // ]
  2008. // }
  2009. }
  2010. // method id "storage.buckets.insert":
  2011. type BucketsInsertCall struct {
  2012. s *Service
  2013. bucket *Bucket
  2014. urlParams_ gensupport.URLParams
  2015. ctx_ context.Context
  2016. header_ http.Header
  2017. }
  2018. // Insert: Creates a new bucket.
  2019. func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
  2020. c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2021. c.urlParams_.Set("project", projectid)
  2022. c.bucket = bucket
  2023. return c
  2024. }
  2025. // Projection sets the optional parameter "projection": Set of
  2026. // properties to return. Defaults to noAcl, unless the bucket resource
  2027. // specifies acl or defaultObjectAcl properties, when it defaults to
  2028. // full.
  2029. //
  2030. // Possible values:
  2031. // "full" - Include all properties.
  2032. // "noAcl" - Omit acl and defaultObjectAcl properties.
  2033. func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
  2034. c.urlParams_.Set("projection", projection)
  2035. return c
  2036. }
  2037. // Fields allows partial responses to be retrieved. See
  2038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2039. // for more information.
  2040. func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
  2041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2042. return c
  2043. }
  2044. // Context sets the context to be used in this call's Do method. Any
  2045. // pending HTTP request will be aborted if the provided context is
  2046. // canceled.
  2047. func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
  2048. c.ctx_ = ctx
  2049. return c
  2050. }
  2051. // Header returns an http.Header that can be modified by the caller to
  2052. // add HTTP headers to the request.
  2053. func (c *BucketsInsertCall) Header() http.Header {
  2054. if c.header_ == nil {
  2055. c.header_ = make(http.Header)
  2056. }
  2057. return c.header_
  2058. }
  2059. func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  2060. reqHeaders := make(http.Header)
  2061. for k, v := range c.header_ {
  2062. reqHeaders[k] = v
  2063. }
  2064. reqHeaders.Set("User-Agent", c.s.userAgent())
  2065. var body io.Reader = nil
  2066. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
  2067. if err != nil {
  2068. return nil, err
  2069. }
  2070. reqHeaders.Set("Content-Type", "application/json")
  2071. c.urlParams_.Set("alt", alt)
  2072. urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  2073. urls += "?" + c.urlParams_.Encode()
  2074. req, _ := http.NewRequest("POST", urls, body)
  2075. req.Header = reqHeaders
  2076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2077. }
  2078. // Do executes the "storage.buckets.insert" call.
  2079. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  2080. // code is an error. Response headers are in either
  2081. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  2082. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2083. // check whether the returned error was because http.StatusNotModified
  2084. // was returned.
  2085. func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  2086. gensupport.SetOptions(c.urlParams_, opts...)
  2087. res, err := c.doRequest("json")
  2088. if res != nil && res.StatusCode == http.StatusNotModified {
  2089. if res.Body != nil {
  2090. res.Body.Close()
  2091. }
  2092. return nil, &googleapi.Error{
  2093. Code: res.StatusCode,
  2094. Header: res.Header,
  2095. }
  2096. }
  2097. if err != nil {
  2098. return nil, err
  2099. }
  2100. defer googleapi.CloseBody(res)
  2101. if err := googleapi.CheckResponse(res); err != nil {
  2102. return nil, err
  2103. }
  2104. ret := &Bucket{
  2105. ServerResponse: googleapi.ServerResponse{
  2106. Header: res.Header,
  2107. HTTPStatusCode: res.StatusCode,
  2108. },
  2109. }
  2110. target := &ret
  2111. if err := gensupport.DecodeResponse(target, res); err != nil {
  2112. return nil, err
  2113. }
  2114. return ret, nil
  2115. // {
  2116. // "description": "Creates a new bucket.",
  2117. // "httpMethod": "POST",
  2118. // "id": "storage.buckets.insert",
  2119. // "parameterOrder": [
  2120. // "project"
  2121. // ],
  2122. // "parameters": {
  2123. // "project": {
  2124. // "description": "A valid API project identifier.",
  2125. // "location": "query",
  2126. // "required": true,
  2127. // "type": "string"
  2128. // },
  2129. // "projection": {
  2130. // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
  2131. // "enum": [
  2132. // "full",
  2133. // "noAcl"
  2134. // ],
  2135. // "enumDescriptions": [
  2136. // "Include all properties.",
  2137. // "Omit acl and defaultObjectAcl properties."
  2138. // ],
  2139. // "location": "query",
  2140. // "type": "string"
  2141. // }
  2142. // },
  2143. // "path": "b",
  2144. // "request": {
  2145. // "$ref": "Bucket"
  2146. // },
  2147. // "response": {
  2148. // "$ref": "Bucket"
  2149. // },
  2150. // "scopes": [
  2151. // "https://www.googleapis.com/auth/devstorage.full_control",
  2152. // "https://www.googleapis.com/auth/devstorage.read_write"
  2153. // ]
  2154. // }
  2155. }
  2156. // method id "storage.buckets.list":
  2157. type BucketsListCall struct {
  2158. s *Service
  2159. urlParams_ gensupport.URLParams
  2160. ifNoneMatch_ string
  2161. ctx_ context.Context
  2162. header_ http.Header
  2163. }
  2164. // List: Retrieves a list of buckets for a given project.
  2165. func (r *BucketsService) List(projectid string) *BucketsListCall {
  2166. c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2167. c.urlParams_.Set("project", projectid)
  2168. return c
  2169. }
  2170. // MaxResults sets the optional parameter "maxResults": Maximum number
  2171. // of buckets to return.
  2172. func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
  2173. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2174. return c
  2175. }
  2176. // PageToken sets the optional parameter "pageToken": A
  2177. // previously-returned page token representing part of the larger set of
  2178. // results to view.
  2179. func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
  2180. c.urlParams_.Set("pageToken", pageToken)
  2181. return c
  2182. }
  2183. // Projection sets the optional parameter "projection": Set of
  2184. // properties to return. Defaults to noAcl.
  2185. //
  2186. // Possible values:
  2187. // "full" - Include all properties.
  2188. // "noAcl" - Omit acl and defaultObjectAcl properties.
  2189. func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
  2190. c.urlParams_.Set("projection", projection)
  2191. return c
  2192. }
  2193. // Fields allows partial responses to be retrieved. See
  2194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2195. // for more information.
  2196. func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
  2197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2198. return c
  2199. }
  2200. // IfNoneMatch sets the optional parameter which makes the operation
  2201. // fail if the object's ETag matches the given value. This is useful for
  2202. // getting updates only after the object has changed since the last
  2203. // request. Use googleapi.IsNotModified to check whether the response
  2204. // error from Do is the result of In-None-Match.
  2205. func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
  2206. c.ifNoneMatch_ = entityTag
  2207. return c
  2208. }
  2209. // Context sets the context to be used in this call's Do method. Any
  2210. // pending HTTP request will be aborted if the provided context is
  2211. // canceled.
  2212. func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
  2213. c.ctx_ = ctx
  2214. return c
  2215. }
  2216. // Header returns an http.Header that can be modified by the caller to
  2217. // add HTTP headers to the request.
  2218. func (c *BucketsListCall) Header() http.Header {
  2219. if c.header_ == nil {
  2220. c.header_ = make(http.Header)
  2221. }
  2222. return c.header_
  2223. }
  2224. func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
  2225. reqHeaders := make(http.Header)
  2226. for k, v := range c.header_ {
  2227. reqHeaders[k] = v
  2228. }
  2229. reqHeaders.Set("User-Agent", c.s.userAgent())
  2230. if c.ifNoneMatch_ != "" {
  2231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2232. }
  2233. var body io.Reader = nil
  2234. c.urlParams_.Set("alt", alt)
  2235. urls := googleapi.ResolveRelative(c.s.BasePath, "b")
  2236. urls += "?" + c.urlParams_.Encode()
  2237. req, _ := http.NewRequest("GET", urls, body)
  2238. req.Header = reqHeaders
  2239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2240. }
  2241. // Do executes the "storage.buckets.list" call.
  2242. // Exactly one of *Buckets or error will be non-nil. Any non-2xx status
  2243. // code is an error. Response headers are in either
  2244. // *Buckets.ServerResponse.Header or (if a response was returned at all)
  2245. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2246. // check whether the returned error was because http.StatusNotModified
  2247. // was returned.
  2248. func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
  2249. gensupport.SetOptions(c.urlParams_, opts...)
  2250. res, err := c.doRequest("json")
  2251. if res != nil && res.StatusCode == http.StatusNotModified {
  2252. if res.Body != nil {
  2253. res.Body.Close()
  2254. }
  2255. return nil, &googleapi.Error{
  2256. Code: res.StatusCode,
  2257. Header: res.Header,
  2258. }
  2259. }
  2260. if err != nil {
  2261. return nil, err
  2262. }
  2263. defer googleapi.CloseBody(res)
  2264. if err := googleapi.CheckResponse(res); err != nil {
  2265. return nil, err
  2266. }
  2267. ret := &Buckets{
  2268. ServerResponse: googleapi.ServerResponse{
  2269. Header: res.Header,
  2270. HTTPStatusCode: res.StatusCode,
  2271. },
  2272. }
  2273. target := &ret
  2274. if err := gensupport.DecodeResponse(target, res); err != nil {
  2275. return nil, err
  2276. }
  2277. return ret, nil
  2278. // {
  2279. // "description": "Retrieves a list of buckets for a given project.",
  2280. // "httpMethod": "GET",
  2281. // "id": "storage.buckets.list",
  2282. // "parameterOrder": [
  2283. // "project"
  2284. // ],
  2285. // "parameters": {
  2286. // "maxResults": {
  2287. // "description": "Maximum number of buckets to return.",
  2288. // "format": "uint32",
  2289. // "location": "query",
  2290. // "minimum": "0",
  2291. // "type": "integer"
  2292. // },
  2293. // "pageToken": {
  2294. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  2295. // "location": "query",
  2296. // "type": "string"
  2297. // },
  2298. // "project": {
  2299. // "description": "A valid API project identifier.",
  2300. // "location": "query",
  2301. // "required": true,
  2302. // "type": "string"
  2303. // },
  2304. // "projection": {
  2305. // "description": "Set of properties to return. Defaults to noAcl.",
  2306. // "enum": [
  2307. // "full",
  2308. // "noAcl"
  2309. // ],
  2310. // "enumDescriptions": [
  2311. // "Include all properties.",
  2312. // "Omit acl and defaultObjectAcl properties."
  2313. // ],
  2314. // "location": "query",
  2315. // "type": "string"
  2316. // }
  2317. // },
  2318. // "path": "b",
  2319. // "response": {
  2320. // "$ref": "Buckets"
  2321. // },
  2322. // "scopes": [
  2323. // "https://www.googleapis.com/auth/devstorage.full_control",
  2324. // "https://www.googleapis.com/auth/devstorage.read_only",
  2325. // "https://www.googleapis.com/auth/devstorage.read_write"
  2326. // ]
  2327. // }
  2328. }
  2329. // Pages invokes f for each page of results.
  2330. // A non-nil error returned from f will halt the iteration.
  2331. // The provided context supersedes any context provided to the Context method.
  2332. func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
  2333. c.ctx_ = ctx
  2334. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2335. for {
  2336. x, err := c.Do()
  2337. if err != nil {
  2338. return err
  2339. }
  2340. if err := f(x); err != nil {
  2341. return err
  2342. }
  2343. if x.NextPageToken == "" {
  2344. return nil
  2345. }
  2346. c.PageToken(x.NextPageToken)
  2347. }
  2348. }
  2349. // method id "storage.buckets.patch":
  2350. type BucketsPatchCall struct {
  2351. s *Service
  2352. bucket string
  2353. bucket2 *Bucket
  2354. urlParams_ gensupport.URLParams
  2355. ctx_ context.Context
  2356. header_ http.Header
  2357. }
  2358. // Patch: Updates a bucket. This method supports patch semantics.
  2359. func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
  2360. c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2361. c.bucket = bucket
  2362. c.bucket2 = bucket2
  2363. return c
  2364. }
  2365. // IfMetagenerationMatch sets the optional parameter
  2366. // "ifMetagenerationMatch": Makes the return of the bucket metadata
  2367. // conditional on whether the bucket's current metageneration matches
  2368. // the given value.
  2369. func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsPatchCall {
  2370. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  2371. return c
  2372. }
  2373. // IfMetagenerationNotMatch sets the optional parameter
  2374. // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  2375. // conditional on whether the bucket's current metageneration does not
  2376. // match the given value.
  2377. func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsPatchCall {
  2378. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  2379. return c
  2380. }
  2381. // Projection sets the optional parameter "projection": Set of
  2382. // properties to return. Defaults to full.
  2383. //
  2384. // Possible values:
  2385. // "full" - Include all properties.
  2386. // "noAcl" - Omit acl and defaultObjectAcl properties.
  2387. func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
  2388. c.urlParams_.Set("projection", projection)
  2389. return c
  2390. }
  2391. // Fields allows partial responses to be retrieved. See
  2392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2393. // for more information.
  2394. func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
  2395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2396. return c
  2397. }
  2398. // Context sets the context to be used in this call's Do method. Any
  2399. // pending HTTP request will be aborted if the provided context is
  2400. // canceled.
  2401. func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
  2402. c.ctx_ = ctx
  2403. return c
  2404. }
  2405. // Header returns an http.Header that can be modified by the caller to
  2406. // add HTTP headers to the request.
  2407. func (c *BucketsPatchCall) Header() http.Header {
  2408. if c.header_ == nil {
  2409. c.header_ = make(http.Header)
  2410. }
  2411. return c.header_
  2412. }
  2413. func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  2414. reqHeaders := make(http.Header)
  2415. for k, v := range c.header_ {
  2416. reqHeaders[k] = v
  2417. }
  2418. reqHeaders.Set("User-Agent", c.s.userAgent())
  2419. var body io.Reader = nil
  2420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  2421. if err != nil {
  2422. return nil, err
  2423. }
  2424. reqHeaders.Set("Content-Type", "application/json")
  2425. c.urlParams_.Set("alt", alt)
  2426. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  2427. urls += "?" + c.urlParams_.Encode()
  2428. req, _ := http.NewRequest("PATCH", urls, body)
  2429. req.Header = reqHeaders
  2430. googleapi.Expand(req.URL, map[string]string{
  2431. "bucket": c.bucket,
  2432. })
  2433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2434. }
  2435. // Do executes the "storage.buckets.patch" call.
  2436. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  2437. // code is an error. Response headers are in either
  2438. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  2439. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2440. // check whether the returned error was because http.StatusNotModified
  2441. // was returned.
  2442. func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  2443. gensupport.SetOptions(c.urlParams_, opts...)
  2444. res, err := c.doRequest("json")
  2445. if res != nil && res.StatusCode == http.StatusNotModified {
  2446. if res.Body != nil {
  2447. res.Body.Close()
  2448. }
  2449. return nil, &googleapi.Error{
  2450. Code: res.StatusCode,
  2451. Header: res.Header,
  2452. }
  2453. }
  2454. if err != nil {
  2455. return nil, err
  2456. }
  2457. defer googleapi.CloseBody(res)
  2458. if err := googleapi.CheckResponse(res); err != nil {
  2459. return nil, err
  2460. }
  2461. ret := &Bucket{
  2462. ServerResponse: googleapi.ServerResponse{
  2463. Header: res.Header,
  2464. HTTPStatusCode: res.StatusCode,
  2465. },
  2466. }
  2467. target := &ret
  2468. if err := gensupport.DecodeResponse(target, res); err != nil {
  2469. return nil, err
  2470. }
  2471. return ret, nil
  2472. // {
  2473. // "description": "Updates a bucket. This method supports patch semantics.",
  2474. // "httpMethod": "PATCH",
  2475. // "id": "storage.buckets.patch",
  2476. // "parameterOrder": [
  2477. // "bucket"
  2478. // ],
  2479. // "parameters": {
  2480. // "bucket": {
  2481. // "description": "Name of a bucket.",
  2482. // "location": "path",
  2483. // "required": true,
  2484. // "type": "string"
  2485. // },
  2486. // "ifMetagenerationMatch": {
  2487. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  2488. // "format": "uint64",
  2489. // "location": "query",
  2490. // "type": "string"
  2491. // },
  2492. // "ifMetagenerationNotMatch": {
  2493. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  2494. // "format": "uint64",
  2495. // "location": "query",
  2496. // "type": "string"
  2497. // },
  2498. // "projection": {
  2499. // "description": "Set of properties to return. Defaults to full.",
  2500. // "enum": [
  2501. // "full",
  2502. // "noAcl"
  2503. // ],
  2504. // "enumDescriptions": [
  2505. // "Include all properties.",
  2506. // "Omit acl and defaultObjectAcl properties."
  2507. // ],
  2508. // "location": "query",
  2509. // "type": "string"
  2510. // }
  2511. // },
  2512. // "path": "b/{bucket}",
  2513. // "request": {
  2514. // "$ref": "Bucket"
  2515. // },
  2516. // "response": {
  2517. // "$ref": "Bucket"
  2518. // },
  2519. // "scopes": [
  2520. // "https://www.googleapis.com/auth/devstorage.full_control",
  2521. // "https://www.googleapis.com/auth/devstorage.read_write"
  2522. // ]
  2523. // }
  2524. }
  2525. // method id "storage.buckets.update":
  2526. type BucketsUpdateCall struct {
  2527. s *Service
  2528. bucket string
  2529. bucket2 *Bucket
  2530. urlParams_ gensupport.URLParams
  2531. ctx_ context.Context
  2532. header_ http.Header
  2533. }
  2534. // Update: Updates a bucket.
  2535. func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
  2536. c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2537. c.bucket = bucket
  2538. c.bucket2 = bucket2
  2539. return c
  2540. }
  2541. // IfMetagenerationMatch sets the optional parameter
  2542. // "ifMetagenerationMatch": Makes the return of the bucket metadata
  2543. // conditional on whether the bucket's current metageneration matches
  2544. // the given value.
  2545. func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsUpdateCall {
  2546. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  2547. return c
  2548. }
  2549. // IfMetagenerationNotMatch sets the optional parameter
  2550. // "ifMetagenerationNotMatch": Makes the return of the bucket metadata
  2551. // conditional on whether the bucket's current metageneration does not
  2552. // match the given value.
  2553. func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsUpdateCall {
  2554. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  2555. return c
  2556. }
  2557. // Projection sets the optional parameter "projection": Set of
  2558. // properties to return. Defaults to full.
  2559. //
  2560. // Possible values:
  2561. // "full" - Include all properties.
  2562. // "noAcl" - Omit acl and defaultObjectAcl properties.
  2563. func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
  2564. c.urlParams_.Set("projection", projection)
  2565. return c
  2566. }
  2567. // Fields allows partial responses to be retrieved. See
  2568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2569. // for more information.
  2570. func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
  2571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2572. return c
  2573. }
  2574. // Context sets the context to be used in this call's Do method. Any
  2575. // pending HTTP request will be aborted if the provided context is
  2576. // canceled.
  2577. func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
  2578. c.ctx_ = ctx
  2579. return c
  2580. }
  2581. // Header returns an http.Header that can be modified by the caller to
  2582. // add HTTP headers to the request.
  2583. func (c *BucketsUpdateCall) Header() http.Header {
  2584. if c.header_ == nil {
  2585. c.header_ = make(http.Header)
  2586. }
  2587. return c.header_
  2588. }
  2589. func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2590. reqHeaders := make(http.Header)
  2591. for k, v := range c.header_ {
  2592. reqHeaders[k] = v
  2593. }
  2594. reqHeaders.Set("User-Agent", c.s.userAgent())
  2595. var body io.Reader = nil
  2596. body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
  2597. if err != nil {
  2598. return nil, err
  2599. }
  2600. reqHeaders.Set("Content-Type", "application/json")
  2601. c.urlParams_.Set("alt", alt)
  2602. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
  2603. urls += "?" + c.urlParams_.Encode()
  2604. req, _ := http.NewRequest("PUT", urls, body)
  2605. req.Header = reqHeaders
  2606. googleapi.Expand(req.URL, map[string]string{
  2607. "bucket": c.bucket,
  2608. })
  2609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2610. }
  2611. // Do executes the "storage.buckets.update" call.
  2612. // Exactly one of *Bucket or error will be non-nil. Any non-2xx status
  2613. // code is an error. Response headers are in either
  2614. // *Bucket.ServerResponse.Header or (if a response was returned at all)
  2615. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2616. // check whether the returned error was because http.StatusNotModified
  2617. // was returned.
  2618. func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
  2619. gensupport.SetOptions(c.urlParams_, opts...)
  2620. res, err := c.doRequest("json")
  2621. if res != nil && res.StatusCode == http.StatusNotModified {
  2622. if res.Body != nil {
  2623. res.Body.Close()
  2624. }
  2625. return nil, &googleapi.Error{
  2626. Code: res.StatusCode,
  2627. Header: res.Header,
  2628. }
  2629. }
  2630. if err != nil {
  2631. return nil, err
  2632. }
  2633. defer googleapi.CloseBody(res)
  2634. if err := googleapi.CheckResponse(res); err != nil {
  2635. return nil, err
  2636. }
  2637. ret := &Bucket{
  2638. ServerResponse: googleapi.ServerResponse{
  2639. Header: res.Header,
  2640. HTTPStatusCode: res.StatusCode,
  2641. },
  2642. }
  2643. target := &ret
  2644. if err := gensupport.DecodeResponse(target, res); err != nil {
  2645. return nil, err
  2646. }
  2647. return ret, nil
  2648. // {
  2649. // "description": "Updates a bucket.",
  2650. // "httpMethod": "PUT",
  2651. // "id": "storage.buckets.update",
  2652. // "parameterOrder": [
  2653. // "bucket"
  2654. // ],
  2655. // "parameters": {
  2656. // "bucket": {
  2657. // "description": "Name of a bucket.",
  2658. // "location": "path",
  2659. // "required": true,
  2660. // "type": "string"
  2661. // },
  2662. // "ifMetagenerationMatch": {
  2663. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
  2664. // "format": "uint64",
  2665. // "location": "query",
  2666. // "type": "string"
  2667. // },
  2668. // "ifMetagenerationNotMatch": {
  2669. // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
  2670. // "format": "uint64",
  2671. // "location": "query",
  2672. // "type": "string"
  2673. // },
  2674. // "projection": {
  2675. // "description": "Set of properties to return. Defaults to full.",
  2676. // "enum": [
  2677. // "full",
  2678. // "noAcl"
  2679. // ],
  2680. // "enumDescriptions": [
  2681. // "Include all properties.",
  2682. // "Omit acl and defaultObjectAcl properties."
  2683. // ],
  2684. // "location": "query",
  2685. // "type": "string"
  2686. // }
  2687. // },
  2688. // "path": "b/{bucket}",
  2689. // "request": {
  2690. // "$ref": "Bucket"
  2691. // },
  2692. // "response": {
  2693. // "$ref": "Bucket"
  2694. // },
  2695. // "scopes": [
  2696. // "https://www.googleapis.com/auth/devstorage.full_control",
  2697. // "https://www.googleapis.com/auth/devstorage.read_write"
  2698. // ]
  2699. // }
  2700. }
  2701. // method id "storage.channels.stop":
  2702. type ChannelsStopCall struct {
  2703. s *Service
  2704. channel *Channel
  2705. urlParams_ gensupport.URLParams
  2706. ctx_ context.Context
  2707. header_ http.Header
  2708. }
  2709. // Stop: Stop watching resources through this channel
  2710. func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
  2711. c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2712. c.channel = channel
  2713. return c
  2714. }
  2715. // Fields allows partial responses to be retrieved. See
  2716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2717. // for more information.
  2718. func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
  2719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2720. return c
  2721. }
  2722. // Context sets the context to be used in this call's Do method. Any
  2723. // pending HTTP request will be aborted if the provided context is
  2724. // canceled.
  2725. func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
  2726. c.ctx_ = ctx
  2727. return c
  2728. }
  2729. // Header returns an http.Header that can be modified by the caller to
  2730. // add HTTP headers to the request.
  2731. func (c *ChannelsStopCall) Header() http.Header {
  2732. if c.header_ == nil {
  2733. c.header_ = make(http.Header)
  2734. }
  2735. return c.header_
  2736. }
  2737. func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
  2738. reqHeaders := make(http.Header)
  2739. for k, v := range c.header_ {
  2740. reqHeaders[k] = v
  2741. }
  2742. reqHeaders.Set("User-Agent", c.s.userAgent())
  2743. var body io.Reader = nil
  2744. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  2745. if err != nil {
  2746. return nil, err
  2747. }
  2748. reqHeaders.Set("Content-Type", "application/json")
  2749. c.urlParams_.Set("alt", alt)
  2750. urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
  2751. urls += "?" + c.urlParams_.Encode()
  2752. req, _ := http.NewRequest("POST", urls, body)
  2753. req.Header = reqHeaders
  2754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2755. }
  2756. // Do executes the "storage.channels.stop" call.
  2757. func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
  2758. gensupport.SetOptions(c.urlParams_, opts...)
  2759. res, err := c.doRequest("json")
  2760. if err != nil {
  2761. return err
  2762. }
  2763. defer googleapi.CloseBody(res)
  2764. if err := googleapi.CheckResponse(res); err != nil {
  2765. return err
  2766. }
  2767. return nil
  2768. // {
  2769. // "description": "Stop watching resources through this channel",
  2770. // "httpMethod": "POST",
  2771. // "id": "storage.channels.stop",
  2772. // "path": "channels/stop",
  2773. // "request": {
  2774. // "$ref": "Channel",
  2775. // "parameterName": "resource"
  2776. // },
  2777. // "scopes": [
  2778. // "https://www.googleapis.com/auth/devstorage.full_control",
  2779. // "https://www.googleapis.com/auth/devstorage.read_only",
  2780. // "https://www.googleapis.com/auth/devstorage.read_write"
  2781. // ]
  2782. // }
  2783. }
  2784. // method id "storage.defaultObjectAccessControls.delete":
  2785. type DefaultObjectAccessControlsDeleteCall struct {
  2786. s *Service
  2787. bucket string
  2788. entity string
  2789. urlParams_ gensupport.URLParams
  2790. ctx_ context.Context
  2791. header_ http.Header
  2792. }
  2793. // Delete: Permanently deletes the default object ACL entry for the
  2794. // specified entity on the specified bucket.
  2795. func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
  2796. c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2797. c.bucket = bucket
  2798. c.entity = entity
  2799. return c
  2800. }
  2801. // Fields allows partial responses to be retrieved. See
  2802. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2803. // for more information.
  2804. func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
  2805. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2806. return c
  2807. }
  2808. // Context sets the context to be used in this call's Do method. Any
  2809. // pending HTTP request will be aborted if the provided context is
  2810. // canceled.
  2811. func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
  2812. c.ctx_ = ctx
  2813. return c
  2814. }
  2815. // Header returns an http.Header that can be modified by the caller to
  2816. // add HTTP headers to the request.
  2817. func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
  2818. if c.header_ == nil {
  2819. c.header_ = make(http.Header)
  2820. }
  2821. return c.header_
  2822. }
  2823. func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2824. reqHeaders := make(http.Header)
  2825. for k, v := range c.header_ {
  2826. reqHeaders[k] = v
  2827. }
  2828. reqHeaders.Set("User-Agent", c.s.userAgent())
  2829. var body io.Reader = nil
  2830. c.urlParams_.Set("alt", alt)
  2831. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  2832. urls += "?" + c.urlParams_.Encode()
  2833. req, _ := http.NewRequest("DELETE", urls, body)
  2834. req.Header = reqHeaders
  2835. googleapi.Expand(req.URL, map[string]string{
  2836. "bucket": c.bucket,
  2837. "entity": c.entity,
  2838. })
  2839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2840. }
  2841. // Do executes the "storage.defaultObjectAccessControls.delete" call.
  2842. func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2843. gensupport.SetOptions(c.urlParams_, opts...)
  2844. res, err := c.doRequest("json")
  2845. if err != nil {
  2846. return err
  2847. }
  2848. defer googleapi.CloseBody(res)
  2849. if err := googleapi.CheckResponse(res); err != nil {
  2850. return err
  2851. }
  2852. return nil
  2853. // {
  2854. // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
  2855. // "httpMethod": "DELETE",
  2856. // "id": "storage.defaultObjectAccessControls.delete",
  2857. // "parameterOrder": [
  2858. // "bucket",
  2859. // "entity"
  2860. // ],
  2861. // "parameters": {
  2862. // "bucket": {
  2863. // "description": "Name of a bucket.",
  2864. // "location": "path",
  2865. // "required": true,
  2866. // "type": "string"
  2867. // },
  2868. // "entity": {
  2869. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  2870. // "location": "path",
  2871. // "required": true,
  2872. // "type": "string"
  2873. // }
  2874. // },
  2875. // "path": "b/{bucket}/defaultObjectAcl/{entity}",
  2876. // "scopes": [
  2877. // "https://www.googleapis.com/auth/devstorage.full_control"
  2878. // ]
  2879. // }
  2880. }
  2881. // method id "storage.defaultObjectAccessControls.get":
  2882. type DefaultObjectAccessControlsGetCall struct {
  2883. s *Service
  2884. bucket string
  2885. entity string
  2886. urlParams_ gensupport.URLParams
  2887. ifNoneMatch_ string
  2888. ctx_ context.Context
  2889. header_ http.Header
  2890. }
  2891. // Get: Returns the default object ACL entry for the specified entity on
  2892. // the specified bucket.
  2893. func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
  2894. c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2895. c.bucket = bucket
  2896. c.entity = entity
  2897. return c
  2898. }
  2899. // Fields allows partial responses to be retrieved. See
  2900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2901. // for more information.
  2902. func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
  2903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2904. return c
  2905. }
  2906. // IfNoneMatch sets the optional parameter which makes the operation
  2907. // fail if the object's ETag matches the given value. This is useful for
  2908. // getting updates only after the object has changed since the last
  2909. // request. Use googleapi.IsNotModified to check whether the response
  2910. // error from Do is the result of In-None-Match.
  2911. func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
  2912. c.ifNoneMatch_ = entityTag
  2913. return c
  2914. }
  2915. // Context sets the context to be used in this call's Do method. Any
  2916. // pending HTTP request will be aborted if the provided context is
  2917. // canceled.
  2918. func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
  2919. c.ctx_ = ctx
  2920. return c
  2921. }
  2922. // Header returns an http.Header that can be modified by the caller to
  2923. // add HTTP headers to the request.
  2924. func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
  2925. if c.header_ == nil {
  2926. c.header_ = make(http.Header)
  2927. }
  2928. return c.header_
  2929. }
  2930. func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  2931. reqHeaders := make(http.Header)
  2932. for k, v := range c.header_ {
  2933. reqHeaders[k] = v
  2934. }
  2935. reqHeaders.Set("User-Agent", c.s.userAgent())
  2936. if c.ifNoneMatch_ != "" {
  2937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2938. }
  2939. var body io.Reader = nil
  2940. c.urlParams_.Set("alt", alt)
  2941. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  2942. urls += "?" + c.urlParams_.Encode()
  2943. req, _ := http.NewRequest("GET", urls, body)
  2944. req.Header = reqHeaders
  2945. googleapi.Expand(req.URL, map[string]string{
  2946. "bucket": c.bucket,
  2947. "entity": c.entity,
  2948. })
  2949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2950. }
  2951. // Do executes the "storage.defaultObjectAccessControls.get" call.
  2952. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  2953. // non-2xx status code is an error. Response headers are in either
  2954. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  2955. // returned at all) in error.(*googleapi.Error).Header. Use
  2956. // googleapi.IsNotModified to check whether the returned error was
  2957. // because http.StatusNotModified was returned.
  2958. func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  2959. gensupport.SetOptions(c.urlParams_, opts...)
  2960. res, err := c.doRequest("json")
  2961. if res != nil && res.StatusCode == http.StatusNotModified {
  2962. if res.Body != nil {
  2963. res.Body.Close()
  2964. }
  2965. return nil, &googleapi.Error{
  2966. Code: res.StatusCode,
  2967. Header: res.Header,
  2968. }
  2969. }
  2970. if err != nil {
  2971. return nil, err
  2972. }
  2973. defer googleapi.CloseBody(res)
  2974. if err := googleapi.CheckResponse(res); err != nil {
  2975. return nil, err
  2976. }
  2977. ret := &ObjectAccessControl{
  2978. ServerResponse: googleapi.ServerResponse{
  2979. Header: res.Header,
  2980. HTTPStatusCode: res.StatusCode,
  2981. },
  2982. }
  2983. target := &ret
  2984. if err := gensupport.DecodeResponse(target, res); err != nil {
  2985. return nil, err
  2986. }
  2987. return ret, nil
  2988. // {
  2989. // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
  2990. // "httpMethod": "GET",
  2991. // "id": "storage.defaultObjectAccessControls.get",
  2992. // "parameterOrder": [
  2993. // "bucket",
  2994. // "entity"
  2995. // ],
  2996. // "parameters": {
  2997. // "bucket": {
  2998. // "description": "Name of a bucket.",
  2999. // "location": "path",
  3000. // "required": true,
  3001. // "type": "string"
  3002. // },
  3003. // "entity": {
  3004. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3005. // "location": "path",
  3006. // "required": true,
  3007. // "type": "string"
  3008. // }
  3009. // },
  3010. // "path": "b/{bucket}/defaultObjectAcl/{entity}",
  3011. // "response": {
  3012. // "$ref": "ObjectAccessControl"
  3013. // },
  3014. // "scopes": [
  3015. // "https://www.googleapis.com/auth/devstorage.full_control"
  3016. // ]
  3017. // }
  3018. }
  3019. // method id "storage.defaultObjectAccessControls.insert":
  3020. type DefaultObjectAccessControlsInsertCall struct {
  3021. s *Service
  3022. bucket string
  3023. objectaccesscontrol *ObjectAccessControl
  3024. urlParams_ gensupport.URLParams
  3025. ctx_ context.Context
  3026. header_ http.Header
  3027. }
  3028. // Insert: Creates a new default object ACL entry on the specified
  3029. // bucket.
  3030. func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
  3031. c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3032. c.bucket = bucket
  3033. c.objectaccesscontrol = objectaccesscontrol
  3034. return c
  3035. }
  3036. // Fields allows partial responses to be retrieved. See
  3037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3038. // for more information.
  3039. func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
  3040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3041. return c
  3042. }
  3043. // Context sets the context to be used in this call's Do method. Any
  3044. // pending HTTP request will be aborted if the provided context is
  3045. // canceled.
  3046. func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
  3047. c.ctx_ = ctx
  3048. return c
  3049. }
  3050. // Header returns an http.Header that can be modified by the caller to
  3051. // add HTTP headers to the request.
  3052. func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
  3053. if c.header_ == nil {
  3054. c.header_ = make(http.Header)
  3055. }
  3056. return c.header_
  3057. }
  3058. func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  3059. reqHeaders := make(http.Header)
  3060. for k, v := range c.header_ {
  3061. reqHeaders[k] = v
  3062. }
  3063. reqHeaders.Set("User-Agent", c.s.userAgent())
  3064. var body io.Reader = nil
  3065. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  3066. if err != nil {
  3067. return nil, err
  3068. }
  3069. reqHeaders.Set("Content-Type", "application/json")
  3070. c.urlParams_.Set("alt", alt)
  3071. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
  3072. urls += "?" + c.urlParams_.Encode()
  3073. req, _ := http.NewRequest("POST", urls, body)
  3074. req.Header = reqHeaders
  3075. googleapi.Expand(req.URL, map[string]string{
  3076. "bucket": c.bucket,
  3077. })
  3078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3079. }
  3080. // Do executes the "storage.defaultObjectAccessControls.insert" call.
  3081. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3082. // non-2xx status code is an error. Response headers are in either
  3083. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3084. // returned at all) in error.(*googleapi.Error).Header. Use
  3085. // googleapi.IsNotModified to check whether the returned error was
  3086. // because http.StatusNotModified was returned.
  3087. func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3088. gensupport.SetOptions(c.urlParams_, opts...)
  3089. res, err := c.doRequest("json")
  3090. if res != nil && res.StatusCode == http.StatusNotModified {
  3091. if res.Body != nil {
  3092. res.Body.Close()
  3093. }
  3094. return nil, &googleapi.Error{
  3095. Code: res.StatusCode,
  3096. Header: res.Header,
  3097. }
  3098. }
  3099. if err != nil {
  3100. return nil, err
  3101. }
  3102. defer googleapi.CloseBody(res)
  3103. if err := googleapi.CheckResponse(res); err != nil {
  3104. return nil, err
  3105. }
  3106. ret := &ObjectAccessControl{
  3107. ServerResponse: googleapi.ServerResponse{
  3108. Header: res.Header,
  3109. HTTPStatusCode: res.StatusCode,
  3110. },
  3111. }
  3112. target := &ret
  3113. if err := gensupport.DecodeResponse(target, res); err != nil {
  3114. return nil, err
  3115. }
  3116. return ret, nil
  3117. // {
  3118. // "description": "Creates a new default object ACL entry on the specified bucket.",
  3119. // "httpMethod": "POST",
  3120. // "id": "storage.defaultObjectAccessControls.insert",
  3121. // "parameterOrder": [
  3122. // "bucket"
  3123. // ],
  3124. // "parameters": {
  3125. // "bucket": {
  3126. // "description": "Name of a bucket.",
  3127. // "location": "path",
  3128. // "required": true,
  3129. // "type": "string"
  3130. // }
  3131. // },
  3132. // "path": "b/{bucket}/defaultObjectAcl",
  3133. // "request": {
  3134. // "$ref": "ObjectAccessControl"
  3135. // },
  3136. // "response": {
  3137. // "$ref": "ObjectAccessControl"
  3138. // },
  3139. // "scopes": [
  3140. // "https://www.googleapis.com/auth/devstorage.full_control"
  3141. // ]
  3142. // }
  3143. }
  3144. // method id "storage.defaultObjectAccessControls.list":
  3145. type DefaultObjectAccessControlsListCall struct {
  3146. s *Service
  3147. bucket string
  3148. urlParams_ gensupport.URLParams
  3149. ifNoneMatch_ string
  3150. ctx_ context.Context
  3151. header_ http.Header
  3152. }
  3153. // List: Retrieves default object ACL entries on the specified bucket.
  3154. func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
  3155. c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3156. c.bucket = bucket
  3157. return c
  3158. }
  3159. // IfMetagenerationMatch sets the optional parameter
  3160. // "ifMetagenerationMatch": If present, only return default ACL listing
  3161. // if the bucket's current metageneration matches this value.
  3162. func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
  3163. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  3164. return c
  3165. }
  3166. // IfMetagenerationNotMatch sets the optional parameter
  3167. // "ifMetagenerationNotMatch": If present, only return default ACL
  3168. // listing if the bucket's current metageneration does not match the
  3169. // given value.
  3170. func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
  3171. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  3172. return c
  3173. }
  3174. // Fields allows partial responses to be retrieved. See
  3175. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3176. // for more information.
  3177. func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
  3178. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3179. return c
  3180. }
  3181. // IfNoneMatch sets the optional parameter which makes the operation
  3182. // fail if the object's ETag matches the given value. This is useful for
  3183. // getting updates only after the object has changed since the last
  3184. // request. Use googleapi.IsNotModified to check whether the response
  3185. // error from Do is the result of In-None-Match.
  3186. func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
  3187. c.ifNoneMatch_ = entityTag
  3188. return c
  3189. }
  3190. // Context sets the context to be used in this call's Do method. Any
  3191. // pending HTTP request will be aborted if the provided context is
  3192. // canceled.
  3193. func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
  3194. c.ctx_ = ctx
  3195. return c
  3196. }
  3197. // Header returns an http.Header that can be modified by the caller to
  3198. // add HTTP headers to the request.
  3199. func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
  3200. if c.header_ == nil {
  3201. c.header_ = make(http.Header)
  3202. }
  3203. return c.header_
  3204. }
  3205. func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  3206. reqHeaders := make(http.Header)
  3207. for k, v := range c.header_ {
  3208. reqHeaders[k] = v
  3209. }
  3210. reqHeaders.Set("User-Agent", c.s.userAgent())
  3211. if c.ifNoneMatch_ != "" {
  3212. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3213. }
  3214. var body io.Reader = nil
  3215. c.urlParams_.Set("alt", alt)
  3216. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
  3217. urls += "?" + c.urlParams_.Encode()
  3218. req, _ := http.NewRequest("GET", urls, body)
  3219. req.Header = reqHeaders
  3220. googleapi.Expand(req.URL, map[string]string{
  3221. "bucket": c.bucket,
  3222. })
  3223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3224. }
  3225. // Do executes the "storage.defaultObjectAccessControls.list" call.
  3226. // Exactly one of *ObjectAccessControls or error will be non-nil. Any
  3227. // non-2xx status code is an error. Response headers are in either
  3228. // *ObjectAccessControls.ServerResponse.Header or (if a response was
  3229. // returned at all) in error.(*googleapi.Error).Header. Use
  3230. // googleapi.IsNotModified to check whether the returned error was
  3231. // because http.StatusNotModified was returned.
  3232. func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  3233. gensupport.SetOptions(c.urlParams_, opts...)
  3234. res, err := c.doRequest("json")
  3235. if res != nil && res.StatusCode == http.StatusNotModified {
  3236. if res.Body != nil {
  3237. res.Body.Close()
  3238. }
  3239. return nil, &googleapi.Error{
  3240. Code: res.StatusCode,
  3241. Header: res.Header,
  3242. }
  3243. }
  3244. if err != nil {
  3245. return nil, err
  3246. }
  3247. defer googleapi.CloseBody(res)
  3248. if err := googleapi.CheckResponse(res); err != nil {
  3249. return nil, err
  3250. }
  3251. ret := &ObjectAccessControls{
  3252. ServerResponse: googleapi.ServerResponse{
  3253. Header: res.Header,
  3254. HTTPStatusCode: res.StatusCode,
  3255. },
  3256. }
  3257. target := &ret
  3258. if err := gensupport.DecodeResponse(target, res); err != nil {
  3259. return nil, err
  3260. }
  3261. return ret, nil
  3262. // {
  3263. // "description": "Retrieves default object ACL entries on the specified bucket.",
  3264. // "httpMethod": "GET",
  3265. // "id": "storage.defaultObjectAccessControls.list",
  3266. // "parameterOrder": [
  3267. // "bucket"
  3268. // ],
  3269. // "parameters": {
  3270. // "bucket": {
  3271. // "description": "Name of a bucket.",
  3272. // "location": "path",
  3273. // "required": true,
  3274. // "type": "string"
  3275. // },
  3276. // "ifMetagenerationMatch": {
  3277. // "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
  3278. // "format": "int64",
  3279. // "location": "query",
  3280. // "type": "string"
  3281. // },
  3282. // "ifMetagenerationNotMatch": {
  3283. // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
  3284. // "format": "int64",
  3285. // "location": "query",
  3286. // "type": "string"
  3287. // }
  3288. // },
  3289. // "path": "b/{bucket}/defaultObjectAcl",
  3290. // "response": {
  3291. // "$ref": "ObjectAccessControls"
  3292. // },
  3293. // "scopes": [
  3294. // "https://www.googleapis.com/auth/devstorage.full_control"
  3295. // ]
  3296. // }
  3297. }
  3298. // method id "storage.defaultObjectAccessControls.patch":
  3299. type DefaultObjectAccessControlsPatchCall struct {
  3300. s *Service
  3301. bucket string
  3302. entity string
  3303. objectaccesscontrol *ObjectAccessControl
  3304. urlParams_ gensupport.URLParams
  3305. ctx_ context.Context
  3306. header_ http.Header
  3307. }
  3308. // Patch: Updates a default object ACL entry on the specified bucket.
  3309. // This method supports patch semantics.
  3310. func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
  3311. c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3312. c.bucket = bucket
  3313. c.entity = entity
  3314. c.objectaccesscontrol = objectaccesscontrol
  3315. return c
  3316. }
  3317. // Fields allows partial responses to be retrieved. See
  3318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3319. // for more information.
  3320. func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
  3321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3322. return c
  3323. }
  3324. // Context sets the context to be used in this call's Do method. Any
  3325. // pending HTTP request will be aborted if the provided context is
  3326. // canceled.
  3327. func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
  3328. c.ctx_ = ctx
  3329. return c
  3330. }
  3331. // Header returns an http.Header that can be modified by the caller to
  3332. // add HTTP headers to the request.
  3333. func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
  3334. if c.header_ == nil {
  3335. c.header_ = make(http.Header)
  3336. }
  3337. return c.header_
  3338. }
  3339. func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  3340. reqHeaders := make(http.Header)
  3341. for k, v := range c.header_ {
  3342. reqHeaders[k] = v
  3343. }
  3344. reqHeaders.Set("User-Agent", c.s.userAgent())
  3345. var body io.Reader = nil
  3346. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  3347. if err != nil {
  3348. return nil, err
  3349. }
  3350. reqHeaders.Set("Content-Type", "application/json")
  3351. c.urlParams_.Set("alt", alt)
  3352. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  3353. urls += "?" + c.urlParams_.Encode()
  3354. req, _ := http.NewRequest("PATCH", urls, body)
  3355. req.Header = reqHeaders
  3356. googleapi.Expand(req.URL, map[string]string{
  3357. "bucket": c.bucket,
  3358. "entity": c.entity,
  3359. })
  3360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3361. }
  3362. // Do executes the "storage.defaultObjectAccessControls.patch" call.
  3363. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3364. // non-2xx status code is an error. Response headers are in either
  3365. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3366. // returned at all) in error.(*googleapi.Error).Header. Use
  3367. // googleapi.IsNotModified to check whether the returned error was
  3368. // because http.StatusNotModified was returned.
  3369. func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3370. gensupport.SetOptions(c.urlParams_, opts...)
  3371. res, err := c.doRequest("json")
  3372. if res != nil && res.StatusCode == http.StatusNotModified {
  3373. if res.Body != nil {
  3374. res.Body.Close()
  3375. }
  3376. return nil, &googleapi.Error{
  3377. Code: res.StatusCode,
  3378. Header: res.Header,
  3379. }
  3380. }
  3381. if err != nil {
  3382. return nil, err
  3383. }
  3384. defer googleapi.CloseBody(res)
  3385. if err := googleapi.CheckResponse(res); err != nil {
  3386. return nil, err
  3387. }
  3388. ret := &ObjectAccessControl{
  3389. ServerResponse: googleapi.ServerResponse{
  3390. Header: res.Header,
  3391. HTTPStatusCode: res.StatusCode,
  3392. },
  3393. }
  3394. target := &ret
  3395. if err := gensupport.DecodeResponse(target, res); err != nil {
  3396. return nil, err
  3397. }
  3398. return ret, nil
  3399. // {
  3400. // "description": "Updates a default object ACL entry on the specified bucket. This method supports patch semantics.",
  3401. // "httpMethod": "PATCH",
  3402. // "id": "storage.defaultObjectAccessControls.patch",
  3403. // "parameterOrder": [
  3404. // "bucket",
  3405. // "entity"
  3406. // ],
  3407. // "parameters": {
  3408. // "bucket": {
  3409. // "description": "Name of a bucket.",
  3410. // "location": "path",
  3411. // "required": true,
  3412. // "type": "string"
  3413. // },
  3414. // "entity": {
  3415. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3416. // "location": "path",
  3417. // "required": true,
  3418. // "type": "string"
  3419. // }
  3420. // },
  3421. // "path": "b/{bucket}/defaultObjectAcl/{entity}",
  3422. // "request": {
  3423. // "$ref": "ObjectAccessControl"
  3424. // },
  3425. // "response": {
  3426. // "$ref": "ObjectAccessControl"
  3427. // },
  3428. // "scopes": [
  3429. // "https://www.googleapis.com/auth/devstorage.full_control"
  3430. // ]
  3431. // }
  3432. }
  3433. // method id "storage.defaultObjectAccessControls.update":
  3434. type DefaultObjectAccessControlsUpdateCall struct {
  3435. s *Service
  3436. bucket string
  3437. entity string
  3438. objectaccesscontrol *ObjectAccessControl
  3439. urlParams_ gensupport.URLParams
  3440. ctx_ context.Context
  3441. header_ http.Header
  3442. }
  3443. // Update: Updates a default object ACL entry on the specified bucket.
  3444. func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
  3445. c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3446. c.bucket = bucket
  3447. c.entity = entity
  3448. c.objectaccesscontrol = objectaccesscontrol
  3449. return c
  3450. }
  3451. // Fields allows partial responses to be retrieved. See
  3452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3453. // for more information.
  3454. func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
  3455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3456. return c
  3457. }
  3458. // Context sets the context to be used in this call's Do method. Any
  3459. // pending HTTP request will be aborted if the provided context is
  3460. // canceled.
  3461. func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
  3462. c.ctx_ = ctx
  3463. return c
  3464. }
  3465. // Header returns an http.Header that can be modified by the caller to
  3466. // add HTTP headers to the request.
  3467. func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
  3468. if c.header_ == nil {
  3469. c.header_ = make(http.Header)
  3470. }
  3471. return c.header_
  3472. }
  3473. func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3474. reqHeaders := make(http.Header)
  3475. for k, v := range c.header_ {
  3476. reqHeaders[k] = v
  3477. }
  3478. reqHeaders.Set("User-Agent", c.s.userAgent())
  3479. var body io.Reader = nil
  3480. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  3481. if err != nil {
  3482. return nil, err
  3483. }
  3484. reqHeaders.Set("Content-Type", "application/json")
  3485. c.urlParams_.Set("alt", alt)
  3486. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
  3487. urls += "?" + c.urlParams_.Encode()
  3488. req, _ := http.NewRequest("PUT", urls, body)
  3489. req.Header = reqHeaders
  3490. googleapi.Expand(req.URL, map[string]string{
  3491. "bucket": c.bucket,
  3492. "entity": c.entity,
  3493. })
  3494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3495. }
  3496. // Do executes the "storage.defaultObjectAccessControls.update" call.
  3497. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3498. // non-2xx status code is an error. Response headers are in either
  3499. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3500. // returned at all) in error.(*googleapi.Error).Header. Use
  3501. // googleapi.IsNotModified to check whether the returned error was
  3502. // because http.StatusNotModified was returned.
  3503. func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3504. gensupport.SetOptions(c.urlParams_, opts...)
  3505. res, err := c.doRequest("json")
  3506. if res != nil && res.StatusCode == http.StatusNotModified {
  3507. if res.Body != nil {
  3508. res.Body.Close()
  3509. }
  3510. return nil, &googleapi.Error{
  3511. Code: res.StatusCode,
  3512. Header: res.Header,
  3513. }
  3514. }
  3515. if err != nil {
  3516. return nil, err
  3517. }
  3518. defer googleapi.CloseBody(res)
  3519. if err := googleapi.CheckResponse(res); err != nil {
  3520. return nil, err
  3521. }
  3522. ret := &ObjectAccessControl{
  3523. ServerResponse: googleapi.ServerResponse{
  3524. Header: res.Header,
  3525. HTTPStatusCode: res.StatusCode,
  3526. },
  3527. }
  3528. target := &ret
  3529. if err := gensupport.DecodeResponse(target, res); err != nil {
  3530. return nil, err
  3531. }
  3532. return ret, nil
  3533. // {
  3534. // "description": "Updates a default object ACL entry on the specified bucket.",
  3535. // "httpMethod": "PUT",
  3536. // "id": "storage.defaultObjectAccessControls.update",
  3537. // "parameterOrder": [
  3538. // "bucket",
  3539. // "entity"
  3540. // ],
  3541. // "parameters": {
  3542. // "bucket": {
  3543. // "description": "Name of a bucket.",
  3544. // "location": "path",
  3545. // "required": true,
  3546. // "type": "string"
  3547. // },
  3548. // "entity": {
  3549. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3550. // "location": "path",
  3551. // "required": true,
  3552. // "type": "string"
  3553. // }
  3554. // },
  3555. // "path": "b/{bucket}/defaultObjectAcl/{entity}",
  3556. // "request": {
  3557. // "$ref": "ObjectAccessControl"
  3558. // },
  3559. // "response": {
  3560. // "$ref": "ObjectAccessControl"
  3561. // },
  3562. // "scopes": [
  3563. // "https://www.googleapis.com/auth/devstorage.full_control"
  3564. // ]
  3565. // }
  3566. }
  3567. // method id "storage.objectAccessControls.delete":
  3568. type ObjectAccessControlsDeleteCall struct {
  3569. s *Service
  3570. bucket string
  3571. object string
  3572. entity string
  3573. urlParams_ gensupport.URLParams
  3574. ctx_ context.Context
  3575. header_ http.Header
  3576. }
  3577. // Delete: Permanently deletes the ACL entry for the specified entity on
  3578. // the specified object.
  3579. func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
  3580. c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3581. c.bucket = bucket
  3582. c.object = object
  3583. c.entity = entity
  3584. return c
  3585. }
  3586. // Generation sets the optional parameter "generation": If present,
  3587. // selects a specific revision of this object (as opposed to the latest
  3588. // version, the default).
  3589. func (c *ObjectAccessControlsDeleteCall) Generation(generation uint64) *ObjectAccessControlsDeleteCall {
  3590. c.urlParams_.Set("generation", fmt.Sprint(generation))
  3591. return c
  3592. }
  3593. // Fields allows partial responses to be retrieved. See
  3594. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3595. // for more information.
  3596. func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
  3597. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3598. return c
  3599. }
  3600. // Context sets the context to be used in this call's Do method. Any
  3601. // pending HTTP request will be aborted if the provided context is
  3602. // canceled.
  3603. func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
  3604. c.ctx_ = ctx
  3605. return c
  3606. }
  3607. // Header returns an http.Header that can be modified by the caller to
  3608. // add HTTP headers to the request.
  3609. func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
  3610. if c.header_ == nil {
  3611. c.header_ = make(http.Header)
  3612. }
  3613. return c.header_
  3614. }
  3615. func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3616. reqHeaders := make(http.Header)
  3617. for k, v := range c.header_ {
  3618. reqHeaders[k] = v
  3619. }
  3620. reqHeaders.Set("User-Agent", c.s.userAgent())
  3621. var body io.Reader = nil
  3622. c.urlParams_.Set("alt", alt)
  3623. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  3624. urls += "?" + c.urlParams_.Encode()
  3625. req, _ := http.NewRequest("DELETE", urls, body)
  3626. req.Header = reqHeaders
  3627. googleapi.Expand(req.URL, map[string]string{
  3628. "bucket": c.bucket,
  3629. "object": c.object,
  3630. "entity": c.entity,
  3631. })
  3632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3633. }
  3634. // Do executes the "storage.objectAccessControls.delete" call.
  3635. func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
  3636. gensupport.SetOptions(c.urlParams_, opts...)
  3637. res, err := c.doRequest("json")
  3638. if err != nil {
  3639. return err
  3640. }
  3641. defer googleapi.CloseBody(res)
  3642. if err := googleapi.CheckResponse(res); err != nil {
  3643. return err
  3644. }
  3645. return nil
  3646. // {
  3647. // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
  3648. // "httpMethod": "DELETE",
  3649. // "id": "storage.objectAccessControls.delete",
  3650. // "parameterOrder": [
  3651. // "bucket",
  3652. // "object",
  3653. // "entity"
  3654. // ],
  3655. // "parameters": {
  3656. // "bucket": {
  3657. // "description": "Name of a bucket.",
  3658. // "location": "path",
  3659. // "required": true,
  3660. // "type": "string"
  3661. // },
  3662. // "entity": {
  3663. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3664. // "location": "path",
  3665. // "required": true,
  3666. // "type": "string"
  3667. // },
  3668. // "generation": {
  3669. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  3670. // "format": "uint64",
  3671. // "location": "query",
  3672. // "type": "string"
  3673. // },
  3674. // "object": {
  3675. // "description": "Name of the object.",
  3676. // "location": "path",
  3677. // "required": true,
  3678. // "type": "string"
  3679. // }
  3680. // },
  3681. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  3682. // "scopes": [
  3683. // "https://www.googleapis.com/auth/devstorage.full_control"
  3684. // ]
  3685. // }
  3686. }
  3687. // method id "storage.objectAccessControls.get":
  3688. type ObjectAccessControlsGetCall struct {
  3689. s *Service
  3690. bucket string
  3691. object string
  3692. entity string
  3693. urlParams_ gensupport.URLParams
  3694. ifNoneMatch_ string
  3695. ctx_ context.Context
  3696. header_ http.Header
  3697. }
  3698. // Get: Returns the ACL entry for the specified entity on the specified
  3699. // object.
  3700. func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
  3701. c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3702. c.bucket = bucket
  3703. c.object = object
  3704. c.entity = entity
  3705. return c
  3706. }
  3707. // Generation sets the optional parameter "generation": If present,
  3708. // selects a specific revision of this object (as opposed to the latest
  3709. // version, the default).
  3710. func (c *ObjectAccessControlsGetCall) Generation(generation uint64) *ObjectAccessControlsGetCall {
  3711. c.urlParams_.Set("generation", fmt.Sprint(generation))
  3712. return c
  3713. }
  3714. // Fields allows partial responses to be retrieved. See
  3715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3716. // for more information.
  3717. func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
  3718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3719. return c
  3720. }
  3721. // IfNoneMatch sets the optional parameter which makes the operation
  3722. // fail if the object's ETag matches the given value. This is useful for
  3723. // getting updates only after the object has changed since the last
  3724. // request. Use googleapi.IsNotModified to check whether the response
  3725. // error from Do is the result of In-None-Match.
  3726. func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
  3727. c.ifNoneMatch_ = entityTag
  3728. return c
  3729. }
  3730. // Context sets the context to be used in this call's Do method. Any
  3731. // pending HTTP request will be aborted if the provided context is
  3732. // canceled.
  3733. func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
  3734. c.ctx_ = ctx
  3735. return c
  3736. }
  3737. // Header returns an http.Header that can be modified by the caller to
  3738. // add HTTP headers to the request.
  3739. func (c *ObjectAccessControlsGetCall) Header() http.Header {
  3740. if c.header_ == nil {
  3741. c.header_ = make(http.Header)
  3742. }
  3743. return c.header_
  3744. }
  3745. func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
  3746. reqHeaders := make(http.Header)
  3747. for k, v := range c.header_ {
  3748. reqHeaders[k] = v
  3749. }
  3750. reqHeaders.Set("User-Agent", c.s.userAgent())
  3751. if c.ifNoneMatch_ != "" {
  3752. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3753. }
  3754. var body io.Reader = nil
  3755. c.urlParams_.Set("alt", alt)
  3756. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  3757. urls += "?" + c.urlParams_.Encode()
  3758. req, _ := http.NewRequest("GET", urls, body)
  3759. req.Header = reqHeaders
  3760. googleapi.Expand(req.URL, map[string]string{
  3761. "bucket": c.bucket,
  3762. "object": c.object,
  3763. "entity": c.entity,
  3764. })
  3765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3766. }
  3767. // Do executes the "storage.objectAccessControls.get" call.
  3768. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3769. // non-2xx status code is an error. Response headers are in either
  3770. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3771. // returned at all) in error.(*googleapi.Error).Header. Use
  3772. // googleapi.IsNotModified to check whether the returned error was
  3773. // because http.StatusNotModified was returned.
  3774. func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3775. gensupport.SetOptions(c.urlParams_, opts...)
  3776. res, err := c.doRequest("json")
  3777. if res != nil && res.StatusCode == http.StatusNotModified {
  3778. if res.Body != nil {
  3779. res.Body.Close()
  3780. }
  3781. return nil, &googleapi.Error{
  3782. Code: res.StatusCode,
  3783. Header: res.Header,
  3784. }
  3785. }
  3786. if err != nil {
  3787. return nil, err
  3788. }
  3789. defer googleapi.CloseBody(res)
  3790. if err := googleapi.CheckResponse(res); err != nil {
  3791. return nil, err
  3792. }
  3793. ret := &ObjectAccessControl{
  3794. ServerResponse: googleapi.ServerResponse{
  3795. Header: res.Header,
  3796. HTTPStatusCode: res.StatusCode,
  3797. },
  3798. }
  3799. target := &ret
  3800. if err := gensupport.DecodeResponse(target, res); err != nil {
  3801. return nil, err
  3802. }
  3803. return ret, nil
  3804. // {
  3805. // "description": "Returns the ACL entry for the specified entity on the specified object.",
  3806. // "httpMethod": "GET",
  3807. // "id": "storage.objectAccessControls.get",
  3808. // "parameterOrder": [
  3809. // "bucket",
  3810. // "object",
  3811. // "entity"
  3812. // ],
  3813. // "parameters": {
  3814. // "bucket": {
  3815. // "description": "Name of a bucket.",
  3816. // "location": "path",
  3817. // "required": true,
  3818. // "type": "string"
  3819. // },
  3820. // "entity": {
  3821. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  3822. // "location": "path",
  3823. // "required": true,
  3824. // "type": "string"
  3825. // },
  3826. // "generation": {
  3827. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  3828. // "format": "uint64",
  3829. // "location": "query",
  3830. // "type": "string"
  3831. // },
  3832. // "object": {
  3833. // "description": "Name of the object.",
  3834. // "location": "path",
  3835. // "required": true,
  3836. // "type": "string"
  3837. // }
  3838. // },
  3839. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  3840. // "response": {
  3841. // "$ref": "ObjectAccessControl"
  3842. // },
  3843. // "scopes": [
  3844. // "https://www.googleapis.com/auth/devstorage.full_control"
  3845. // ]
  3846. // }
  3847. }
  3848. // method id "storage.objectAccessControls.insert":
  3849. type ObjectAccessControlsInsertCall struct {
  3850. s *Service
  3851. bucket string
  3852. object string
  3853. objectaccesscontrol *ObjectAccessControl
  3854. urlParams_ gensupport.URLParams
  3855. ctx_ context.Context
  3856. header_ http.Header
  3857. }
  3858. // Insert: Creates a new ACL entry on the specified object.
  3859. func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
  3860. c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3861. c.bucket = bucket
  3862. c.object = object
  3863. c.objectaccesscontrol = objectaccesscontrol
  3864. return c
  3865. }
  3866. // Generation sets the optional parameter "generation": If present,
  3867. // selects a specific revision of this object (as opposed to the latest
  3868. // version, the default).
  3869. func (c *ObjectAccessControlsInsertCall) Generation(generation uint64) *ObjectAccessControlsInsertCall {
  3870. c.urlParams_.Set("generation", fmt.Sprint(generation))
  3871. return c
  3872. }
  3873. // Fields allows partial responses to be retrieved. See
  3874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3875. // for more information.
  3876. func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
  3877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3878. return c
  3879. }
  3880. // Context sets the context to be used in this call's Do method. Any
  3881. // pending HTTP request will be aborted if the provided context is
  3882. // canceled.
  3883. func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
  3884. c.ctx_ = ctx
  3885. return c
  3886. }
  3887. // Header returns an http.Header that can be modified by the caller to
  3888. // add HTTP headers to the request.
  3889. func (c *ObjectAccessControlsInsertCall) Header() http.Header {
  3890. if c.header_ == nil {
  3891. c.header_ = make(http.Header)
  3892. }
  3893. return c.header_
  3894. }
  3895. func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
  3896. reqHeaders := make(http.Header)
  3897. for k, v := range c.header_ {
  3898. reqHeaders[k] = v
  3899. }
  3900. reqHeaders.Set("User-Agent", c.s.userAgent())
  3901. var body io.Reader = nil
  3902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  3903. if err != nil {
  3904. return nil, err
  3905. }
  3906. reqHeaders.Set("Content-Type", "application/json")
  3907. c.urlParams_.Set("alt", alt)
  3908. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  3909. urls += "?" + c.urlParams_.Encode()
  3910. req, _ := http.NewRequest("POST", urls, body)
  3911. req.Header = reqHeaders
  3912. googleapi.Expand(req.URL, map[string]string{
  3913. "bucket": c.bucket,
  3914. "object": c.object,
  3915. })
  3916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3917. }
  3918. // Do executes the "storage.objectAccessControls.insert" call.
  3919. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  3920. // non-2xx status code is an error. Response headers are in either
  3921. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  3922. // returned at all) in error.(*googleapi.Error).Header. Use
  3923. // googleapi.IsNotModified to check whether the returned error was
  3924. // because http.StatusNotModified was returned.
  3925. func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  3926. gensupport.SetOptions(c.urlParams_, opts...)
  3927. res, err := c.doRequest("json")
  3928. if res != nil && res.StatusCode == http.StatusNotModified {
  3929. if res.Body != nil {
  3930. res.Body.Close()
  3931. }
  3932. return nil, &googleapi.Error{
  3933. Code: res.StatusCode,
  3934. Header: res.Header,
  3935. }
  3936. }
  3937. if err != nil {
  3938. return nil, err
  3939. }
  3940. defer googleapi.CloseBody(res)
  3941. if err := googleapi.CheckResponse(res); err != nil {
  3942. return nil, err
  3943. }
  3944. ret := &ObjectAccessControl{
  3945. ServerResponse: googleapi.ServerResponse{
  3946. Header: res.Header,
  3947. HTTPStatusCode: res.StatusCode,
  3948. },
  3949. }
  3950. target := &ret
  3951. if err := gensupport.DecodeResponse(target, res); err != nil {
  3952. return nil, err
  3953. }
  3954. return ret, nil
  3955. // {
  3956. // "description": "Creates a new ACL entry on the specified object.",
  3957. // "httpMethod": "POST",
  3958. // "id": "storage.objectAccessControls.insert",
  3959. // "parameterOrder": [
  3960. // "bucket",
  3961. // "object"
  3962. // ],
  3963. // "parameters": {
  3964. // "bucket": {
  3965. // "description": "Name of a bucket.",
  3966. // "location": "path",
  3967. // "required": true,
  3968. // "type": "string"
  3969. // },
  3970. // "generation": {
  3971. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  3972. // "format": "uint64",
  3973. // "location": "query",
  3974. // "type": "string"
  3975. // },
  3976. // "object": {
  3977. // "description": "Name of the object.",
  3978. // "location": "path",
  3979. // "required": true,
  3980. // "type": "string"
  3981. // }
  3982. // },
  3983. // "path": "b/{bucket}/o/{object}/acl",
  3984. // "request": {
  3985. // "$ref": "ObjectAccessControl"
  3986. // },
  3987. // "response": {
  3988. // "$ref": "ObjectAccessControl"
  3989. // },
  3990. // "scopes": [
  3991. // "https://www.googleapis.com/auth/devstorage.full_control"
  3992. // ]
  3993. // }
  3994. }
  3995. // method id "storage.objectAccessControls.list":
  3996. type ObjectAccessControlsListCall struct {
  3997. s *Service
  3998. bucket string
  3999. object string
  4000. urlParams_ gensupport.URLParams
  4001. ifNoneMatch_ string
  4002. ctx_ context.Context
  4003. header_ http.Header
  4004. }
  4005. // List: Retrieves ACL entries on the specified object.
  4006. func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
  4007. c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4008. c.bucket = bucket
  4009. c.object = object
  4010. return c
  4011. }
  4012. // Generation sets the optional parameter "generation": If present,
  4013. // selects a specific revision of this object (as opposed to the latest
  4014. // version, the default).
  4015. func (c *ObjectAccessControlsListCall) Generation(generation uint64) *ObjectAccessControlsListCall {
  4016. c.urlParams_.Set("generation", fmt.Sprint(generation))
  4017. return c
  4018. }
  4019. // Fields allows partial responses to be retrieved. See
  4020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4021. // for more information.
  4022. func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
  4023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4024. return c
  4025. }
  4026. // IfNoneMatch sets the optional parameter which makes the operation
  4027. // fail if the object's ETag matches the given value. This is useful for
  4028. // getting updates only after the object has changed since the last
  4029. // request. Use googleapi.IsNotModified to check whether the response
  4030. // error from Do is the result of In-None-Match.
  4031. func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
  4032. c.ifNoneMatch_ = entityTag
  4033. return c
  4034. }
  4035. // Context sets the context to be used in this call's Do method. Any
  4036. // pending HTTP request will be aborted if the provided context is
  4037. // canceled.
  4038. func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
  4039. c.ctx_ = ctx
  4040. return c
  4041. }
  4042. // Header returns an http.Header that can be modified by the caller to
  4043. // add HTTP headers to the request.
  4044. func (c *ObjectAccessControlsListCall) Header() http.Header {
  4045. if c.header_ == nil {
  4046. c.header_ = make(http.Header)
  4047. }
  4048. return c.header_
  4049. }
  4050. func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
  4051. reqHeaders := make(http.Header)
  4052. for k, v := range c.header_ {
  4053. reqHeaders[k] = v
  4054. }
  4055. reqHeaders.Set("User-Agent", c.s.userAgent())
  4056. if c.ifNoneMatch_ != "" {
  4057. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4058. }
  4059. var body io.Reader = nil
  4060. c.urlParams_.Set("alt", alt)
  4061. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
  4062. urls += "?" + c.urlParams_.Encode()
  4063. req, _ := http.NewRequest("GET", urls, body)
  4064. req.Header = reqHeaders
  4065. googleapi.Expand(req.URL, map[string]string{
  4066. "bucket": c.bucket,
  4067. "object": c.object,
  4068. })
  4069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4070. }
  4071. // Do executes the "storage.objectAccessControls.list" call.
  4072. // Exactly one of *ObjectAccessControls or error will be non-nil. Any
  4073. // non-2xx status code is an error. Response headers are in either
  4074. // *ObjectAccessControls.ServerResponse.Header or (if a response was
  4075. // returned at all) in error.(*googleapi.Error).Header. Use
  4076. // googleapi.IsNotModified to check whether the returned error was
  4077. // because http.StatusNotModified was returned.
  4078. func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
  4079. gensupport.SetOptions(c.urlParams_, opts...)
  4080. res, err := c.doRequest("json")
  4081. if res != nil && res.StatusCode == http.StatusNotModified {
  4082. if res.Body != nil {
  4083. res.Body.Close()
  4084. }
  4085. return nil, &googleapi.Error{
  4086. Code: res.StatusCode,
  4087. Header: res.Header,
  4088. }
  4089. }
  4090. if err != nil {
  4091. return nil, err
  4092. }
  4093. defer googleapi.CloseBody(res)
  4094. if err := googleapi.CheckResponse(res); err != nil {
  4095. return nil, err
  4096. }
  4097. ret := &ObjectAccessControls{
  4098. ServerResponse: googleapi.ServerResponse{
  4099. Header: res.Header,
  4100. HTTPStatusCode: res.StatusCode,
  4101. },
  4102. }
  4103. target := &ret
  4104. if err := gensupport.DecodeResponse(target, res); err != nil {
  4105. return nil, err
  4106. }
  4107. return ret, nil
  4108. // {
  4109. // "description": "Retrieves ACL entries on the specified object.",
  4110. // "httpMethod": "GET",
  4111. // "id": "storage.objectAccessControls.list",
  4112. // "parameterOrder": [
  4113. // "bucket",
  4114. // "object"
  4115. // ],
  4116. // "parameters": {
  4117. // "bucket": {
  4118. // "description": "Name of a bucket.",
  4119. // "location": "path",
  4120. // "required": true,
  4121. // "type": "string"
  4122. // },
  4123. // "generation": {
  4124. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4125. // "format": "uint64",
  4126. // "location": "query",
  4127. // "type": "string"
  4128. // },
  4129. // "object": {
  4130. // "description": "Name of the object.",
  4131. // "location": "path",
  4132. // "required": true,
  4133. // "type": "string"
  4134. // }
  4135. // },
  4136. // "path": "b/{bucket}/o/{object}/acl",
  4137. // "response": {
  4138. // "$ref": "ObjectAccessControls"
  4139. // },
  4140. // "scopes": [
  4141. // "https://www.googleapis.com/auth/devstorage.full_control"
  4142. // ]
  4143. // }
  4144. }
  4145. // method id "storage.objectAccessControls.patch":
  4146. type ObjectAccessControlsPatchCall struct {
  4147. s *Service
  4148. bucket string
  4149. object string
  4150. entity string
  4151. objectaccesscontrol *ObjectAccessControl
  4152. urlParams_ gensupport.URLParams
  4153. ctx_ context.Context
  4154. header_ http.Header
  4155. }
  4156. // Patch: Updates an ACL entry on the specified object. This method
  4157. // supports patch semantics.
  4158. func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
  4159. c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4160. c.bucket = bucket
  4161. c.object = object
  4162. c.entity = entity
  4163. c.objectaccesscontrol = objectaccesscontrol
  4164. return c
  4165. }
  4166. // Generation sets the optional parameter "generation": If present,
  4167. // selects a specific revision of this object (as opposed to the latest
  4168. // version, the default).
  4169. func (c *ObjectAccessControlsPatchCall) Generation(generation uint64) *ObjectAccessControlsPatchCall {
  4170. c.urlParams_.Set("generation", fmt.Sprint(generation))
  4171. return c
  4172. }
  4173. // Fields allows partial responses to be retrieved. See
  4174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4175. // for more information.
  4176. func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
  4177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4178. return c
  4179. }
  4180. // Context sets the context to be used in this call's Do method. Any
  4181. // pending HTTP request will be aborted if the provided context is
  4182. // canceled.
  4183. func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
  4184. c.ctx_ = ctx
  4185. return c
  4186. }
  4187. // Header returns an http.Header that can be modified by the caller to
  4188. // add HTTP headers to the request.
  4189. func (c *ObjectAccessControlsPatchCall) Header() http.Header {
  4190. if c.header_ == nil {
  4191. c.header_ = make(http.Header)
  4192. }
  4193. return c.header_
  4194. }
  4195. func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
  4196. reqHeaders := make(http.Header)
  4197. for k, v := range c.header_ {
  4198. reqHeaders[k] = v
  4199. }
  4200. reqHeaders.Set("User-Agent", c.s.userAgent())
  4201. var body io.Reader = nil
  4202. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  4203. if err != nil {
  4204. return nil, err
  4205. }
  4206. reqHeaders.Set("Content-Type", "application/json")
  4207. c.urlParams_.Set("alt", alt)
  4208. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  4209. urls += "?" + c.urlParams_.Encode()
  4210. req, _ := http.NewRequest("PATCH", urls, body)
  4211. req.Header = reqHeaders
  4212. googleapi.Expand(req.URL, map[string]string{
  4213. "bucket": c.bucket,
  4214. "object": c.object,
  4215. "entity": c.entity,
  4216. })
  4217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4218. }
  4219. // Do executes the "storage.objectAccessControls.patch" call.
  4220. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  4221. // non-2xx status code is an error. Response headers are in either
  4222. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  4223. // returned at all) in error.(*googleapi.Error).Header. Use
  4224. // googleapi.IsNotModified to check whether the returned error was
  4225. // because http.StatusNotModified was returned.
  4226. func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  4227. gensupport.SetOptions(c.urlParams_, opts...)
  4228. res, err := c.doRequest("json")
  4229. if res != nil && res.StatusCode == http.StatusNotModified {
  4230. if res.Body != nil {
  4231. res.Body.Close()
  4232. }
  4233. return nil, &googleapi.Error{
  4234. Code: res.StatusCode,
  4235. Header: res.Header,
  4236. }
  4237. }
  4238. if err != nil {
  4239. return nil, err
  4240. }
  4241. defer googleapi.CloseBody(res)
  4242. if err := googleapi.CheckResponse(res); err != nil {
  4243. return nil, err
  4244. }
  4245. ret := &ObjectAccessControl{
  4246. ServerResponse: googleapi.ServerResponse{
  4247. Header: res.Header,
  4248. HTTPStatusCode: res.StatusCode,
  4249. },
  4250. }
  4251. target := &ret
  4252. if err := gensupport.DecodeResponse(target, res); err != nil {
  4253. return nil, err
  4254. }
  4255. return ret, nil
  4256. // {
  4257. // "description": "Updates an ACL entry on the specified object. This method supports patch semantics.",
  4258. // "httpMethod": "PATCH",
  4259. // "id": "storage.objectAccessControls.patch",
  4260. // "parameterOrder": [
  4261. // "bucket",
  4262. // "object",
  4263. // "entity"
  4264. // ],
  4265. // "parameters": {
  4266. // "bucket": {
  4267. // "description": "Name of a bucket.",
  4268. // "location": "path",
  4269. // "required": true,
  4270. // "type": "string"
  4271. // },
  4272. // "entity": {
  4273. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  4274. // "location": "path",
  4275. // "required": true,
  4276. // "type": "string"
  4277. // },
  4278. // "generation": {
  4279. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4280. // "format": "uint64",
  4281. // "location": "query",
  4282. // "type": "string"
  4283. // },
  4284. // "object": {
  4285. // "description": "Name of the object.",
  4286. // "location": "path",
  4287. // "required": true,
  4288. // "type": "string"
  4289. // }
  4290. // },
  4291. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  4292. // "request": {
  4293. // "$ref": "ObjectAccessControl"
  4294. // },
  4295. // "response": {
  4296. // "$ref": "ObjectAccessControl"
  4297. // },
  4298. // "scopes": [
  4299. // "https://www.googleapis.com/auth/devstorage.full_control"
  4300. // ]
  4301. // }
  4302. }
  4303. // method id "storage.objectAccessControls.update":
  4304. type ObjectAccessControlsUpdateCall struct {
  4305. s *Service
  4306. bucket string
  4307. object string
  4308. entity string
  4309. objectaccesscontrol *ObjectAccessControl
  4310. urlParams_ gensupport.URLParams
  4311. ctx_ context.Context
  4312. header_ http.Header
  4313. }
  4314. // Update: Updates an ACL entry on the specified object.
  4315. func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
  4316. c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4317. c.bucket = bucket
  4318. c.object = object
  4319. c.entity = entity
  4320. c.objectaccesscontrol = objectaccesscontrol
  4321. return c
  4322. }
  4323. // Generation sets the optional parameter "generation": If present,
  4324. // selects a specific revision of this object (as opposed to the latest
  4325. // version, the default).
  4326. func (c *ObjectAccessControlsUpdateCall) Generation(generation uint64) *ObjectAccessControlsUpdateCall {
  4327. c.urlParams_.Set("generation", fmt.Sprint(generation))
  4328. return c
  4329. }
  4330. // Fields allows partial responses to be retrieved. See
  4331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4332. // for more information.
  4333. func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
  4334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4335. return c
  4336. }
  4337. // Context sets the context to be used in this call's Do method. Any
  4338. // pending HTTP request will be aborted if the provided context is
  4339. // canceled.
  4340. func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
  4341. c.ctx_ = ctx
  4342. return c
  4343. }
  4344. // Header returns an http.Header that can be modified by the caller to
  4345. // add HTTP headers to the request.
  4346. func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
  4347. if c.header_ == nil {
  4348. c.header_ = make(http.Header)
  4349. }
  4350. return c.header_
  4351. }
  4352. func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4353. reqHeaders := make(http.Header)
  4354. for k, v := range c.header_ {
  4355. reqHeaders[k] = v
  4356. }
  4357. reqHeaders.Set("User-Agent", c.s.userAgent())
  4358. var body io.Reader = nil
  4359. body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
  4360. if err != nil {
  4361. return nil, err
  4362. }
  4363. reqHeaders.Set("Content-Type", "application/json")
  4364. c.urlParams_.Set("alt", alt)
  4365. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
  4366. urls += "?" + c.urlParams_.Encode()
  4367. req, _ := http.NewRequest("PUT", urls, body)
  4368. req.Header = reqHeaders
  4369. googleapi.Expand(req.URL, map[string]string{
  4370. "bucket": c.bucket,
  4371. "object": c.object,
  4372. "entity": c.entity,
  4373. })
  4374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4375. }
  4376. // Do executes the "storage.objectAccessControls.update" call.
  4377. // Exactly one of *ObjectAccessControl or error will be non-nil. Any
  4378. // non-2xx status code is an error. Response headers are in either
  4379. // *ObjectAccessControl.ServerResponse.Header or (if a response was
  4380. // returned at all) in error.(*googleapi.Error).Header. Use
  4381. // googleapi.IsNotModified to check whether the returned error was
  4382. // because http.StatusNotModified was returned.
  4383. func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
  4384. gensupport.SetOptions(c.urlParams_, opts...)
  4385. res, err := c.doRequest("json")
  4386. if res != nil && res.StatusCode == http.StatusNotModified {
  4387. if res.Body != nil {
  4388. res.Body.Close()
  4389. }
  4390. return nil, &googleapi.Error{
  4391. Code: res.StatusCode,
  4392. Header: res.Header,
  4393. }
  4394. }
  4395. if err != nil {
  4396. return nil, err
  4397. }
  4398. defer googleapi.CloseBody(res)
  4399. if err := googleapi.CheckResponse(res); err != nil {
  4400. return nil, err
  4401. }
  4402. ret := &ObjectAccessControl{
  4403. ServerResponse: googleapi.ServerResponse{
  4404. Header: res.Header,
  4405. HTTPStatusCode: res.StatusCode,
  4406. },
  4407. }
  4408. target := &ret
  4409. if err := gensupport.DecodeResponse(target, res); err != nil {
  4410. return nil, err
  4411. }
  4412. return ret, nil
  4413. // {
  4414. // "description": "Updates an ACL entry on the specified object.",
  4415. // "httpMethod": "PUT",
  4416. // "id": "storage.objectAccessControls.update",
  4417. // "parameterOrder": [
  4418. // "bucket",
  4419. // "object",
  4420. // "entity"
  4421. // ],
  4422. // "parameters": {
  4423. // "bucket": {
  4424. // "description": "Name of a bucket.",
  4425. // "location": "path",
  4426. // "required": true,
  4427. // "type": "string"
  4428. // },
  4429. // "entity": {
  4430. // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
  4431. // "location": "path",
  4432. // "required": true,
  4433. // "type": "string"
  4434. // },
  4435. // "generation": {
  4436. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  4437. // "format": "uint64",
  4438. // "location": "query",
  4439. // "type": "string"
  4440. // },
  4441. // "object": {
  4442. // "description": "Name of the object.",
  4443. // "location": "path",
  4444. // "required": true,
  4445. // "type": "string"
  4446. // }
  4447. // },
  4448. // "path": "b/{bucket}/o/{object}/acl/{entity}",
  4449. // "request": {
  4450. // "$ref": "ObjectAccessControl"
  4451. // },
  4452. // "response": {
  4453. // "$ref": "ObjectAccessControl"
  4454. // },
  4455. // "scopes": [
  4456. // "https://www.googleapis.com/auth/devstorage.full_control"
  4457. // ]
  4458. // }
  4459. }
  4460. // method id "storage.objects.compose":
  4461. type ObjectsComposeCall struct {
  4462. s *Service
  4463. destinationBucket string
  4464. destinationObject string
  4465. composerequest *ComposeRequest
  4466. urlParams_ gensupport.URLParams
  4467. ctx_ context.Context
  4468. header_ http.Header
  4469. }
  4470. // Compose: Concatenates a list of existing objects into a new object in
  4471. // the same bucket.
  4472. func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
  4473. c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4474. c.destinationBucket = destinationBucket
  4475. c.destinationObject = destinationObject
  4476. c.composerequest = composerequest
  4477. return c
  4478. }
  4479. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  4480. // Makes the operation conditional on whether the object's current
  4481. // generation matches the given value.
  4482. func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsComposeCall {
  4483. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  4484. return c
  4485. }
  4486. // IfMetagenerationMatch sets the optional parameter
  4487. // "ifMetagenerationMatch": Makes the operation conditional on whether
  4488. // the object's current metageneration matches the given value.
  4489. func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsComposeCall {
  4490. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  4491. return c
  4492. }
  4493. // Fields allows partial responses to be retrieved. See
  4494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4495. // for more information.
  4496. func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
  4497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4498. return c
  4499. }
  4500. // Context sets the context to be used in this call's Do and Download
  4501. // methods. Any pending HTTP request will be aborted if the provided
  4502. // context is canceled.
  4503. func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
  4504. c.ctx_ = ctx
  4505. return c
  4506. }
  4507. // Header returns an http.Header that can be modified by the caller to
  4508. // add HTTP headers to the request.
  4509. func (c *ObjectsComposeCall) Header() http.Header {
  4510. if c.header_ == nil {
  4511. c.header_ = make(http.Header)
  4512. }
  4513. return c.header_
  4514. }
  4515. func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
  4516. reqHeaders := make(http.Header)
  4517. for k, v := range c.header_ {
  4518. reqHeaders[k] = v
  4519. }
  4520. reqHeaders.Set("User-Agent", c.s.userAgent())
  4521. var body io.Reader = nil
  4522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
  4523. if err != nil {
  4524. return nil, err
  4525. }
  4526. reqHeaders.Set("Content-Type", "application/json")
  4527. c.urlParams_.Set("alt", alt)
  4528. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
  4529. urls += "?" + c.urlParams_.Encode()
  4530. req, _ := http.NewRequest("POST", urls, body)
  4531. req.Header = reqHeaders
  4532. googleapi.Expand(req.URL, map[string]string{
  4533. "destinationBucket": c.destinationBucket,
  4534. "destinationObject": c.destinationObject,
  4535. })
  4536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4537. }
  4538. // Download fetches the API endpoint's "media" value, instead of the normal
  4539. // API response value. If the returned error is nil, the Response is guaranteed to
  4540. // have a 2xx status code. Callers must close the Response.Body as usual.
  4541. func (c *ObjectsComposeCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  4542. gensupport.SetOptions(c.urlParams_, opts...)
  4543. res, err := c.doRequest("media")
  4544. if err != nil {
  4545. return nil, err
  4546. }
  4547. if err := googleapi.CheckMediaResponse(res); err != nil {
  4548. res.Body.Close()
  4549. return nil, err
  4550. }
  4551. return res, nil
  4552. }
  4553. // Do executes the "storage.objects.compose" call.
  4554. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  4555. // code is an error. Response headers are in either
  4556. // *Object.ServerResponse.Header or (if a response was returned at all)
  4557. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4558. // check whether the returned error was because http.StatusNotModified
  4559. // was returned.
  4560. func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  4561. gensupport.SetOptions(c.urlParams_, opts...)
  4562. res, err := c.doRequest("json")
  4563. if res != nil && res.StatusCode == http.StatusNotModified {
  4564. if res.Body != nil {
  4565. res.Body.Close()
  4566. }
  4567. return nil, &googleapi.Error{
  4568. Code: res.StatusCode,
  4569. Header: res.Header,
  4570. }
  4571. }
  4572. if err != nil {
  4573. return nil, err
  4574. }
  4575. defer googleapi.CloseBody(res)
  4576. if err := googleapi.CheckResponse(res); err != nil {
  4577. return nil, err
  4578. }
  4579. ret := &Object{
  4580. ServerResponse: googleapi.ServerResponse{
  4581. Header: res.Header,
  4582. HTTPStatusCode: res.StatusCode,
  4583. },
  4584. }
  4585. target := &ret
  4586. if err := gensupport.DecodeResponse(target, res); err != nil {
  4587. return nil, err
  4588. }
  4589. return ret, nil
  4590. // {
  4591. // "description": "Concatenates a list of existing objects into a new object in the same bucket.",
  4592. // "httpMethod": "POST",
  4593. // "id": "storage.objects.compose",
  4594. // "parameterOrder": [
  4595. // "destinationBucket",
  4596. // "destinationObject"
  4597. // ],
  4598. // "parameters": {
  4599. // "destinationBucket": {
  4600. // "description": "Name of the bucket in which to store the new object.",
  4601. // "location": "path",
  4602. // "required": true,
  4603. // "type": "string"
  4604. // },
  4605. // "destinationObject": {
  4606. // "description": "Name of the new object.",
  4607. // "location": "path",
  4608. // "required": true,
  4609. // "type": "string"
  4610. // },
  4611. // "ifGenerationMatch": {
  4612. // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  4613. // "format": "uint64",
  4614. // "location": "query",
  4615. // "type": "string"
  4616. // },
  4617. // "ifMetagenerationMatch": {
  4618. // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  4619. // "format": "uint64",
  4620. // "location": "query",
  4621. // "type": "string"
  4622. // }
  4623. // },
  4624. // "path": "b/{destinationBucket}/o/{destinationObject}/compose",
  4625. // "request": {
  4626. // "$ref": "ComposeRequest"
  4627. // },
  4628. // "response": {
  4629. // "$ref": "Object"
  4630. // },
  4631. // "scopes": [
  4632. // "https://www.googleapis.com/auth/devstorage.full_control",
  4633. // "https://www.googleapis.com/auth/devstorage.read_write"
  4634. // ],
  4635. // "supportsMediaDownload": true
  4636. // }
  4637. }
  4638. // method id "storage.objects.copy":
  4639. type ObjectsCopyCall struct {
  4640. s *Service
  4641. sourceBucket string
  4642. sourceObject string
  4643. destinationBucket string
  4644. destinationObject string
  4645. object *Object
  4646. urlParams_ gensupport.URLParams
  4647. ctx_ context.Context
  4648. header_ http.Header
  4649. }
  4650. // Copy: Copies an object to a destination in the same location.
  4651. // Optionally overrides metadata.
  4652. func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
  4653. c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4654. c.sourceBucket = sourceBucket
  4655. c.sourceObject = sourceObject
  4656. c.destinationBucket = destinationBucket
  4657. c.destinationObject = destinationObject
  4658. c.object = object
  4659. return c
  4660. }
  4661. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  4662. // Makes the operation conditional on whether the destination object's
  4663. // current generation matches the given value.
  4664. func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsCopyCall {
  4665. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  4666. return c
  4667. }
  4668. // IfGenerationNotMatch sets the optional parameter
  4669. // "ifGenerationNotMatch": Makes the operation conditional on whether
  4670. // the destination object's current generation does not match the given
  4671. // value.
  4672. func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsCopyCall {
  4673. c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  4674. return c
  4675. }
  4676. // IfMetagenerationMatch sets the optional parameter
  4677. // "ifMetagenerationMatch": Makes the operation conditional on whether
  4678. // the destination object's current metageneration matches the given
  4679. // value.
  4680. func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsCopyCall {
  4681. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  4682. return c
  4683. }
  4684. // IfMetagenerationNotMatch sets the optional parameter
  4685. // "ifMetagenerationNotMatch": Makes the operation conditional on
  4686. // whether the destination object's current metageneration does not
  4687. // match the given value.
  4688. func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsCopyCall {
  4689. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  4690. return c
  4691. }
  4692. // IfSourceGenerationMatch sets the optional parameter
  4693. // "ifSourceGenerationMatch": Makes the operation conditional on whether
  4694. // the source object's generation matches the given value.
  4695. func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch uint64) *ObjectsCopyCall {
  4696. c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
  4697. return c
  4698. }
  4699. // IfSourceGenerationNotMatch sets the optional parameter
  4700. // "ifSourceGenerationNotMatch": Makes the operation conditional on
  4701. // whether the source object's generation does not match the given
  4702. // value.
  4703. func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch uint64) *ObjectsCopyCall {
  4704. c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
  4705. return c
  4706. }
  4707. // IfSourceMetagenerationMatch sets the optional parameter
  4708. // "ifSourceMetagenerationMatch": Makes the operation conditional on
  4709. // whether the source object's current metageneration matches the given
  4710. // value.
  4711. func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch uint64) *ObjectsCopyCall {
  4712. c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
  4713. return c
  4714. }
  4715. // IfSourceMetagenerationNotMatch sets the optional parameter
  4716. // "ifSourceMetagenerationNotMatch": Makes the operation conditional on
  4717. // whether the source object's current metageneration does not match the
  4718. // given value.
  4719. func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch uint64) *ObjectsCopyCall {
  4720. c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
  4721. return c
  4722. }
  4723. // Projection sets the optional parameter "projection": Set of
  4724. // properties to return. Defaults to noAcl, unless the object resource
  4725. // specifies the acl property, when it defaults to full.
  4726. //
  4727. // Possible values:
  4728. // "full" - Include all properties.
  4729. // "noAcl" - Omit the acl property.
  4730. func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
  4731. c.urlParams_.Set("projection", projection)
  4732. return c
  4733. }
  4734. // SourceGeneration sets the optional parameter "sourceGeneration": If
  4735. // present, selects a specific revision of the source object (as opposed
  4736. // to the latest version, the default).
  4737. func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration uint64) *ObjectsCopyCall {
  4738. c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
  4739. return c
  4740. }
  4741. // Fields allows partial responses to be retrieved. See
  4742. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4743. // for more information.
  4744. func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
  4745. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4746. return c
  4747. }
  4748. // Context sets the context to be used in this call's Do and Download
  4749. // methods. Any pending HTTP request will be aborted if the provided
  4750. // context is canceled.
  4751. func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
  4752. c.ctx_ = ctx
  4753. return c
  4754. }
  4755. // Header returns an http.Header that can be modified by the caller to
  4756. // add HTTP headers to the request.
  4757. func (c *ObjectsCopyCall) Header() http.Header {
  4758. if c.header_ == nil {
  4759. c.header_ = make(http.Header)
  4760. }
  4761. return c.header_
  4762. }
  4763. func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
  4764. reqHeaders := make(http.Header)
  4765. for k, v := range c.header_ {
  4766. reqHeaders[k] = v
  4767. }
  4768. reqHeaders.Set("User-Agent", c.s.userAgent())
  4769. var body io.Reader = nil
  4770. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
  4771. if err != nil {
  4772. return nil, err
  4773. }
  4774. reqHeaders.Set("Content-Type", "application/json")
  4775. c.urlParams_.Set("alt", alt)
  4776. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
  4777. urls += "?" + c.urlParams_.Encode()
  4778. req, _ := http.NewRequest("POST", urls, body)
  4779. req.Header = reqHeaders
  4780. googleapi.Expand(req.URL, map[string]string{
  4781. "sourceBucket": c.sourceBucket,
  4782. "sourceObject": c.sourceObject,
  4783. "destinationBucket": c.destinationBucket,
  4784. "destinationObject": c.destinationObject,
  4785. })
  4786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4787. }
  4788. // Download fetches the API endpoint's "media" value, instead of the normal
  4789. // API response value. If the returned error is nil, the Response is guaranteed to
  4790. // have a 2xx status code. Callers must close the Response.Body as usual.
  4791. func (c *ObjectsCopyCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  4792. gensupport.SetOptions(c.urlParams_, opts...)
  4793. res, err := c.doRequest("media")
  4794. if err != nil {
  4795. return nil, err
  4796. }
  4797. if err := googleapi.CheckMediaResponse(res); err != nil {
  4798. res.Body.Close()
  4799. return nil, err
  4800. }
  4801. return res, nil
  4802. }
  4803. // Do executes the "storage.objects.copy" call.
  4804. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  4805. // code is an error. Response headers are in either
  4806. // *Object.ServerResponse.Header or (if a response was returned at all)
  4807. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4808. // check whether the returned error was because http.StatusNotModified
  4809. // was returned.
  4810. func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  4811. gensupport.SetOptions(c.urlParams_, opts...)
  4812. res, err := c.doRequest("json")
  4813. if res != nil && res.StatusCode == http.StatusNotModified {
  4814. if res.Body != nil {
  4815. res.Body.Close()
  4816. }
  4817. return nil, &googleapi.Error{
  4818. Code: res.StatusCode,
  4819. Header: res.Header,
  4820. }
  4821. }
  4822. if err != nil {
  4823. return nil, err
  4824. }
  4825. defer googleapi.CloseBody(res)
  4826. if err := googleapi.CheckResponse(res); err != nil {
  4827. return nil, err
  4828. }
  4829. ret := &Object{
  4830. ServerResponse: googleapi.ServerResponse{
  4831. Header: res.Header,
  4832. HTTPStatusCode: res.StatusCode,
  4833. },
  4834. }
  4835. target := &ret
  4836. if err := gensupport.DecodeResponse(target, res); err != nil {
  4837. return nil, err
  4838. }
  4839. return ret, nil
  4840. // {
  4841. // "description": "Copies an object to a destination in the same location. Optionally overrides metadata.",
  4842. // "httpMethod": "POST",
  4843. // "id": "storage.objects.copy",
  4844. // "parameterOrder": [
  4845. // "sourceBucket",
  4846. // "sourceObject",
  4847. // "destinationBucket",
  4848. // "destinationObject"
  4849. // ],
  4850. // "parameters": {
  4851. // "destinationBucket": {
  4852. // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
  4853. // "location": "path",
  4854. // "required": true,
  4855. // "type": "string"
  4856. // },
  4857. // "destinationObject": {
  4858. // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
  4859. // "location": "path",
  4860. // "required": true,
  4861. // "type": "string"
  4862. // },
  4863. // "ifGenerationMatch": {
  4864. // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value.",
  4865. // "format": "uint64",
  4866. // "location": "query",
  4867. // "type": "string"
  4868. // },
  4869. // "ifGenerationNotMatch": {
  4870. // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value.",
  4871. // "format": "uint64",
  4872. // "location": "query",
  4873. // "type": "string"
  4874. // },
  4875. // "ifMetagenerationMatch": {
  4876. // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
  4877. // "format": "uint64",
  4878. // "location": "query",
  4879. // "type": "string"
  4880. // },
  4881. // "ifMetagenerationNotMatch": {
  4882. // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
  4883. // "format": "uint64",
  4884. // "location": "query",
  4885. // "type": "string"
  4886. // },
  4887. // "ifSourceGenerationMatch": {
  4888. // "description": "Makes the operation conditional on whether the source object's generation matches the given value.",
  4889. // "format": "uint64",
  4890. // "location": "query",
  4891. // "type": "string"
  4892. // },
  4893. // "ifSourceGenerationNotMatch": {
  4894. // "description": "Makes the operation conditional on whether the source object's generation does not match the given value.",
  4895. // "format": "uint64",
  4896. // "location": "query",
  4897. // "type": "string"
  4898. // },
  4899. // "ifSourceMetagenerationMatch": {
  4900. // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
  4901. // "format": "uint64",
  4902. // "location": "query",
  4903. // "type": "string"
  4904. // },
  4905. // "ifSourceMetagenerationNotMatch": {
  4906. // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
  4907. // "format": "uint64",
  4908. // "location": "query",
  4909. // "type": "string"
  4910. // },
  4911. // "projection": {
  4912. // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
  4913. // "enum": [
  4914. // "full",
  4915. // "noAcl"
  4916. // ],
  4917. // "enumDescriptions": [
  4918. // "Include all properties.",
  4919. // "Omit the acl property."
  4920. // ],
  4921. // "location": "query",
  4922. // "type": "string"
  4923. // },
  4924. // "sourceBucket": {
  4925. // "description": "Name of the bucket in which to find the source object.",
  4926. // "location": "path",
  4927. // "required": true,
  4928. // "type": "string"
  4929. // },
  4930. // "sourceGeneration": {
  4931. // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
  4932. // "format": "uint64",
  4933. // "location": "query",
  4934. // "type": "string"
  4935. // },
  4936. // "sourceObject": {
  4937. // "description": "Name of the source object.",
  4938. // "location": "path",
  4939. // "required": true,
  4940. // "type": "string"
  4941. // }
  4942. // },
  4943. // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
  4944. // "request": {
  4945. // "$ref": "Object"
  4946. // },
  4947. // "response": {
  4948. // "$ref": "Object"
  4949. // },
  4950. // "scopes": [
  4951. // "https://www.googleapis.com/auth/devstorage.full_control",
  4952. // "https://www.googleapis.com/auth/devstorage.read_write"
  4953. // ],
  4954. // "supportsMediaDownload": true
  4955. // }
  4956. }
  4957. // method id "storage.objects.delete":
  4958. type ObjectsDeleteCall struct {
  4959. s *Service
  4960. bucket string
  4961. object string
  4962. urlParams_ gensupport.URLParams
  4963. ctx_ context.Context
  4964. header_ http.Header
  4965. }
  4966. // Delete: Deletes data blobs and associated metadata. Deletions are
  4967. // permanent if versioning is not enabled for the bucket, or if the
  4968. // generation parameter is used.
  4969. func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
  4970. c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4971. c.bucket = bucket
  4972. c.object = object
  4973. return c
  4974. }
  4975. // Generation sets the optional parameter "generation": If present,
  4976. // permanently deletes a specific revision of this object (as opposed to
  4977. // the latest version, the default).
  4978. func (c *ObjectsDeleteCall) Generation(generation uint64) *ObjectsDeleteCall {
  4979. c.urlParams_.Set("generation", fmt.Sprint(generation))
  4980. return c
  4981. }
  4982. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  4983. // Makes the operation conditional on whether the object's current
  4984. // generation matches the given value.
  4985. func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsDeleteCall {
  4986. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  4987. return c
  4988. }
  4989. // IfGenerationNotMatch sets the optional parameter
  4990. // "ifGenerationNotMatch": Makes the operation conditional on whether
  4991. // the object's current generation does not match the given value.
  4992. func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsDeleteCall {
  4993. c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  4994. return c
  4995. }
  4996. // IfMetagenerationMatch sets the optional parameter
  4997. // "ifMetagenerationMatch": Makes the operation conditional on whether
  4998. // the object's current metageneration matches the given value.
  4999. func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsDeleteCall {
  5000. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5001. return c
  5002. }
  5003. // IfMetagenerationNotMatch sets the optional parameter
  5004. // "ifMetagenerationNotMatch": Makes the operation conditional on
  5005. // whether the object's current metageneration does not match the given
  5006. // value.
  5007. func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsDeleteCall {
  5008. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5009. return c
  5010. }
  5011. // Fields allows partial responses to be retrieved. See
  5012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5013. // for more information.
  5014. func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
  5015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5016. return c
  5017. }
  5018. // Context sets the context to be used in this call's Do method. Any
  5019. // pending HTTP request will be aborted if the provided context is
  5020. // canceled.
  5021. func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
  5022. c.ctx_ = ctx
  5023. return c
  5024. }
  5025. // Header returns an http.Header that can be modified by the caller to
  5026. // add HTTP headers to the request.
  5027. func (c *ObjectsDeleteCall) Header() http.Header {
  5028. if c.header_ == nil {
  5029. c.header_ = make(http.Header)
  5030. }
  5031. return c.header_
  5032. }
  5033. func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5034. reqHeaders := make(http.Header)
  5035. for k, v := range c.header_ {
  5036. reqHeaders[k] = v
  5037. }
  5038. reqHeaders.Set("User-Agent", c.s.userAgent())
  5039. var body io.Reader = nil
  5040. c.urlParams_.Set("alt", alt)
  5041. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  5042. urls += "?" + c.urlParams_.Encode()
  5043. req, _ := http.NewRequest("DELETE", urls, body)
  5044. req.Header = reqHeaders
  5045. googleapi.Expand(req.URL, map[string]string{
  5046. "bucket": c.bucket,
  5047. "object": c.object,
  5048. })
  5049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5050. }
  5051. // Do executes the "storage.objects.delete" call.
  5052. func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5053. gensupport.SetOptions(c.urlParams_, opts...)
  5054. res, err := c.doRequest("json")
  5055. if err != nil {
  5056. return err
  5057. }
  5058. defer googleapi.CloseBody(res)
  5059. if err := googleapi.CheckResponse(res); err != nil {
  5060. return err
  5061. }
  5062. return nil
  5063. // {
  5064. // "description": "Deletes data blobs and associated metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
  5065. // "httpMethod": "DELETE",
  5066. // "id": "storage.objects.delete",
  5067. // "parameterOrder": [
  5068. // "bucket",
  5069. // "object"
  5070. // ],
  5071. // "parameters": {
  5072. // "bucket": {
  5073. // "description": "Name of the bucket in which the object resides.",
  5074. // "location": "path",
  5075. // "required": true,
  5076. // "type": "string"
  5077. // },
  5078. // "generation": {
  5079. // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
  5080. // "format": "uint64",
  5081. // "location": "query",
  5082. // "type": "string"
  5083. // },
  5084. // "ifGenerationMatch": {
  5085. // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  5086. // "format": "uint64",
  5087. // "location": "query",
  5088. // "type": "string"
  5089. // },
  5090. // "ifGenerationNotMatch": {
  5091. // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  5092. // "format": "uint64",
  5093. // "location": "query",
  5094. // "type": "string"
  5095. // },
  5096. // "ifMetagenerationMatch": {
  5097. // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  5098. // "format": "uint64",
  5099. // "location": "query",
  5100. // "type": "string"
  5101. // },
  5102. // "ifMetagenerationNotMatch": {
  5103. // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  5104. // "format": "uint64",
  5105. // "location": "query",
  5106. // "type": "string"
  5107. // },
  5108. // "object": {
  5109. // "description": "Name of the object.",
  5110. // "location": "path",
  5111. // "required": true,
  5112. // "type": "string"
  5113. // }
  5114. // },
  5115. // "path": "b/{bucket}/o/{object}",
  5116. // "scopes": [
  5117. // "https://www.googleapis.com/auth/devstorage.full_control",
  5118. // "https://www.googleapis.com/auth/devstorage.read_write"
  5119. // ]
  5120. // }
  5121. }
  5122. // method id "storage.objects.get":
  5123. type ObjectsGetCall struct {
  5124. s *Service
  5125. bucket string
  5126. object string
  5127. urlParams_ gensupport.URLParams
  5128. ifNoneMatch_ string
  5129. ctx_ context.Context
  5130. header_ http.Header
  5131. }
  5132. // Get: Retrieves objects or their associated metadata.
  5133. func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
  5134. c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5135. c.bucket = bucket
  5136. c.object = object
  5137. return c
  5138. }
  5139. // Generation sets the optional parameter "generation": If present,
  5140. // selects a specific revision of this object (as opposed to the latest
  5141. // version, the default).
  5142. func (c *ObjectsGetCall) Generation(generation uint64) *ObjectsGetCall {
  5143. c.urlParams_.Set("generation", fmt.Sprint(generation))
  5144. return c
  5145. }
  5146. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5147. // Makes the operation conditional on whether the object's generation
  5148. // matches the given value.
  5149. func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsGetCall {
  5150. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5151. return c
  5152. }
  5153. // IfGenerationNotMatch sets the optional parameter
  5154. // "ifGenerationNotMatch": Makes the operation conditional on whether
  5155. // the object's generation does not match the given value.
  5156. func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsGetCall {
  5157. c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  5158. return c
  5159. }
  5160. // IfMetagenerationMatch sets the optional parameter
  5161. // "ifMetagenerationMatch": Makes the operation conditional on whether
  5162. // the object's current metageneration matches the given value.
  5163. func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsGetCall {
  5164. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5165. return c
  5166. }
  5167. // IfMetagenerationNotMatch sets the optional parameter
  5168. // "ifMetagenerationNotMatch": Makes the operation conditional on
  5169. // whether the object's current metageneration does not match the given
  5170. // value.
  5171. func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsGetCall {
  5172. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5173. return c
  5174. }
  5175. // Projection sets the optional parameter "projection": Set of
  5176. // properties to return. Defaults to noAcl.
  5177. //
  5178. // Possible values:
  5179. // "full" - Include all properties.
  5180. // "noAcl" - Omit the acl property.
  5181. func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
  5182. c.urlParams_.Set("projection", projection)
  5183. return c
  5184. }
  5185. // Fields allows partial responses to be retrieved. See
  5186. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5187. // for more information.
  5188. func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
  5189. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5190. return c
  5191. }
  5192. // IfNoneMatch sets the optional parameter which makes the operation
  5193. // fail if the object's ETag matches the given value. This is useful for
  5194. // getting updates only after the object has changed since the last
  5195. // request. Use googleapi.IsNotModified to check whether the response
  5196. // error from Do is the result of In-None-Match.
  5197. func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
  5198. c.ifNoneMatch_ = entityTag
  5199. return c
  5200. }
  5201. // Context sets the context to be used in this call's Do and Download
  5202. // methods. Any pending HTTP request will be aborted if the provided
  5203. // context is canceled.
  5204. func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
  5205. c.ctx_ = ctx
  5206. return c
  5207. }
  5208. // Header returns an http.Header that can be modified by the caller to
  5209. // add HTTP headers to the request.
  5210. func (c *ObjectsGetCall) Header() http.Header {
  5211. if c.header_ == nil {
  5212. c.header_ = make(http.Header)
  5213. }
  5214. return c.header_
  5215. }
  5216. func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
  5217. reqHeaders := make(http.Header)
  5218. for k, v := range c.header_ {
  5219. reqHeaders[k] = v
  5220. }
  5221. reqHeaders.Set("User-Agent", c.s.userAgent())
  5222. if c.ifNoneMatch_ != "" {
  5223. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5224. }
  5225. var body io.Reader = nil
  5226. c.urlParams_.Set("alt", alt)
  5227. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  5228. urls += "?" + c.urlParams_.Encode()
  5229. req, _ := http.NewRequest("GET", urls, body)
  5230. req.Header = reqHeaders
  5231. googleapi.Expand(req.URL, map[string]string{
  5232. "bucket": c.bucket,
  5233. "object": c.object,
  5234. })
  5235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5236. }
  5237. // Download fetches the API endpoint's "media" value, instead of the normal
  5238. // API response value. If the returned error is nil, the Response is guaranteed to
  5239. // have a 2xx status code. Callers must close the Response.Body as usual.
  5240. func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  5241. gensupport.SetOptions(c.urlParams_, opts...)
  5242. res, err := c.doRequest("media")
  5243. if err != nil {
  5244. return nil, err
  5245. }
  5246. if err := googleapi.CheckMediaResponse(res); err != nil {
  5247. res.Body.Close()
  5248. return nil, err
  5249. }
  5250. return res, nil
  5251. }
  5252. // Do executes the "storage.objects.get" call.
  5253. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  5254. // code is an error. Response headers are in either
  5255. // *Object.ServerResponse.Header or (if a response was returned at all)
  5256. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5257. // check whether the returned error was because http.StatusNotModified
  5258. // was returned.
  5259. func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  5260. gensupport.SetOptions(c.urlParams_, opts...)
  5261. res, err := c.doRequest("json")
  5262. if res != nil && res.StatusCode == http.StatusNotModified {
  5263. if res.Body != nil {
  5264. res.Body.Close()
  5265. }
  5266. return nil, &googleapi.Error{
  5267. Code: res.StatusCode,
  5268. Header: res.Header,
  5269. }
  5270. }
  5271. if err != nil {
  5272. return nil, err
  5273. }
  5274. defer googleapi.CloseBody(res)
  5275. if err := googleapi.CheckResponse(res); err != nil {
  5276. return nil, err
  5277. }
  5278. ret := &Object{
  5279. ServerResponse: googleapi.ServerResponse{
  5280. Header: res.Header,
  5281. HTTPStatusCode: res.StatusCode,
  5282. },
  5283. }
  5284. target := &ret
  5285. if err := gensupport.DecodeResponse(target, res); err != nil {
  5286. return nil, err
  5287. }
  5288. return ret, nil
  5289. // {
  5290. // "description": "Retrieves objects or their associated metadata.",
  5291. // "httpMethod": "GET",
  5292. // "id": "storage.objects.get",
  5293. // "parameterOrder": [
  5294. // "bucket",
  5295. // "object"
  5296. // ],
  5297. // "parameters": {
  5298. // "bucket": {
  5299. // "description": "Name of the bucket in which the object resides.",
  5300. // "location": "path",
  5301. // "required": true,
  5302. // "type": "string"
  5303. // },
  5304. // "generation": {
  5305. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  5306. // "format": "uint64",
  5307. // "location": "query",
  5308. // "type": "string"
  5309. // },
  5310. // "ifGenerationMatch": {
  5311. // "description": "Makes the operation conditional on whether the object's generation matches the given value.",
  5312. // "format": "uint64",
  5313. // "location": "query",
  5314. // "type": "string"
  5315. // },
  5316. // "ifGenerationNotMatch": {
  5317. // "description": "Makes the operation conditional on whether the object's generation does not match the given value.",
  5318. // "format": "uint64",
  5319. // "location": "query",
  5320. // "type": "string"
  5321. // },
  5322. // "ifMetagenerationMatch": {
  5323. // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  5324. // "format": "uint64",
  5325. // "location": "query",
  5326. // "type": "string"
  5327. // },
  5328. // "ifMetagenerationNotMatch": {
  5329. // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  5330. // "format": "uint64",
  5331. // "location": "query",
  5332. // "type": "string"
  5333. // },
  5334. // "object": {
  5335. // "description": "Name of the object.",
  5336. // "location": "path",
  5337. // "required": true,
  5338. // "type": "string"
  5339. // },
  5340. // "projection": {
  5341. // "description": "Set of properties to return. Defaults to noAcl.",
  5342. // "enum": [
  5343. // "full",
  5344. // "noAcl"
  5345. // ],
  5346. // "enumDescriptions": [
  5347. // "Include all properties.",
  5348. // "Omit the acl property."
  5349. // ],
  5350. // "location": "query",
  5351. // "type": "string"
  5352. // }
  5353. // },
  5354. // "path": "b/{bucket}/o/{object}",
  5355. // "response": {
  5356. // "$ref": "Object"
  5357. // },
  5358. // "scopes": [
  5359. // "https://www.googleapis.com/auth/devstorage.full_control",
  5360. // "https://www.googleapis.com/auth/devstorage.read_only",
  5361. // "https://www.googleapis.com/auth/devstorage.read_write"
  5362. // ],
  5363. // "supportsMediaDownload": true
  5364. // }
  5365. }
  5366. // method id "storage.objects.insert":
  5367. type ObjectsInsertCall struct {
  5368. s *Service
  5369. bucket string
  5370. object *Object
  5371. urlParams_ gensupport.URLParams
  5372. mediaInfo_ *gensupport.MediaInfo
  5373. ctx_ context.Context
  5374. header_ http.Header
  5375. }
  5376. // Insert: Stores new data blobs and associated metadata.
  5377. func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
  5378. c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5379. c.bucket = bucket
  5380. c.object = object
  5381. return c
  5382. }
  5383. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5384. // Makes the operation conditional on whether the object's current
  5385. // generation matches the given value.
  5386. func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsInsertCall {
  5387. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5388. return c
  5389. }
  5390. // IfGenerationNotMatch sets the optional parameter
  5391. // "ifGenerationNotMatch": Makes the operation conditional on whether
  5392. // the object's current generation does not match the given value.
  5393. func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsInsertCall {
  5394. c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  5395. return c
  5396. }
  5397. // IfMetagenerationMatch sets the optional parameter
  5398. // "ifMetagenerationMatch": Makes the operation conditional on whether
  5399. // the object's current metageneration matches the given value.
  5400. func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsInsertCall {
  5401. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5402. return c
  5403. }
  5404. // IfMetagenerationNotMatch sets the optional parameter
  5405. // "ifMetagenerationNotMatch": Makes the operation conditional on
  5406. // whether the object's current metageneration does not match the given
  5407. // value.
  5408. func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsInsertCall {
  5409. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5410. return c
  5411. }
  5412. // Name sets the optional parameter "name": Name of the object. Required
  5413. // when the object metadata is not otherwise provided. Overrides the
  5414. // object metadata's name value, if any.
  5415. func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
  5416. c.urlParams_.Set("name", name)
  5417. return c
  5418. }
  5419. // Projection sets the optional parameter "projection": Set of
  5420. // properties to return. Defaults to noAcl, unless the object resource
  5421. // specifies the acl property, when it defaults to full.
  5422. //
  5423. // Possible values:
  5424. // "full" - Include all properties.
  5425. // "noAcl" - Omit the acl property.
  5426. func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
  5427. c.urlParams_.Set("projection", projection)
  5428. return c
  5429. }
  5430. // Media specifies the media to upload in one or more chunks. The chunk
  5431. // size may be controlled by supplying a MediaOption generated by
  5432. // googleapi.ChunkSize. The chunk size defaults to
  5433. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  5434. // upload request will be determined by sniffing the contents of r,
  5435. // unless a MediaOption generated by googleapi.ContentType is
  5436. // supplied.
  5437. // At most one of Media and ResumableMedia may be set.
  5438. func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
  5439. if ct := c.object.ContentType; ct != "" {
  5440. options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
  5441. }
  5442. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  5443. return c
  5444. }
  5445. // ResumableMedia specifies the media to upload in chunks and can be
  5446. // canceled with ctx.
  5447. //
  5448. // Deprecated: use Media instead.
  5449. //
  5450. // At most one of Media and ResumableMedia may be set. mediaType
  5451. // identifies the MIME media type of the upload, such as "image/png". If
  5452. // mediaType is "", it will be auto-detected. The provided ctx will
  5453. // supersede any context previously provided to the Context method.
  5454. func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
  5455. c.ctx_ = ctx
  5456. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  5457. return c
  5458. }
  5459. // ProgressUpdater provides a callback function that will be called
  5460. // after every chunk. It should be a low-latency function in order to
  5461. // not slow down the upload operation. This should only be called when
  5462. // using ResumableMedia (as opposed to Media).
  5463. func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
  5464. c.mediaInfo_.SetProgressUpdater(pu)
  5465. return c
  5466. }
  5467. // Fields allows partial responses to be retrieved. See
  5468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5469. // for more information.
  5470. func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
  5471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5472. return c
  5473. }
  5474. // Context sets the context to be used in this call's Do method. Any
  5475. // pending HTTP request will be aborted if the provided context is
  5476. // canceled.
  5477. // This context will supersede any context previously provided to the
  5478. // ResumableMedia method.
  5479. func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
  5480. c.ctx_ = ctx
  5481. return c
  5482. }
  5483. // Header returns an http.Header that can be modified by the caller to
  5484. // add HTTP headers to the request.
  5485. func (c *ObjectsInsertCall) Header() http.Header {
  5486. if c.header_ == nil {
  5487. c.header_ = make(http.Header)
  5488. }
  5489. return c.header_
  5490. }
  5491. func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
  5492. reqHeaders := make(http.Header)
  5493. for k, v := range c.header_ {
  5494. reqHeaders[k] = v
  5495. }
  5496. reqHeaders.Set("User-Agent", c.s.userAgent())
  5497. var body io.Reader = nil
  5498. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
  5499. if err != nil {
  5500. return nil, err
  5501. }
  5502. reqHeaders.Set("Content-Type", "application/json")
  5503. c.urlParams_.Set("alt", alt)
  5504. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
  5505. if c.mediaInfo_ != nil {
  5506. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  5507. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  5508. }
  5509. if body == nil {
  5510. body = new(bytes.Buffer)
  5511. reqHeaders.Set("Content-Type", "application/json")
  5512. }
  5513. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  5514. defer cleanup()
  5515. urls += "?" + c.urlParams_.Encode()
  5516. req, _ := http.NewRequest("POST", urls, body)
  5517. req.Header = reqHeaders
  5518. gensupport.SetGetBody(req, getBody)
  5519. googleapi.Expand(req.URL, map[string]string{
  5520. "bucket": c.bucket,
  5521. })
  5522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5523. }
  5524. // Do executes the "storage.objects.insert" call.
  5525. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  5526. // code is an error. Response headers are in either
  5527. // *Object.ServerResponse.Header or (if a response was returned at all)
  5528. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5529. // check whether the returned error was because http.StatusNotModified
  5530. // was returned.
  5531. func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  5532. gensupport.SetOptions(c.urlParams_, opts...)
  5533. res, err := c.doRequest("json")
  5534. if res != nil && res.StatusCode == http.StatusNotModified {
  5535. if res.Body != nil {
  5536. res.Body.Close()
  5537. }
  5538. return nil, &googleapi.Error{
  5539. Code: res.StatusCode,
  5540. Header: res.Header,
  5541. }
  5542. }
  5543. if err != nil {
  5544. return nil, err
  5545. }
  5546. defer googleapi.CloseBody(res)
  5547. if err := googleapi.CheckResponse(res); err != nil {
  5548. return nil, err
  5549. }
  5550. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  5551. if rx != nil {
  5552. rx.Client = c.s.client
  5553. rx.UserAgent = c.s.userAgent()
  5554. ctx := c.ctx_
  5555. if ctx == nil {
  5556. ctx = context.TODO()
  5557. }
  5558. res, err = rx.Upload(ctx)
  5559. if err != nil {
  5560. return nil, err
  5561. }
  5562. defer res.Body.Close()
  5563. if err := googleapi.CheckResponse(res); err != nil {
  5564. return nil, err
  5565. }
  5566. }
  5567. ret := &Object{
  5568. ServerResponse: googleapi.ServerResponse{
  5569. Header: res.Header,
  5570. HTTPStatusCode: res.StatusCode,
  5571. },
  5572. }
  5573. target := &ret
  5574. if err := gensupport.DecodeResponse(target, res); err != nil {
  5575. return nil, err
  5576. }
  5577. return ret, nil
  5578. // {
  5579. // "description": "Stores new data blobs and associated metadata.",
  5580. // "httpMethod": "POST",
  5581. // "id": "storage.objects.insert",
  5582. // "mediaUpload": {
  5583. // "accept": [
  5584. // "*/*"
  5585. // ],
  5586. // "protocols": {
  5587. // "resumable": {
  5588. // "multipart": true,
  5589. // "path": "/resumable/upload/storage/v1beta2/b/{bucket}/o"
  5590. // },
  5591. // "simple": {
  5592. // "multipart": true,
  5593. // "path": "/upload/storage/v1beta2/b/{bucket}/o"
  5594. // }
  5595. // }
  5596. // },
  5597. // "parameterOrder": [
  5598. // "bucket"
  5599. // ],
  5600. // "parameters": {
  5601. // "bucket": {
  5602. // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
  5603. // "location": "path",
  5604. // "required": true,
  5605. // "type": "string"
  5606. // },
  5607. // "ifGenerationMatch": {
  5608. // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  5609. // "format": "uint64",
  5610. // "location": "query",
  5611. // "type": "string"
  5612. // },
  5613. // "ifGenerationNotMatch": {
  5614. // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  5615. // "format": "uint64",
  5616. // "location": "query",
  5617. // "type": "string"
  5618. // },
  5619. // "ifMetagenerationMatch": {
  5620. // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  5621. // "format": "uint64",
  5622. // "location": "query",
  5623. // "type": "string"
  5624. // },
  5625. // "ifMetagenerationNotMatch": {
  5626. // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  5627. // "format": "uint64",
  5628. // "location": "query",
  5629. // "type": "string"
  5630. // },
  5631. // "name": {
  5632. // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
  5633. // "location": "query",
  5634. // "type": "string"
  5635. // },
  5636. // "projection": {
  5637. // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
  5638. // "enum": [
  5639. // "full",
  5640. // "noAcl"
  5641. // ],
  5642. // "enumDescriptions": [
  5643. // "Include all properties.",
  5644. // "Omit the acl property."
  5645. // ],
  5646. // "location": "query",
  5647. // "type": "string"
  5648. // }
  5649. // },
  5650. // "path": "b/{bucket}/o",
  5651. // "request": {
  5652. // "$ref": "Object"
  5653. // },
  5654. // "response": {
  5655. // "$ref": "Object"
  5656. // },
  5657. // "scopes": [
  5658. // "https://www.googleapis.com/auth/devstorage.full_control",
  5659. // "https://www.googleapis.com/auth/devstorage.read_write"
  5660. // ],
  5661. // "supportsMediaDownload": true,
  5662. // "supportsMediaUpload": true
  5663. // }
  5664. }
  5665. // method id "storage.objects.list":
  5666. type ObjectsListCall struct {
  5667. s *Service
  5668. bucket string
  5669. urlParams_ gensupport.URLParams
  5670. ifNoneMatch_ string
  5671. ctx_ context.Context
  5672. header_ http.Header
  5673. }
  5674. // List: Retrieves a list of objects matching the criteria.
  5675. func (r *ObjectsService) List(bucket string) *ObjectsListCall {
  5676. c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5677. c.bucket = bucket
  5678. return c
  5679. }
  5680. // Delimiter sets the optional parameter "delimiter": Returns results in
  5681. // a directory-like mode. items will contain only objects whose names,
  5682. // aside from the prefix, do not contain delimiter. Objects whose names,
  5683. // aside from the prefix, contain delimiter will have their name,
  5684. // truncated after the delimiter, returned in prefixes. Duplicate
  5685. // prefixes are omitted.
  5686. func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
  5687. c.urlParams_.Set("delimiter", delimiter)
  5688. return c
  5689. }
  5690. // MaxResults sets the optional parameter "maxResults": Maximum number
  5691. // of items plus prefixes to return. As duplicate prefixes are omitted,
  5692. // fewer total results may be returned than requested.
  5693. func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
  5694. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5695. return c
  5696. }
  5697. // PageToken sets the optional parameter "pageToken": A
  5698. // previously-returned page token representing part of the larger set of
  5699. // results to view.
  5700. func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
  5701. c.urlParams_.Set("pageToken", pageToken)
  5702. return c
  5703. }
  5704. // Prefix sets the optional parameter "prefix": Filter results to
  5705. // objects whose names begin with this prefix.
  5706. func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
  5707. c.urlParams_.Set("prefix", prefix)
  5708. return c
  5709. }
  5710. // Projection sets the optional parameter "projection": Set of
  5711. // properties to return. Defaults to noAcl.
  5712. //
  5713. // Possible values:
  5714. // "full" - Include all properties.
  5715. // "noAcl" - Omit the acl property.
  5716. func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
  5717. c.urlParams_.Set("projection", projection)
  5718. return c
  5719. }
  5720. // Versions sets the optional parameter "versions": If true, lists all
  5721. // versions of a file as distinct results.
  5722. func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
  5723. c.urlParams_.Set("versions", fmt.Sprint(versions))
  5724. return c
  5725. }
  5726. // Fields allows partial responses to be retrieved. See
  5727. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5728. // for more information.
  5729. func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
  5730. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5731. return c
  5732. }
  5733. // IfNoneMatch sets the optional parameter which makes the operation
  5734. // fail if the object's ETag matches the given value. This is useful for
  5735. // getting updates only after the object has changed since the last
  5736. // request. Use googleapi.IsNotModified to check whether the response
  5737. // error from Do is the result of In-None-Match.
  5738. func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
  5739. c.ifNoneMatch_ = entityTag
  5740. return c
  5741. }
  5742. // Context sets the context to be used in this call's Do method. Any
  5743. // pending HTTP request will be aborted if the provided context is
  5744. // canceled.
  5745. func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
  5746. c.ctx_ = ctx
  5747. return c
  5748. }
  5749. // Header returns an http.Header that can be modified by the caller to
  5750. // add HTTP headers to the request.
  5751. func (c *ObjectsListCall) Header() http.Header {
  5752. if c.header_ == nil {
  5753. c.header_ = make(http.Header)
  5754. }
  5755. return c.header_
  5756. }
  5757. func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
  5758. reqHeaders := make(http.Header)
  5759. for k, v := range c.header_ {
  5760. reqHeaders[k] = v
  5761. }
  5762. reqHeaders.Set("User-Agent", c.s.userAgent())
  5763. if c.ifNoneMatch_ != "" {
  5764. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5765. }
  5766. var body io.Reader = nil
  5767. c.urlParams_.Set("alt", alt)
  5768. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
  5769. urls += "?" + c.urlParams_.Encode()
  5770. req, _ := http.NewRequest("GET", urls, body)
  5771. req.Header = reqHeaders
  5772. googleapi.Expand(req.URL, map[string]string{
  5773. "bucket": c.bucket,
  5774. })
  5775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5776. }
  5777. // Do executes the "storage.objects.list" call.
  5778. // Exactly one of *Objects or error will be non-nil. Any non-2xx status
  5779. // code is an error. Response headers are in either
  5780. // *Objects.ServerResponse.Header or (if a response was returned at all)
  5781. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5782. // check whether the returned error was because http.StatusNotModified
  5783. // was returned.
  5784. func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
  5785. gensupport.SetOptions(c.urlParams_, opts...)
  5786. res, err := c.doRequest("json")
  5787. if res != nil && res.StatusCode == http.StatusNotModified {
  5788. if res.Body != nil {
  5789. res.Body.Close()
  5790. }
  5791. return nil, &googleapi.Error{
  5792. Code: res.StatusCode,
  5793. Header: res.Header,
  5794. }
  5795. }
  5796. if err != nil {
  5797. return nil, err
  5798. }
  5799. defer googleapi.CloseBody(res)
  5800. if err := googleapi.CheckResponse(res); err != nil {
  5801. return nil, err
  5802. }
  5803. ret := &Objects{
  5804. ServerResponse: googleapi.ServerResponse{
  5805. Header: res.Header,
  5806. HTTPStatusCode: res.StatusCode,
  5807. },
  5808. }
  5809. target := &ret
  5810. if err := gensupport.DecodeResponse(target, res); err != nil {
  5811. return nil, err
  5812. }
  5813. return ret, nil
  5814. // {
  5815. // "description": "Retrieves a list of objects matching the criteria.",
  5816. // "httpMethod": "GET",
  5817. // "id": "storage.objects.list",
  5818. // "parameterOrder": [
  5819. // "bucket"
  5820. // ],
  5821. // "parameters": {
  5822. // "bucket": {
  5823. // "description": "Name of the bucket in which to look for objects.",
  5824. // "location": "path",
  5825. // "required": true,
  5826. // "type": "string"
  5827. // },
  5828. // "delimiter": {
  5829. // "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.",
  5830. // "location": "query",
  5831. // "type": "string"
  5832. // },
  5833. // "maxResults": {
  5834. // "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.",
  5835. // "format": "uint32",
  5836. // "location": "query",
  5837. // "minimum": "0",
  5838. // "type": "integer"
  5839. // },
  5840. // "pageToken": {
  5841. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  5842. // "location": "query",
  5843. // "type": "string"
  5844. // },
  5845. // "prefix": {
  5846. // "description": "Filter results to objects whose names begin with this prefix.",
  5847. // "location": "query",
  5848. // "type": "string"
  5849. // },
  5850. // "projection": {
  5851. // "description": "Set of properties to return. Defaults to noAcl.",
  5852. // "enum": [
  5853. // "full",
  5854. // "noAcl"
  5855. // ],
  5856. // "enumDescriptions": [
  5857. // "Include all properties.",
  5858. // "Omit the acl property."
  5859. // ],
  5860. // "location": "query",
  5861. // "type": "string"
  5862. // },
  5863. // "versions": {
  5864. // "description": "If true, lists all versions of a file as distinct results.",
  5865. // "location": "query",
  5866. // "type": "boolean"
  5867. // }
  5868. // },
  5869. // "path": "b/{bucket}/o",
  5870. // "response": {
  5871. // "$ref": "Objects"
  5872. // },
  5873. // "scopes": [
  5874. // "https://www.googleapis.com/auth/devstorage.full_control",
  5875. // "https://www.googleapis.com/auth/devstorage.read_only",
  5876. // "https://www.googleapis.com/auth/devstorage.read_write"
  5877. // ],
  5878. // "supportsSubscription": true
  5879. // }
  5880. }
  5881. // Pages invokes f for each page of results.
  5882. // A non-nil error returned from f will halt the iteration.
  5883. // The provided context supersedes any context provided to the Context method.
  5884. func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
  5885. c.ctx_ = ctx
  5886. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5887. for {
  5888. x, err := c.Do()
  5889. if err != nil {
  5890. return err
  5891. }
  5892. if err := f(x); err != nil {
  5893. return err
  5894. }
  5895. if x.NextPageToken == "" {
  5896. return nil
  5897. }
  5898. c.PageToken(x.NextPageToken)
  5899. }
  5900. }
  5901. // method id "storage.objects.patch":
  5902. type ObjectsPatchCall struct {
  5903. s *Service
  5904. bucket string
  5905. object string
  5906. object2 *Object
  5907. urlParams_ gensupport.URLParams
  5908. ctx_ context.Context
  5909. header_ http.Header
  5910. }
  5911. // Patch: Updates a data blob's associated metadata. This method
  5912. // supports patch semantics.
  5913. func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
  5914. c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5915. c.bucket = bucket
  5916. c.object = object
  5917. c.object2 = object2
  5918. return c
  5919. }
  5920. // Generation sets the optional parameter "generation": If present,
  5921. // selects a specific revision of this object (as opposed to the latest
  5922. // version, the default).
  5923. func (c *ObjectsPatchCall) Generation(generation uint64) *ObjectsPatchCall {
  5924. c.urlParams_.Set("generation", fmt.Sprint(generation))
  5925. return c
  5926. }
  5927. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  5928. // Makes the operation conditional on whether the object's current
  5929. // generation matches the given value.
  5930. func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsPatchCall {
  5931. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  5932. return c
  5933. }
  5934. // IfGenerationNotMatch sets the optional parameter
  5935. // "ifGenerationNotMatch": Makes the operation conditional on whether
  5936. // the object's current generation does not match the given value.
  5937. func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsPatchCall {
  5938. c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  5939. return c
  5940. }
  5941. // IfMetagenerationMatch sets the optional parameter
  5942. // "ifMetagenerationMatch": Makes the operation conditional on whether
  5943. // the object's current metageneration matches the given value.
  5944. func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsPatchCall {
  5945. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  5946. return c
  5947. }
  5948. // IfMetagenerationNotMatch sets the optional parameter
  5949. // "ifMetagenerationNotMatch": Makes the operation conditional on
  5950. // whether the object's current metageneration does not match the given
  5951. // value.
  5952. func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsPatchCall {
  5953. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  5954. return c
  5955. }
  5956. // Projection sets the optional parameter "projection": Set of
  5957. // properties to return. Defaults to full.
  5958. //
  5959. // Possible values:
  5960. // "full" - Include all properties.
  5961. // "noAcl" - Omit the acl property.
  5962. func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
  5963. c.urlParams_.Set("projection", projection)
  5964. return c
  5965. }
  5966. // Fields allows partial responses to be retrieved. See
  5967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5968. // for more information.
  5969. func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
  5970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5971. return c
  5972. }
  5973. // Context sets the context to be used in this call's Do method. Any
  5974. // pending HTTP request will be aborted if the provided context is
  5975. // canceled.
  5976. func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
  5977. c.ctx_ = ctx
  5978. return c
  5979. }
  5980. // Header returns an http.Header that can be modified by the caller to
  5981. // add HTTP headers to the request.
  5982. func (c *ObjectsPatchCall) Header() http.Header {
  5983. if c.header_ == nil {
  5984. c.header_ = make(http.Header)
  5985. }
  5986. return c.header_
  5987. }
  5988. func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
  5989. reqHeaders := make(http.Header)
  5990. for k, v := range c.header_ {
  5991. reqHeaders[k] = v
  5992. }
  5993. reqHeaders.Set("User-Agent", c.s.userAgent())
  5994. var body io.Reader = nil
  5995. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
  5996. if err != nil {
  5997. return nil, err
  5998. }
  5999. reqHeaders.Set("Content-Type", "application/json")
  6000. c.urlParams_.Set("alt", alt)
  6001. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  6002. urls += "?" + c.urlParams_.Encode()
  6003. req, _ := http.NewRequest("PATCH", urls, body)
  6004. req.Header = reqHeaders
  6005. googleapi.Expand(req.URL, map[string]string{
  6006. "bucket": c.bucket,
  6007. "object": c.object,
  6008. })
  6009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6010. }
  6011. // Do executes the "storage.objects.patch" call.
  6012. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  6013. // code is an error. Response headers are in either
  6014. // *Object.ServerResponse.Header or (if a response was returned at all)
  6015. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6016. // check whether the returned error was because http.StatusNotModified
  6017. // was returned.
  6018. func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  6019. gensupport.SetOptions(c.urlParams_, opts...)
  6020. res, err := c.doRequest("json")
  6021. if res != nil && res.StatusCode == http.StatusNotModified {
  6022. if res.Body != nil {
  6023. res.Body.Close()
  6024. }
  6025. return nil, &googleapi.Error{
  6026. Code: res.StatusCode,
  6027. Header: res.Header,
  6028. }
  6029. }
  6030. if err != nil {
  6031. return nil, err
  6032. }
  6033. defer googleapi.CloseBody(res)
  6034. if err := googleapi.CheckResponse(res); err != nil {
  6035. return nil, err
  6036. }
  6037. ret := &Object{
  6038. ServerResponse: googleapi.ServerResponse{
  6039. Header: res.Header,
  6040. HTTPStatusCode: res.StatusCode,
  6041. },
  6042. }
  6043. target := &ret
  6044. if err := gensupport.DecodeResponse(target, res); err != nil {
  6045. return nil, err
  6046. }
  6047. return ret, nil
  6048. // {
  6049. // "description": "Updates a data blob's associated metadata. This method supports patch semantics.",
  6050. // "httpMethod": "PATCH",
  6051. // "id": "storage.objects.patch",
  6052. // "parameterOrder": [
  6053. // "bucket",
  6054. // "object"
  6055. // ],
  6056. // "parameters": {
  6057. // "bucket": {
  6058. // "description": "Name of the bucket in which the object resides.",
  6059. // "location": "path",
  6060. // "required": true,
  6061. // "type": "string"
  6062. // },
  6063. // "generation": {
  6064. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  6065. // "format": "uint64",
  6066. // "location": "query",
  6067. // "type": "string"
  6068. // },
  6069. // "ifGenerationMatch": {
  6070. // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  6071. // "format": "uint64",
  6072. // "location": "query",
  6073. // "type": "string"
  6074. // },
  6075. // "ifGenerationNotMatch": {
  6076. // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  6077. // "format": "uint64",
  6078. // "location": "query",
  6079. // "type": "string"
  6080. // },
  6081. // "ifMetagenerationMatch": {
  6082. // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  6083. // "format": "uint64",
  6084. // "location": "query",
  6085. // "type": "string"
  6086. // },
  6087. // "ifMetagenerationNotMatch": {
  6088. // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  6089. // "format": "uint64",
  6090. // "location": "query",
  6091. // "type": "string"
  6092. // },
  6093. // "object": {
  6094. // "description": "Name of the object.",
  6095. // "location": "path",
  6096. // "required": true,
  6097. // "type": "string"
  6098. // },
  6099. // "projection": {
  6100. // "description": "Set of properties to return. Defaults to full.",
  6101. // "enum": [
  6102. // "full",
  6103. // "noAcl"
  6104. // ],
  6105. // "enumDescriptions": [
  6106. // "Include all properties.",
  6107. // "Omit the acl property."
  6108. // ],
  6109. // "location": "query",
  6110. // "type": "string"
  6111. // }
  6112. // },
  6113. // "path": "b/{bucket}/o/{object}",
  6114. // "request": {
  6115. // "$ref": "Object"
  6116. // },
  6117. // "response": {
  6118. // "$ref": "Object"
  6119. // },
  6120. // "scopes": [
  6121. // "https://www.googleapis.com/auth/devstorage.full_control",
  6122. // "https://www.googleapis.com/auth/devstorage.read_write"
  6123. // ]
  6124. // }
  6125. }
  6126. // method id "storage.objects.update":
  6127. type ObjectsUpdateCall struct {
  6128. s *Service
  6129. bucket string
  6130. object string
  6131. object2 *Object
  6132. urlParams_ gensupport.URLParams
  6133. ctx_ context.Context
  6134. header_ http.Header
  6135. }
  6136. // Update: Updates a data blob's associated metadata.
  6137. func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
  6138. c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6139. c.bucket = bucket
  6140. c.object = object
  6141. c.object2 = object2
  6142. return c
  6143. }
  6144. // Generation sets the optional parameter "generation": If present,
  6145. // selects a specific revision of this object (as opposed to the latest
  6146. // version, the default).
  6147. func (c *ObjectsUpdateCall) Generation(generation uint64) *ObjectsUpdateCall {
  6148. c.urlParams_.Set("generation", fmt.Sprint(generation))
  6149. return c
  6150. }
  6151. // IfGenerationMatch sets the optional parameter "ifGenerationMatch":
  6152. // Makes the operation conditional on whether the object's current
  6153. // generation matches the given value.
  6154. func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsUpdateCall {
  6155. c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
  6156. return c
  6157. }
  6158. // IfGenerationNotMatch sets the optional parameter
  6159. // "ifGenerationNotMatch": Makes the operation conditional on whether
  6160. // the object's current generation does not match the given value.
  6161. func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsUpdateCall {
  6162. c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
  6163. return c
  6164. }
  6165. // IfMetagenerationMatch sets the optional parameter
  6166. // "ifMetagenerationMatch": Makes the operation conditional on whether
  6167. // the object's current metageneration matches the given value.
  6168. func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsUpdateCall {
  6169. c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
  6170. return c
  6171. }
  6172. // IfMetagenerationNotMatch sets the optional parameter
  6173. // "ifMetagenerationNotMatch": Makes the operation conditional on
  6174. // whether the object's current metageneration does not match the given
  6175. // value.
  6176. func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsUpdateCall {
  6177. c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
  6178. return c
  6179. }
  6180. // Projection sets the optional parameter "projection": Set of
  6181. // properties to return. Defaults to full.
  6182. //
  6183. // Possible values:
  6184. // "full" - Include all properties.
  6185. // "noAcl" - Omit the acl property.
  6186. func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
  6187. c.urlParams_.Set("projection", projection)
  6188. return c
  6189. }
  6190. // Fields allows partial responses to be retrieved. See
  6191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6192. // for more information.
  6193. func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
  6194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6195. return c
  6196. }
  6197. // Context sets the context to be used in this call's Do and Download
  6198. // methods. Any pending HTTP request will be aborted if the provided
  6199. // context is canceled.
  6200. func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
  6201. c.ctx_ = ctx
  6202. return c
  6203. }
  6204. // Header returns an http.Header that can be modified by the caller to
  6205. // add HTTP headers to the request.
  6206. func (c *ObjectsUpdateCall) Header() http.Header {
  6207. if c.header_ == nil {
  6208. c.header_ = make(http.Header)
  6209. }
  6210. return c.header_
  6211. }
  6212. func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6213. reqHeaders := make(http.Header)
  6214. for k, v := range c.header_ {
  6215. reqHeaders[k] = v
  6216. }
  6217. reqHeaders.Set("User-Agent", c.s.userAgent())
  6218. var body io.Reader = nil
  6219. body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
  6220. if err != nil {
  6221. return nil, err
  6222. }
  6223. reqHeaders.Set("Content-Type", "application/json")
  6224. c.urlParams_.Set("alt", alt)
  6225. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
  6226. urls += "?" + c.urlParams_.Encode()
  6227. req, _ := http.NewRequest("PUT", urls, body)
  6228. req.Header = reqHeaders
  6229. googleapi.Expand(req.URL, map[string]string{
  6230. "bucket": c.bucket,
  6231. "object": c.object,
  6232. })
  6233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6234. }
  6235. // Download fetches the API endpoint's "media" value, instead of the normal
  6236. // API response value. If the returned error is nil, the Response is guaranteed to
  6237. // have a 2xx status code. Callers must close the Response.Body as usual.
  6238. func (c *ObjectsUpdateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  6239. gensupport.SetOptions(c.urlParams_, opts...)
  6240. res, err := c.doRequest("media")
  6241. if err != nil {
  6242. return nil, err
  6243. }
  6244. if err := googleapi.CheckMediaResponse(res); err != nil {
  6245. res.Body.Close()
  6246. return nil, err
  6247. }
  6248. return res, nil
  6249. }
  6250. // Do executes the "storage.objects.update" call.
  6251. // Exactly one of *Object or error will be non-nil. Any non-2xx status
  6252. // code is an error. Response headers are in either
  6253. // *Object.ServerResponse.Header or (if a response was returned at all)
  6254. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6255. // check whether the returned error was because http.StatusNotModified
  6256. // was returned.
  6257. func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
  6258. gensupport.SetOptions(c.urlParams_, opts...)
  6259. res, err := c.doRequest("json")
  6260. if res != nil && res.StatusCode == http.StatusNotModified {
  6261. if res.Body != nil {
  6262. res.Body.Close()
  6263. }
  6264. return nil, &googleapi.Error{
  6265. Code: res.StatusCode,
  6266. Header: res.Header,
  6267. }
  6268. }
  6269. if err != nil {
  6270. return nil, err
  6271. }
  6272. defer googleapi.CloseBody(res)
  6273. if err := googleapi.CheckResponse(res); err != nil {
  6274. return nil, err
  6275. }
  6276. ret := &Object{
  6277. ServerResponse: googleapi.ServerResponse{
  6278. Header: res.Header,
  6279. HTTPStatusCode: res.StatusCode,
  6280. },
  6281. }
  6282. target := &ret
  6283. if err := gensupport.DecodeResponse(target, res); err != nil {
  6284. return nil, err
  6285. }
  6286. return ret, nil
  6287. // {
  6288. // "description": "Updates a data blob's associated metadata.",
  6289. // "httpMethod": "PUT",
  6290. // "id": "storage.objects.update",
  6291. // "parameterOrder": [
  6292. // "bucket",
  6293. // "object"
  6294. // ],
  6295. // "parameters": {
  6296. // "bucket": {
  6297. // "description": "Name of the bucket in which the object resides.",
  6298. // "location": "path",
  6299. // "required": true,
  6300. // "type": "string"
  6301. // },
  6302. // "generation": {
  6303. // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
  6304. // "format": "uint64",
  6305. // "location": "query",
  6306. // "type": "string"
  6307. // },
  6308. // "ifGenerationMatch": {
  6309. // "description": "Makes the operation conditional on whether the object's current generation matches the given value.",
  6310. // "format": "uint64",
  6311. // "location": "query",
  6312. // "type": "string"
  6313. // },
  6314. // "ifGenerationNotMatch": {
  6315. // "description": "Makes the operation conditional on whether the object's current generation does not match the given value.",
  6316. // "format": "uint64",
  6317. // "location": "query",
  6318. // "type": "string"
  6319. // },
  6320. // "ifMetagenerationMatch": {
  6321. // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
  6322. // "format": "uint64",
  6323. // "location": "query",
  6324. // "type": "string"
  6325. // },
  6326. // "ifMetagenerationNotMatch": {
  6327. // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
  6328. // "format": "uint64",
  6329. // "location": "query",
  6330. // "type": "string"
  6331. // },
  6332. // "object": {
  6333. // "description": "Name of the object.",
  6334. // "location": "path",
  6335. // "required": true,
  6336. // "type": "string"
  6337. // },
  6338. // "projection": {
  6339. // "description": "Set of properties to return. Defaults to full.",
  6340. // "enum": [
  6341. // "full",
  6342. // "noAcl"
  6343. // ],
  6344. // "enumDescriptions": [
  6345. // "Include all properties.",
  6346. // "Omit the acl property."
  6347. // ],
  6348. // "location": "query",
  6349. // "type": "string"
  6350. // }
  6351. // },
  6352. // "path": "b/{bucket}/o/{object}",
  6353. // "request": {
  6354. // "$ref": "Object"
  6355. // },
  6356. // "response": {
  6357. // "$ref": "Object"
  6358. // },
  6359. // "scopes": [
  6360. // "https://www.googleapis.com/auth/devstorage.full_control",
  6361. // "https://www.googleapis.com/auth/devstorage.read_write"
  6362. // ],
  6363. // "supportsMediaDownload": true
  6364. // }
  6365. }
  6366. // method id "storage.objects.watchAll":
  6367. type ObjectsWatchAllCall struct {
  6368. s *Service
  6369. bucket string
  6370. channel *Channel
  6371. urlParams_ gensupport.URLParams
  6372. ctx_ context.Context
  6373. header_ http.Header
  6374. }
  6375. // WatchAll: Watch for changes on all objects in a bucket.
  6376. func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
  6377. c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6378. c.bucket = bucket
  6379. c.channel = channel
  6380. return c
  6381. }
  6382. // Delimiter sets the optional parameter "delimiter": Returns results in
  6383. // a directory-like mode. items will contain only objects whose names,
  6384. // aside from the prefix, do not contain delimiter. Objects whose names,
  6385. // aside from the prefix, contain delimiter will have their name,
  6386. // truncated after the delimiter, returned in prefixes. Duplicate
  6387. // prefixes are omitted.
  6388. func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
  6389. c.urlParams_.Set("delimiter", delimiter)
  6390. return c
  6391. }
  6392. // MaxResults sets the optional parameter "maxResults": Maximum number
  6393. // of items plus prefixes to return. As duplicate prefixes are omitted,
  6394. // fewer total results may be returned than requested.
  6395. func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
  6396. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6397. return c
  6398. }
  6399. // PageToken sets the optional parameter "pageToken": A
  6400. // previously-returned page token representing part of the larger set of
  6401. // results to view.
  6402. func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
  6403. c.urlParams_.Set("pageToken", pageToken)
  6404. return c
  6405. }
  6406. // Prefix sets the optional parameter "prefix": Filter results to
  6407. // objects whose names begin with this prefix.
  6408. func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
  6409. c.urlParams_.Set("prefix", prefix)
  6410. return c
  6411. }
  6412. // Projection sets the optional parameter "projection": Set of
  6413. // properties to return. Defaults to noAcl.
  6414. //
  6415. // Possible values:
  6416. // "full" - Include all properties.
  6417. // "noAcl" - Omit the acl property.
  6418. func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
  6419. c.urlParams_.Set("projection", projection)
  6420. return c
  6421. }
  6422. // Versions sets the optional parameter "versions": If true, lists all
  6423. // versions of a file as distinct results.
  6424. func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
  6425. c.urlParams_.Set("versions", fmt.Sprint(versions))
  6426. return c
  6427. }
  6428. // Fields allows partial responses to be retrieved. See
  6429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6430. // for more information.
  6431. func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
  6432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6433. return c
  6434. }
  6435. // Context sets the context to be used in this call's Do method. Any
  6436. // pending HTTP request will be aborted if the provided context is
  6437. // canceled.
  6438. func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
  6439. c.ctx_ = ctx
  6440. return c
  6441. }
  6442. // Header returns an http.Header that can be modified by the caller to
  6443. // add HTTP headers to the request.
  6444. func (c *ObjectsWatchAllCall) Header() http.Header {
  6445. if c.header_ == nil {
  6446. c.header_ = make(http.Header)
  6447. }
  6448. return c.header_
  6449. }
  6450. func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
  6451. reqHeaders := make(http.Header)
  6452. for k, v := range c.header_ {
  6453. reqHeaders[k] = v
  6454. }
  6455. reqHeaders.Set("User-Agent", c.s.userAgent())
  6456. var body io.Reader = nil
  6457. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  6458. if err != nil {
  6459. return nil, err
  6460. }
  6461. reqHeaders.Set("Content-Type", "application/json")
  6462. c.urlParams_.Set("alt", alt)
  6463. urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
  6464. urls += "?" + c.urlParams_.Encode()
  6465. req, _ := http.NewRequest("POST", urls, body)
  6466. req.Header = reqHeaders
  6467. googleapi.Expand(req.URL, map[string]string{
  6468. "bucket": c.bucket,
  6469. })
  6470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6471. }
  6472. // Do executes the "storage.objects.watchAll" call.
  6473. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  6474. // code is an error. Response headers are in either
  6475. // *Channel.ServerResponse.Header or (if a response was returned at all)
  6476. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6477. // check whether the returned error was because http.StatusNotModified
  6478. // was returned.
  6479. func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  6480. gensupport.SetOptions(c.urlParams_, opts...)
  6481. res, err := c.doRequest("json")
  6482. if res != nil && res.StatusCode == http.StatusNotModified {
  6483. if res.Body != nil {
  6484. res.Body.Close()
  6485. }
  6486. return nil, &googleapi.Error{
  6487. Code: res.StatusCode,
  6488. Header: res.Header,
  6489. }
  6490. }
  6491. if err != nil {
  6492. return nil, err
  6493. }
  6494. defer googleapi.CloseBody(res)
  6495. if err := googleapi.CheckResponse(res); err != nil {
  6496. return nil, err
  6497. }
  6498. ret := &Channel{
  6499. ServerResponse: googleapi.ServerResponse{
  6500. Header: res.Header,
  6501. HTTPStatusCode: res.StatusCode,
  6502. },
  6503. }
  6504. target := &ret
  6505. if err := gensupport.DecodeResponse(target, res); err != nil {
  6506. return nil, err
  6507. }
  6508. return ret, nil
  6509. // {
  6510. // "description": "Watch for changes on all objects in a bucket.",
  6511. // "httpMethod": "POST",
  6512. // "id": "storage.objects.watchAll",
  6513. // "parameterOrder": [
  6514. // "bucket"
  6515. // ],
  6516. // "parameters": {
  6517. // "bucket": {
  6518. // "description": "Name of the bucket in which to look for objects.",
  6519. // "location": "path",
  6520. // "required": true,
  6521. // "type": "string"
  6522. // },
  6523. // "delimiter": {
  6524. // "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.",
  6525. // "location": "query",
  6526. // "type": "string"
  6527. // },
  6528. // "maxResults": {
  6529. // "description": "Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested.",
  6530. // "format": "uint32",
  6531. // "location": "query",
  6532. // "minimum": "0",
  6533. // "type": "integer"
  6534. // },
  6535. // "pageToken": {
  6536. // "description": "A previously-returned page token representing part of the larger set of results to view.",
  6537. // "location": "query",
  6538. // "type": "string"
  6539. // },
  6540. // "prefix": {
  6541. // "description": "Filter results to objects whose names begin with this prefix.",
  6542. // "location": "query",
  6543. // "type": "string"
  6544. // },
  6545. // "projection": {
  6546. // "description": "Set of properties to return. Defaults to noAcl.",
  6547. // "enum": [
  6548. // "full",
  6549. // "noAcl"
  6550. // ],
  6551. // "enumDescriptions": [
  6552. // "Include all properties.",
  6553. // "Omit the acl property."
  6554. // ],
  6555. // "location": "query",
  6556. // "type": "string"
  6557. // },
  6558. // "versions": {
  6559. // "description": "If true, lists all versions of a file as distinct results.",
  6560. // "location": "query",
  6561. // "type": "boolean"
  6562. // }
  6563. // },
  6564. // "path": "b/{bucket}/o/watch",
  6565. // "request": {
  6566. // "$ref": "Channel",
  6567. // "parameterName": "resource"
  6568. // },
  6569. // "response": {
  6570. // "$ref": "Channel"
  6571. // },
  6572. // "scopes": [
  6573. // "https://www.googleapis.com/auth/devstorage.full_control",
  6574. // "https://www.googleapis.com/auth/devstorage.read_only",
  6575. // "https://www.googleapis.com/auth/devstorage.read_write"
  6576. // ],
  6577. // "supportsSubscription": true
  6578. // }
  6579. }