| // Copyright 2020 Google LLC. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // Code generated file. DO NOT EDIT. |
| |
| // Package storage provides access to the Cloud Storage JSON API. |
| // |
| // This package is DEPRECATED. Use package cloud.google.com/go/storage instead. |
| // |
| // For product documentation, see: https://developers.google.com/storage/docs/json_api/ |
| // |
| // Creating a client |
| // |
| // Usage example: |
| // |
| // import "google.golang.org/api/storage/v1beta2" |
| // ... |
| // ctx := context.Background() |
| // storageService, err := storage.NewService(ctx) |
| // |
| // In this example, Google Application Default Credentials are used for authentication. |
| // |
| // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. |
| // |
| // Other authentication options |
| // |
| // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: |
| // |
| // storageService, err := storage.NewService(ctx, option.WithScopes(storage.DevstorageReadWriteScope)) |
| // |
| // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: |
| // |
| // storageService, err := storage.NewService(ctx, option.WithAPIKey("AIza...")) |
| // |
| // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: |
| // |
| // config := &oauth2.Config{...} |
| // // ... |
| // token, err := config.Exchange(ctx, ...) |
| // storageService, err := storage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) |
| // |
| // See https://godoc.org/google.golang.org/api/option/ for details on options. |
| package storage // import "google.golang.org/api/storage/v1beta2" |
| |
| import ( |
| "bytes" |
| "context" |
| "encoding/json" |
| "errors" |
| "fmt" |
| "io" |
| "net/http" |
| "net/url" |
| "strconv" |
| "strings" |
| |
| googleapi "google.golang.org/api/googleapi" |
| gensupport "google.golang.org/api/internal/gensupport" |
| option "google.golang.org/api/option" |
| internaloption "google.golang.org/api/option/internaloption" |
| htransport "google.golang.org/api/transport/http" |
| ) |
| |
| // Always reference these packages, just in case the auto-generated code |
| // below doesn't. |
| var _ = bytes.NewBuffer |
| var _ = strconv.Itoa |
| var _ = fmt.Sprintf |
| var _ = json.NewDecoder |
| var _ = io.Copy |
| var _ = url.Parse |
| var _ = gensupport.MarshalJSON |
| var _ = googleapi.Version |
| var _ = errors.New |
| var _ = strings.Replace |
| var _ = context.Canceled |
| var _ = internaloption.WithDefaultEndpoint |
| |
| const apiId = "storage:v1beta2" |
| const apiName = "storage" |
| const apiVersion = "v1beta2" |
| const basePath = "https://storage.googleapis.com/storage/v1beta2/" |
| |
| // OAuth2 scopes used by this API. |
| const ( |
| // Manage your data and permissions in Google Cloud Storage |
| DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control" |
| |
| // View your data in Google Cloud Storage |
| DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only" |
| |
| // Manage your data in Google Cloud Storage |
| DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write" |
| ) |
| |
| // NewService creates a new Service. |
| func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { |
| scopesOption := option.WithScopes( |
| "https://www.googleapis.com/auth/devstorage.full_control", |
| "https://www.googleapis.com/auth/devstorage.read_only", |
| "https://www.googleapis.com/auth/devstorage.read_write", |
| ) |
| // NOTE: prepend, so we don't override user-specified scopes. |
| opts = append([]option.ClientOption{scopesOption}, opts...) |
| opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) |
| client, endpoint, err := htransport.NewClient(ctx, opts...) |
| if err != nil { |
| return nil, err |
| } |
| s, err := New(client) |
| if err != nil { |
| return nil, err |
| } |
| if endpoint != "" { |
| s.BasePath = endpoint |
| } |
| return s, nil |
| } |
| |
| // New creates a new Service. It uses the provided http.Client for requests. |
| // |
| // Deprecated: please use NewService instead. |
| // To provide a custom HTTP client, use option.WithHTTPClient. |
| // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. |
| func New(client *http.Client) (*Service, error) { |
| if client == nil { |
| return nil, errors.New("client is nil") |
| } |
| s := &Service{client: client, BasePath: basePath} |
| s.BucketAccessControls = NewBucketAccessControlsService(s) |
| s.Buckets = NewBucketsService(s) |
| s.Channels = NewChannelsService(s) |
| s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s) |
| s.ObjectAccessControls = NewObjectAccessControlsService(s) |
| s.Objects = NewObjectsService(s) |
| return s, nil |
| } |
| |
| type Service struct { |
| client *http.Client |
| BasePath string // API endpoint base URL |
| UserAgent string // optional additional User-Agent fragment |
| |
| BucketAccessControls *BucketAccessControlsService |
| |
| Buckets *BucketsService |
| |
| Channels *ChannelsService |
| |
| DefaultObjectAccessControls *DefaultObjectAccessControlsService |
| |
| ObjectAccessControls *ObjectAccessControlsService |
| |
| Objects *ObjectsService |
| } |
| |
| func (s *Service) userAgent() string { |
| if s.UserAgent == "" { |
| return googleapi.UserAgent |
| } |
| return googleapi.UserAgent + " " + s.UserAgent |
| } |
| |
| func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService { |
| rs := &BucketAccessControlsService{s: s} |
| return rs |
| } |
| |
| type BucketAccessControlsService struct { |
| s *Service |
| } |
| |
| func NewBucketsService(s *Service) *BucketsService { |
| rs := &BucketsService{s: s} |
| return rs |
| } |
| |
| type BucketsService struct { |
| s *Service |
| } |
| |
| func NewChannelsService(s *Service) *ChannelsService { |
| rs := &ChannelsService{s: s} |
| return rs |
| } |
| |
| type ChannelsService struct { |
| s *Service |
| } |
| |
| func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService { |
| rs := &DefaultObjectAccessControlsService{s: s} |
| return rs |
| } |
| |
| type DefaultObjectAccessControlsService struct { |
| s *Service |
| } |
| |
| func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService { |
| rs := &ObjectAccessControlsService{s: s} |
| return rs |
| } |
| |
| type ObjectAccessControlsService struct { |
| s *Service |
| } |
| |
| func NewObjectsService(s *Service) *ObjectsService { |
| rs := &ObjectsService{s: s} |
| return rs |
| } |
| |
| type ObjectsService struct { |
| s *Service |
| } |
| |
| // Bucket: A bucket. |
| type Bucket struct { |
| // Acl: Access controls on the bucket. |
| Acl []*BucketAccessControl `json:"acl,omitempty"` |
| |
| // Cors: The bucket's Cross-Origin Resource Sharing (CORS) |
| // configuration. |
| Cors []*BucketCors `json:"cors,omitempty"` |
| |
| // DefaultObjectAcl: Default access controls to apply to new objects |
| // when no ACL is provided. |
| DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` |
| |
| // Etag: HTTP 1.1 Entity tag for the bucket. |
| Etag string `json:"etag,omitempty"` |
| |
| // Id: The ID of the bucket. |
| Id string `json:"id,omitempty"` |
| |
| // Kind: The kind of item this is. For buckets, this is always |
| // storage#bucket. |
| Kind string `json:"kind,omitempty"` |
| |
| // Lifecycle: The bucket's lifecycle configuration. See object lifecycle |
| // management for more information. |
| Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"` |
| |
| // Location: The location of the bucket. Object data for objects in the |
| // bucket resides in physical storage within this region. Typical values |
| // are US and EU. Defaults to US. See the developer's guide for the |
| // authoritative list. |
| Location string `json:"location,omitempty"` |
| |
| // Logging: The bucket's logging configuration, which defines the |
| // destination bucket and optional name prefix for the current bucket's |
| // logs. |
| Logging *BucketLogging `json:"logging,omitempty"` |
| |
| // Metageneration: The metadata generation of this bucket. |
| Metageneration int64 `json:"metageneration,omitempty,string"` |
| |
| // Name: The name of the bucket. |
| Name string `json:"name,omitempty"` |
| |
| // Owner: The owner of the bucket. This is always the project team's |
| // owner group. |
| Owner *BucketOwner `json:"owner,omitempty"` |
| |
| // SelfLink: The URI of this bucket. |
| SelfLink string `json:"selfLink,omitempty"` |
| |
| // StorageClass: The bucket's storage class. This defines how objects in |
| // the bucket are stored and determines the SLA and the cost of storage. |
| // Typical values are STANDARD and DURABLE_REDUCED_AVAILABILITY. |
| // Defaults to STANDARD. See the developer's guide for the authoritative |
| // list. |
| StorageClass string `json:"storageClass,omitempty"` |
| |
| // TimeCreated: Creation time of the bucket in RFC 3339 format. |
| TimeCreated string `json:"timeCreated,omitempty"` |
| |
| // Versioning: The bucket's versioning configuration. |
| Versioning *BucketVersioning `json:"versioning,omitempty"` |
| |
| // Website: The bucket's website configuration. |
| Website *BucketWebsite `json:"website,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Acl") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Acl") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *Bucket) MarshalJSON() ([]byte, error) { |
| type NoMethod Bucket |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| type BucketCors struct { |
| // MaxAgeSeconds: The value, in seconds, to return in the |
| // Access-Control-Max-Age header used in preflight responses. |
| MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"` |
| |
| // Method: The list of HTTP methods on which to include CORS response |
| // headers: GET, OPTIONS, POST, etc. Note, "*" is permitted in the list |
| // of methods, and means "any method". |
| Method []string `json:"method,omitempty"` |
| |
| // Origin: The list of Origins eligible to receive CORS response |
| // headers. Note: "*" is permitted in the list of origins, and means |
| // "any Origin". |
| Origin []string `json:"origin,omitempty"` |
| |
| // ResponseHeader: The list of HTTP headers other than the simple |
| // response headers to give permission for the user-agent to share |
| // across domains. |
| ResponseHeader []string `json:"responseHeader,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include |
| // in API requests with the JSON null value. By default, fields with |
| // empty values are omitted from API requests. However, any field with |
| // an empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketCors) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketCors |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketLifecycle: The bucket's lifecycle configuration. See object |
| // lifecycle management for more information. |
| type BucketLifecycle struct { |
| // Rule: A lifecycle management rule, which is made of an action to take |
| // and the condition(s) under which the action will be taken. |
| Rule []*BucketLifecycleRule `json:"rule,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Rule") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Rule") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketLifecycle) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketLifecycle |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| type BucketLifecycleRule struct { |
| // Action: The action to take. |
| Action *BucketLifecycleRuleAction `json:"action,omitempty"` |
| |
| // Condition: The condition(s) under which the action will be taken. |
| Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Action") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Action") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketLifecycleRule |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketLifecycleRuleAction: The action to take. |
| type BucketLifecycleRuleAction struct { |
| // Type: Type of the action. Currently only Delete is supported. |
| Type string `json:"type,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Type") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Type") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketLifecycleRuleAction |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketLifecycleRuleCondition: The condition(s) under which the action |
| // will be taken. |
| type BucketLifecycleRuleCondition struct { |
| // Age: Age of an object (in days). This condition is satisfied when an |
| // object reaches the specified age. |
| Age int64 `json:"age,omitempty"` |
| |
| // CreatedBefore: A date in RFC 3339 format with only the date part, |
| // e.g. "2013-01-15". This condition is satisfied when an object is |
| // created before midnight of the specified date in UTC. |
| CreatedBefore string `json:"createdBefore,omitempty"` |
| |
| // IsLive: Relevant only for versioned objects. If the value is true, |
| // this condition matches live objects; if the value is false, it |
| // matches archived objects. |
| IsLive *bool `json:"isLive,omitempty"` |
| |
| // NumNewerVersions: Relevant only for versioned objects. If the value |
| // is N, this condition is satisfied when there are at least N versions |
| // (including the live version) newer than this version of the object. |
| NumNewerVersions int64 `json:"numNewerVersions,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Age") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Age") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketLifecycleRuleCondition |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketLogging: The bucket's logging configuration, which defines the |
| // destination bucket and optional name prefix for the current bucket's |
| // logs. |
| type BucketLogging struct { |
| // LogBucket: The destination bucket where the current bucket's logs |
| // should be placed. |
| LogBucket string `json:"logBucket,omitempty"` |
| |
| // LogObjectPrefix: A prefix for log object names. |
| LogObjectPrefix string `json:"logObjectPrefix,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "LogBucket") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "LogBucket") to include in |
| // API requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketLogging) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketLogging |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketOwner: The owner of the bucket. This is always the project |
| // team's owner group. |
| type BucketOwner struct { |
| // Entity: The entity, in the form group-groupId. |
| Entity string `json:"entity,omitempty"` |
| |
| // EntityId: The ID for the entity. |
| EntityId string `json:"entityId,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Entity") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Entity") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketOwner) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketOwner |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketVersioning: The bucket's versioning configuration. |
| type BucketVersioning struct { |
| // Enabled: While set to true, versioning is fully enabled for this |
| // bucket. |
| Enabled bool `json:"enabled,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Enabled") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Enabled") to include in |
| // API requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketVersioning) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketVersioning |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketWebsite: The bucket's website configuration. |
| type BucketWebsite struct { |
| // MainPageSuffix: Behaves as the bucket's directory index where missing |
| // objects are treated as potential directories. |
| MainPageSuffix string `json:"mainPageSuffix,omitempty"` |
| |
| // NotFoundPage: The custom object to return when a requested resource |
| // is not found. |
| NotFoundPage string `json:"notFoundPage,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "MainPageSuffix") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "MainPageSuffix") to |
| // include in API requests with the JSON null value. By default, fields |
| // with empty values are omitted from API requests. However, any field |
| // with an empty value appearing in NullFields will be sent to the |
| // server as null. It is an error if a field in this list has a |
| // non-empty value. This may be used to include null fields in Patch |
| // requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketWebsite) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketWebsite |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketAccessControl: An access-control entry. |
| type BucketAccessControl struct { |
| // Bucket: The name of the bucket. |
| Bucket string `json:"bucket,omitempty"` |
| |
| // Domain: The domain associated with the entity, if any. |
| Domain string `json:"domain,omitempty"` |
| |
| // Email: The email address associated with the entity, if any. |
| Email string `json:"email,omitempty"` |
| |
| // Entity: The entity holding the permission, in one of the following |
| // forms: |
| // - user-userId |
| // - user-email |
| // - group-groupId |
| // - group-email |
| // - domain-domain |
| // - allUsers |
| // - allAuthenticatedUsers Examples: |
| // - The user liz@example.com would be user-liz@example.com. |
| // - The group example@googlegroups.com would be |
| // group-example@googlegroups.com. |
| // - To refer to all members of the Google Apps for Business domain |
| // example.com, the entity would be domain-example.com. |
| Entity string `json:"entity,omitempty"` |
| |
| // EntityId: The ID for the entity, if any. |
| EntityId string `json:"entityId,omitempty"` |
| |
| // Etag: HTTP 1.1 Entity tag for the access-control entry. |
| Etag string `json:"etag,omitempty"` |
| |
| // Id: The ID of the access-control entry. |
| Id string `json:"id,omitempty"` |
| |
| // Kind: The kind of item this is. For bucket access control entries, |
| // this is always storage#bucketAccessControl. |
| Kind string `json:"kind,omitempty"` |
| |
| // Role: The access permission for the entity. Can be READER, WRITER, or |
| // OWNER. |
| Role string `json:"role,omitempty"` |
| |
| // SelfLink: The link to this access-control entry. |
| SelfLink string `json:"selfLink,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Bucket") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Bucket") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketAccessControl) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketAccessControl |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // BucketAccessControls: An access-control list. |
| type BucketAccessControls struct { |
| // Items: The list of items. |
| Items []*BucketAccessControl `json:"items,omitempty"` |
| |
| // Kind: The kind of item this is. For lists of bucket access control |
| // entries, this is always storage#bucketAccessControls. |
| Kind string `json:"kind,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Items") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Items") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *BucketAccessControls) MarshalJSON() ([]byte, error) { |
| type NoMethod BucketAccessControls |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // Buckets: A list of buckets. |
| type Buckets struct { |
| // Items: The list of items. |
| Items []*Bucket `json:"items,omitempty"` |
| |
| // Kind: The kind of item this is. For lists of buckets, this is always |
| // storage#buckets. |
| Kind string `json:"kind,omitempty"` |
| |
| // NextPageToken: The continuation token, used to page through large |
| // result sets. Provide this value in a subsequent request to return the |
| // next page of results. |
| NextPageToken string `json:"nextPageToken,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Items") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Items") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *Buckets) MarshalJSON() ([]byte, error) { |
| type NoMethod Buckets |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // Channel: An notification channel used to watch for resource changes. |
| type Channel struct { |
| // Address: The address where notifications are delivered for this |
| // channel. |
| Address string `json:"address,omitempty"` |
| |
| // Expiration: Date and time of notification channel expiration, |
| // expressed as a Unix timestamp, in milliseconds. Optional. |
| Expiration int64 `json:"expiration,omitempty,string"` |
| |
| // Id: A UUID or similar unique string that identifies this channel. |
| Id string `json:"id,omitempty"` |
| |
| // Kind: Identifies this as a notification channel used to watch for |
| // changes to a resource, which is "api#channel". |
| Kind string `json:"kind,omitempty"` |
| |
| // Params: Additional parameters controlling delivery channel behavior. |
| // Optional. |
| Params map[string]string `json:"params,omitempty"` |
| |
| // Payload: A Boolean value to indicate whether payload is wanted. |
| // Optional. |
| Payload bool `json:"payload,omitempty"` |
| |
| // ResourceId: An opaque ID that identifies the resource being watched |
| // on this channel. Stable across different API versions. |
| ResourceId string `json:"resourceId,omitempty"` |
| |
| // ResourceUri: A version-specific identifier for the watched resource. |
| ResourceUri string `json:"resourceUri,omitempty"` |
| |
| // Token: An arbitrary string delivered to the target address with each |
| // notification delivered over this channel. Optional. |
| Token string `json:"token,omitempty"` |
| |
| // Type: The type of delivery mechanism used for this channel. |
| Type string `json:"type,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Address") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Address") to include in |
| // API requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *Channel) MarshalJSON() ([]byte, error) { |
| type NoMethod Channel |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // ComposeRequest: A Compose request. |
| type ComposeRequest struct { |
| // Destination: Properties of the resulting object |
| Destination *Object `json:"destination,omitempty"` |
| |
| // Kind: The kind of item this is. |
| Kind string `json:"kind,omitempty"` |
| |
| // SourceObjects: The list of source objects that will be concatenated |
| // into a single object. |
| SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Destination") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Destination") to include |
| // in API requests with the JSON null value. By default, fields with |
| // empty values are omitted from API requests. However, any field with |
| // an empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *ComposeRequest) MarshalJSON() ([]byte, error) { |
| type NoMethod ComposeRequest |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| type ComposeRequestSourceObjects struct { |
| // Generation: The generation of this object to use as the source. |
| Generation int64 `json:"generation,omitempty,string"` |
| |
| // Name: The source object's name. All source objects must reside in the |
| // same bucket. |
| Name string `json:"name,omitempty"` |
| |
| // ObjectPreconditions: Conditions that must be met for this operation |
| // to execute. |
| ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Generation") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Generation") to include in |
| // API requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) { |
| type NoMethod ComposeRequestSourceObjects |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // ComposeRequestSourceObjectsObjectPreconditions: Conditions that must |
| // be met for this operation to execute. |
| type ComposeRequestSourceObjectsObjectPreconditions struct { |
| // IfGenerationMatch: Only perform the composition if the generation of |
| // the source object that would be used matches this value. If this |
| // value and a generation are both specified, they must be the same |
| // value or the call will fail. |
| IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"` |
| |
| // ForceSendFields is a list of field names (e.g. "IfGenerationMatch") |
| // to unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "IfGenerationMatch") to |
| // include in API requests with the JSON null value. By default, fields |
| // with empty values are omitted from API requests. However, any field |
| // with an empty value appearing in NullFields will be sent to the |
| // server as null. It is an error if a field in this list has a |
| // non-empty value. This may be used to include null fields in Patch |
| // requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) { |
| type NoMethod ComposeRequestSourceObjectsObjectPreconditions |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // Object: An object. |
| type Object struct { |
| // Acl: Access controls on the object. |
| Acl []*ObjectAccessControl `json:"acl,omitempty"` |
| |
| // Bucket: The bucket containing this object. |
| Bucket string `json:"bucket,omitempty"` |
| |
| // CacheControl: Cache-Control directive for the object data. |
| CacheControl string `json:"cacheControl,omitempty"` |
| |
| // ComponentCount: Number of underlying components that make up this |
| // object. Components are accumulated by compose operations and are |
| // limited to a count of 32. |
| ComponentCount int64 `json:"componentCount,omitempty"` |
| |
| // ContentDisposition: Content-Disposition of the object data. |
| ContentDisposition string `json:"contentDisposition,omitempty"` |
| |
| // ContentEncoding: Content-Encoding of the object data. |
| ContentEncoding string `json:"contentEncoding,omitempty"` |
| |
| // ContentLanguage: Content-Language of the object data. |
| ContentLanguage string `json:"contentLanguage,omitempty"` |
| |
| // ContentType: Content-Type of the object data. |
| ContentType string `json:"contentType,omitempty"` |
| |
| // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B; |
| // encoded using base64. |
| Crc32c string `json:"crc32c,omitempty"` |
| |
| // Etag: HTTP 1.1 Entity tag for the object. |
| Etag string `json:"etag,omitempty"` |
| |
| // Generation: The content generation of this object. Used for object |
| // versioning. |
| Generation int64 `json:"generation,omitempty,string"` |
| |
| // Id: The ID of the object. |
| Id string `json:"id,omitempty"` |
| |
| // Kind: The kind of item this is. For objects, this is always |
| // storage#object. |
| Kind string `json:"kind,omitempty"` |
| |
| // Md5Hash: MD5 hash of the data; encoded using base64. |
| Md5Hash string `json:"md5Hash,omitempty"` |
| |
| // MediaLink: Media download link. |
| MediaLink string `json:"mediaLink,omitempty"` |
| |
| // Metadata: User-provided metadata, in key/value pairs. |
| Metadata map[string]string `json:"metadata,omitempty"` |
| |
| // Metageneration: The generation of the metadata for this object at |
| // this generation. Used for metadata versioning. Has no meaning outside |
| // of the context of this generation. |
| Metageneration int64 `json:"metageneration,omitempty,string"` |
| |
| // Name: The name of this object. Required if not specified by URL |
| // parameter. |
| Name string `json:"name,omitempty"` |
| |
| // Owner: The owner of the object. This will always be the uploader of |
| // the object. |
| Owner *ObjectOwner `json:"owner,omitempty"` |
| |
| // SelfLink: The link to this object. |
| SelfLink string `json:"selfLink,omitempty"` |
| |
| // Size: Content-Length of the data in bytes. |
| Size uint64 `json:"size,omitempty,string"` |
| |
| // StorageClass: Storage class of the object. |
| StorageClass string `json:"storageClass,omitempty"` |
| |
| // TimeDeleted: Deletion time of the object in RFC 3339 format. Will be |
| // returned if and only if this version of the object has been deleted. |
| TimeDeleted string `json:"timeDeleted,omitempty"` |
| |
| // Updated: Modification time of the object metadata in RFC 3339 format. |
| Updated string `json:"updated,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Acl") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Acl") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *Object) MarshalJSON() ([]byte, error) { |
| type NoMethod Object |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // ObjectOwner: The owner of the object. This will always be the |
| // uploader of the object. |
| type ObjectOwner struct { |
| // Entity: The entity, in the form user-userId. |
| Entity string `json:"entity,omitempty"` |
| |
| // EntityId: The ID for the entity. |
| EntityId string `json:"entityId,omitempty"` |
| |
| // ForceSendFields is a list of field names (e.g. "Entity") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Entity") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *ObjectOwner) MarshalJSON() ([]byte, error) { |
| type NoMethod ObjectOwner |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // ObjectAccessControl: An access-control entry. |
| type ObjectAccessControl struct { |
| // Bucket: The name of the bucket. |
| Bucket string `json:"bucket,omitempty"` |
| |
| // Domain: The domain associated with the entity, if any. |
| Domain string `json:"domain,omitempty"` |
| |
| // Email: The email address associated with the entity, if any. |
| Email string `json:"email,omitempty"` |
| |
| // Entity: The entity holding the permission, in one of the following |
| // forms: |
| // - user-userId |
| // - user-email |
| // - group-groupId |
| // - group-email |
| // - domain-domain |
| // - allUsers |
| // - allAuthenticatedUsers Examples: |
| // - The user liz@example.com would be user-liz@example.com. |
| // - The group example@googlegroups.com would be |
| // group-example@googlegroups.com. |
| // - To refer to all members of the Google Apps for Business domain |
| // example.com, the entity would be domain-example.com. |
| Entity string `json:"entity,omitempty"` |
| |
| // EntityId: The ID for the entity, if any. |
| EntityId string `json:"entityId,omitempty"` |
| |
| // Etag: HTTP 1.1 Entity tag for the access-control entry. |
| Etag string `json:"etag,omitempty"` |
| |
| // Generation: The content generation of the object. |
| Generation int64 `json:"generation,omitempty,string"` |
| |
| // Id: The ID of the access-control entry. |
| Id string `json:"id,omitempty"` |
| |
| // Kind: The kind of item this is. For object access control entries, |
| // this is always storage#objectAccessControl. |
| Kind string `json:"kind,omitempty"` |
| |
| // Object: The name of the object. |
| Object string `json:"object,omitempty"` |
| |
| // Role: The access permission for the entity. Can be READER or OWNER. |
| Role string `json:"role,omitempty"` |
| |
| // SelfLink: The link to this access-control entry. |
| SelfLink string `json:"selfLink,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Bucket") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Bucket") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) { |
| type NoMethod ObjectAccessControl |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // ObjectAccessControls: An access-control list. |
| type ObjectAccessControls struct { |
| // Items: The list of items. |
| Items []interface{} `json:"items,omitempty"` |
| |
| // Kind: The kind of item this is. For lists of object access control |
| // entries, this is always storage#objectAccessControls. |
| Kind string `json:"kind,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Items") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Items") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) { |
| type NoMethod ObjectAccessControls |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // Objects: A list of objects. |
| type Objects struct { |
| // Items: The list of items. |
| Items []*Object `json:"items,omitempty"` |
| |
| // Kind: The kind of item this is. For lists of objects, this is always |
| // storage#objects. |
| Kind string `json:"kind,omitempty"` |
| |
| // NextPageToken: The continuation token, used to page through large |
| // result sets. Provide this value in a subsequent request to return the |
| // next page of results. |
| NextPageToken string `json:"nextPageToken,omitempty"` |
| |
| // Prefixes: The list of prefixes of objects matching-but-not-listed up |
| // to and including the requested delimiter. |
| Prefixes []string `json:"prefixes,omitempty"` |
| |
| // ServerResponse contains the HTTP response code and headers from the |
| // server. |
| googleapi.ServerResponse `json:"-"` |
| |
| // ForceSendFields is a list of field names (e.g. "Items") to |
| // unconditionally include in API requests. By default, fields with |
| // empty values are omitted from API requests. However, any non-pointer, |
| // non-interface field appearing in ForceSendFields will be sent to the |
| // server regardless of whether the field is empty or not. This may be |
| // used to include empty fields in Patch requests. |
| ForceSendFields []string `json:"-"` |
| |
| // NullFields is a list of field names (e.g. "Items") to include in API |
| // requests with the JSON null value. By default, fields with empty |
| // values are omitted from API requests. However, any field with an |
| // empty value appearing in NullFields will be sent to the server as |
| // null. It is an error if a field in this list has a non-empty value. |
| // This may be used to include null fields in Patch requests. |
| NullFields []string `json:"-"` |
| } |
| |
| func (s *Objects) MarshalJSON() ([]byte, error) { |
| type NoMethod Objects |
| raw := NoMethod(*s) |
| return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) |
| } |
| |
| // method id "storage.bucketAccessControls.delete": |
| |
| type BucketAccessControlsDeleteCall struct { |
| s *Service |
| bucket string |
| entity string |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Delete: Permanently deletes the ACL entry for the specified entity on |
| // the specified bucket. |
| func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall { |
| c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.entity = entity |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketAccessControlsDeleteCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("DELETE", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| "entity": c.entity, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.bucketAccessControls.delete" call. |
| func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if err != nil { |
| return err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return err |
| } |
| return nil |
| // { |
| // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", |
| // "httpMethod": "DELETE", |
| // "id": "storage.bucketAccessControls.delete", |
| // "parameterOrder": [ |
| // "bucket", |
| // "entity" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "entity": { |
| // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/acl/{entity}", |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.bucketAccessControls.get": |
| |
| type BucketAccessControlsGetCall struct { |
| s *Service |
| bucket string |
| entity string |
| urlParams_ gensupport.URLParams |
| ifNoneMatch_ string |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Get: Returns the ACL entry for the specified entity on the specified |
| // bucket. |
| func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall { |
| c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.entity = entity |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // IfNoneMatch sets the optional parameter which makes the operation |
| // fail if the object's ETag matches the given value. This is useful for |
| // getting updates only after the object has changed since the last |
| // request. Use googleapi.IsNotModified to check whether the response |
| // error from Do is the result of In-None-Match. |
| func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall { |
| c.ifNoneMatch_ = entityTag |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketAccessControlsGetCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| if c.ifNoneMatch_ != "" { |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| } |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("GET", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| "entity": c.entity, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.bucketAccessControls.get" call. |
| // Exactly one of *BucketAccessControl or error will be non-nil. Any |
| // non-2xx status code is an error. Response headers are in either |
| // *BucketAccessControl.ServerResponse.Header or (if a response was |
| // returned at all) in error.(*googleapi.Error).Header. Use |
| // googleapi.IsNotModified to check whether the returned error was |
| // because http.StatusNotModified was returned. |
| func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &BucketAccessControl{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Returns the ACL entry for the specified entity on the specified bucket.", |
| // "httpMethod": "GET", |
| // "id": "storage.bucketAccessControls.get", |
| // "parameterOrder": [ |
| // "bucket", |
| // "entity" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "entity": { |
| // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/acl/{entity}", |
| // "response": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.bucketAccessControls.insert": |
| |
| type BucketAccessControlsInsertCall struct { |
| s *Service |
| bucket string |
| bucketaccesscontrol *BucketAccessControl |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Insert: Creates a new ACL entry on the specified bucket. |
| func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall { |
| c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.bucketaccesscontrol = bucketaccesscontrol |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketAccessControlsInsertCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("POST", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.bucketAccessControls.insert" call. |
| // Exactly one of *BucketAccessControl or error will be non-nil. Any |
| // non-2xx status code is an error. Response headers are in either |
| // *BucketAccessControl.ServerResponse.Header or (if a response was |
| // returned at all) in error.(*googleapi.Error).Header. Use |
| // googleapi.IsNotModified to check whether the returned error was |
| // because http.StatusNotModified was returned. |
| func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &BucketAccessControl{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Creates a new ACL entry on the specified bucket.", |
| // "httpMethod": "POST", |
| // "id": "storage.bucketAccessControls.insert", |
| // "parameterOrder": [ |
| // "bucket" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/acl", |
| // "request": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "response": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.bucketAccessControls.list": |
| |
| type BucketAccessControlsListCall struct { |
| s *Service |
| bucket string |
| urlParams_ gensupport.URLParams |
| ifNoneMatch_ string |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // List: Retrieves ACL entries on the specified bucket. |
| func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall { |
| c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // IfNoneMatch sets the optional parameter which makes the operation |
| // fail if the object's ETag matches the given value. This is useful for |
| // getting updates only after the object has changed since the last |
| // request. Use googleapi.IsNotModified to check whether the response |
| // error from Do is the result of In-None-Match. |
| func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall { |
| c.ifNoneMatch_ = entityTag |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketAccessControlsListCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| if c.ifNoneMatch_ != "" { |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| } |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("GET", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.bucketAccessControls.list" call. |
| // Exactly one of *BucketAccessControls or error will be non-nil. Any |
| // non-2xx status code is an error. Response headers are in either |
| // *BucketAccessControls.ServerResponse.Header or (if a response was |
| // returned at all) in error.(*googleapi.Error).Header. Use |
| // googleapi.IsNotModified to check whether the returned error was |
| // because http.StatusNotModified was returned. |
| func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &BucketAccessControls{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Retrieves ACL entries on the specified bucket.", |
| // "httpMethod": "GET", |
| // "id": "storage.bucketAccessControls.list", |
| // "parameterOrder": [ |
| // "bucket" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/acl", |
| // "response": { |
| // "$ref": "BucketAccessControls" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.bucketAccessControls.patch": |
| |
| type BucketAccessControlsPatchCall struct { |
| s *Service |
| bucket string |
| entity string |
| bucketaccesscontrol *BucketAccessControl |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Patch: Updates an ACL entry on the specified bucket. This method |
| // supports patch semantics. |
| func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall { |
| c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.entity = entity |
| c.bucketaccesscontrol = bucketaccesscontrol |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketAccessControlsPatchCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("PATCH", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| "entity": c.entity, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.bucketAccessControls.patch" call. |
| // Exactly one of *BucketAccessControl or error will be non-nil. Any |
| // non-2xx status code is an error. Response headers are in either |
| // *BucketAccessControl.ServerResponse.Header or (if a response was |
| // returned at all) in error.(*googleapi.Error).Header. Use |
| // googleapi.IsNotModified to check whether the returned error was |
| // because http.StatusNotModified was returned. |
| func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &BucketAccessControl{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.", |
| // "httpMethod": "PATCH", |
| // "id": "storage.bucketAccessControls.patch", |
| // "parameterOrder": [ |
| // "bucket", |
| // "entity" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "entity": { |
| // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/acl/{entity}", |
| // "request": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "response": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.bucketAccessControls.update": |
| |
| type BucketAccessControlsUpdateCall struct { |
| s *Service |
| bucket string |
| entity string |
| bucketaccesscontrol *BucketAccessControl |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Update: Updates an ACL entry on the specified bucket. |
| func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall { |
| c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.entity = entity |
| c.bucketaccesscontrol = bucketaccesscontrol |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketAccessControlsUpdateCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("PUT", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| "entity": c.entity, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.bucketAccessControls.update" call. |
| // Exactly one of *BucketAccessControl or error will be non-nil. Any |
| // non-2xx status code is an error. Response headers are in either |
| // *BucketAccessControl.ServerResponse.Header or (if a response was |
| // returned at all) in error.(*googleapi.Error).Header. Use |
| // googleapi.IsNotModified to check whether the returned error was |
| // because http.StatusNotModified was returned. |
| func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &BucketAccessControl{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Updates an ACL entry on the specified bucket.", |
| // "httpMethod": "PUT", |
| // "id": "storage.bucketAccessControls.update", |
| // "parameterOrder": [ |
| // "bucket", |
| // "entity" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "entity": { |
| // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/acl/{entity}", |
| // "request": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "response": { |
| // "$ref": "BucketAccessControl" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.buckets.delete": |
| |
| type BucketsDeleteCall struct { |
| s *Service |
| bucket string |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Delete: Permanently deletes an empty bucket. |
| func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall { |
| c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| return c |
| } |
| |
| // IfMetagenerationMatch sets the optional parameter |
| // "ifMetagenerationMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration matches |
| // the given value. |
| func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsDeleteCall { |
| c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) |
| return c |
| } |
| |
| // IfMetagenerationNotMatch sets the optional parameter |
| // "ifMetagenerationNotMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration does not |
| // match the given value. |
| func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsDeleteCall { |
| c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketsDeleteCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("DELETE", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.buckets.delete" call. |
| func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if err != nil { |
| return err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return err |
| } |
| return nil |
| // { |
| // "description": "Permanently deletes an empty bucket.", |
| // "httpMethod": "DELETE", |
| // "id": "storage.buckets.delete", |
| // "parameterOrder": [ |
| // "bucket" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "ifMetagenerationMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "ifMetagenerationNotMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}", |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.buckets.get": |
| |
| type BucketsGetCall struct { |
| s *Service |
| bucket string |
| urlParams_ gensupport.URLParams |
| ifNoneMatch_ string |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Get: Returns metadata for the specified bucket. |
| func (r *BucketsService) Get(bucket string) *BucketsGetCall { |
| c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| return c |
| } |
| |
| // IfMetagenerationMatch sets the optional parameter |
| // "ifMetagenerationMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration matches |
| // the given value. |
| func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsGetCall { |
| c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) |
| return c |
| } |
| |
| // IfMetagenerationNotMatch sets the optional parameter |
| // "ifMetagenerationNotMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration does not |
| // match the given value. |
| func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsGetCall { |
| c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) |
| return c |
| } |
| |
| // Projection sets the optional parameter "projection": Set of |
| // properties to return. Defaults to noAcl. |
| // |
| // Possible values: |
| // "full" - Include all properties. |
| // "noAcl" - Omit acl and defaultObjectAcl properties. |
| func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall { |
| c.urlParams_.Set("projection", projection) |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // IfNoneMatch sets the optional parameter which makes the operation |
| // fail if the object's ETag matches the given value. This is useful for |
| // getting updates only after the object has changed since the last |
| // request. Use googleapi.IsNotModified to check whether the response |
| // error from Do is the result of In-None-Match. |
| func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall { |
| c.ifNoneMatch_ = entityTag |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketsGetCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| if c.ifNoneMatch_ != "" { |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| } |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("GET", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.buckets.get" call. |
| // Exactly one of *Bucket or error will be non-nil. Any non-2xx status |
| // code is an error. Response headers are in either |
| // *Bucket.ServerResponse.Header or (if a response was returned at all) |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to |
| // check whether the returned error was because http.StatusNotModified |
| // was returned. |
| func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &Bucket{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Returns metadata for the specified bucket.", |
| // "httpMethod": "GET", |
| // "id": "storage.buckets.get", |
| // "parameterOrder": [ |
| // "bucket" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "ifMetagenerationMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "ifMetagenerationNotMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "projection": { |
| // "description": "Set of properties to return. Defaults to noAcl.", |
| // "enum": [ |
| // "full", |
| // "noAcl" |
| // ], |
| // "enumDescriptions": [ |
| // "Include all properties.", |
| // "Omit acl and defaultObjectAcl properties." |
| // ], |
| // "location": "query", |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}", |
| // "response": { |
| // "$ref": "Bucket" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_only", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.buckets.insert": |
| |
| type BucketsInsertCall struct { |
| s *Service |
| bucket *Bucket |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Insert: Creates a new bucket. |
| func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall { |
| c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.urlParams_.Set("project", projectid) |
| c.bucket = bucket |
| return c |
| } |
| |
| // Projection sets the optional parameter "projection": Set of |
| // properties to return. Defaults to noAcl, unless the bucket resource |
| // specifies acl or defaultObjectAcl properties, when it defaults to |
| // full. |
| // |
| // Possible values: |
| // "full" - Include all properties. |
| // "noAcl" - Omit acl and defaultObjectAcl properties. |
| func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall { |
| c.urlParams_.Set("projection", projection) |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketsInsertCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("POST", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.buckets.insert" call. |
| // Exactly one of *Bucket or error will be non-nil. Any non-2xx status |
| // code is an error. Response headers are in either |
| // *Bucket.ServerResponse.Header or (if a response was returned at all) |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to |
| // check whether the returned error was because http.StatusNotModified |
| // was returned. |
| func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &Bucket{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Creates a new bucket.", |
| // "httpMethod": "POST", |
| // "id": "storage.buckets.insert", |
| // "parameterOrder": [ |
| // "project" |
| // ], |
| // "parameters": { |
| // "project": { |
| // "description": "A valid API project identifier.", |
| // "location": "query", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "projection": { |
| // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", |
| // "enum": [ |
| // "full", |
| // "noAcl" |
| // ], |
| // "enumDescriptions": [ |
| // "Include all properties.", |
| // "Omit acl and defaultObjectAcl properties." |
| // ], |
| // "location": "query", |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b", |
| // "request": { |
| // "$ref": "Bucket" |
| // }, |
| // "response": { |
| // "$ref": "Bucket" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.buckets.list": |
| |
| type BucketsListCall struct { |
| s *Service |
| urlParams_ gensupport.URLParams |
| ifNoneMatch_ string |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // List: Retrieves a list of buckets for a given project. |
| func (r *BucketsService) List(projectid string) *BucketsListCall { |
| c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.urlParams_.Set("project", projectid) |
| return c |
| } |
| |
| // MaxResults sets the optional parameter "maxResults": Maximum number |
| // of buckets to return. |
| func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall { |
| c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) |
| return c |
| } |
| |
| // PageToken sets the optional parameter "pageToken": A |
| // previously-returned page token representing part of the larger set of |
| // results to view. |
| func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall { |
| c.urlParams_.Set("pageToken", pageToken) |
| return c |
| } |
| |
| // Projection sets the optional parameter "projection": Set of |
| // properties to return. Defaults to noAcl. |
| // |
| // Possible values: |
| // "full" - Include all properties. |
| // "noAcl" - Omit acl and defaultObjectAcl properties. |
| func (c *BucketsListCall) Projection(projection string) *BucketsListCall { |
| c.urlParams_.Set("projection", projection) |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // IfNoneMatch sets the optional parameter which makes the operation |
| // fail if the object's ETag matches the given value. This is useful for |
| // getting updates only after the object has changed since the last |
| // request. Use googleapi.IsNotModified to check whether the response |
| // error from Do is the result of In-None-Match. |
| func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall { |
| c.ifNoneMatch_ = entityTag |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketsListCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| if c.ifNoneMatch_ != "" { |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| } |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("GET", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.buckets.list" call. |
| // Exactly one of *Buckets or error will be non-nil. Any non-2xx status |
| // code is an error. Response headers are in either |
| // *Buckets.ServerResponse.Header or (if a response was returned at all) |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to |
| // check whether the returned error was because http.StatusNotModified |
| // was returned. |
| func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &Buckets{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Retrieves a list of buckets for a given project.", |
| // "httpMethod": "GET", |
| // "id": "storage.buckets.list", |
| // "parameterOrder": [ |
| // "project" |
| // ], |
| // "parameters": { |
| // "maxResults": { |
| // "description": "Maximum number of buckets to return.", |
| // "format": "uint32", |
| // "location": "query", |
| // "minimum": "0", |
| // "type": "integer" |
| // }, |
| // "pageToken": { |
| // "description": "A previously-returned page token representing part of the larger set of results to view.", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "project": { |
| // "description": "A valid API project identifier.", |
| // "location": "query", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "projection": { |
| // "description": "Set of properties to return. Defaults to noAcl.", |
| // "enum": [ |
| // "full", |
| // "noAcl" |
| // ], |
| // "enumDescriptions": [ |
| // "Include all properties.", |
| // "Omit acl and defaultObjectAcl properties." |
| // ], |
| // "location": "query", |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b", |
| // "response": { |
| // "$ref": "Buckets" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_only", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // Pages invokes f for each page of results. |
| // A non-nil error returned from f will halt the iteration. |
| // The provided context supersedes any context provided to the Context method. |
| func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error { |
| c.ctx_ = ctx |
| defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point |
| for { |
| x, err := c.Do() |
| if err != nil { |
| return err |
| } |
| if err := f(x); err != nil { |
| return err |
| } |
| if x.NextPageToken == "" { |
| return nil |
| } |
| c.PageToken(x.NextPageToken) |
| } |
| } |
| |
| // method id "storage.buckets.patch": |
| |
| type BucketsPatchCall struct { |
| s *Service |
| bucket string |
| bucket2 *Bucket |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Patch: Updates a bucket. This method supports patch semantics. |
| func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall { |
| c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.bucket2 = bucket2 |
| return c |
| } |
| |
| // IfMetagenerationMatch sets the optional parameter |
| // "ifMetagenerationMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration matches |
| // the given value. |
| func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsPatchCall { |
| c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) |
| return c |
| } |
| |
| // IfMetagenerationNotMatch sets the optional parameter |
| // "ifMetagenerationNotMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration does not |
| // match the given value. |
| func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsPatchCall { |
| c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) |
| return c |
| } |
| |
| // Projection sets the optional parameter "projection": Set of |
| // properties to return. Defaults to full. |
| // |
| // Possible values: |
| // "full" - Include all properties. |
| // "noAcl" - Omit acl and defaultObjectAcl properties. |
| func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall { |
| c.urlParams_.Set("projection", projection) |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketsPatchCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("PATCH", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.buckets.patch" call. |
| // Exactly one of *Bucket or error will be non-nil. Any non-2xx status |
| // code is an error. Response headers are in either |
| // *Bucket.ServerResponse.Header or (if a response was returned at all) |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to |
| // check whether the returned error was because http.StatusNotModified |
| // was returned. |
| func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &Bucket{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Updates a bucket. This method supports patch semantics.", |
| // "httpMethod": "PATCH", |
| // "id": "storage.buckets.patch", |
| // "parameterOrder": [ |
| // "bucket" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "ifMetagenerationMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "ifMetagenerationNotMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "projection": { |
| // "description": "Set of properties to return. Defaults to full.", |
| // "enum": [ |
| // "full", |
| // "noAcl" |
| // ], |
| // "enumDescriptions": [ |
| // "Include all properties.", |
| // "Omit acl and defaultObjectAcl properties." |
| // ], |
| // "location": "query", |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}", |
| // "request": { |
| // "$ref": "Bucket" |
| // }, |
| // "response": { |
| // "$ref": "Bucket" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.buckets.update": |
| |
| type BucketsUpdateCall struct { |
| s *Service |
| bucket string |
| bucket2 *Bucket |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Update: Updates a bucket. |
| func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall { |
| c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.bucket2 = bucket2 |
| return c |
| } |
| |
| // IfMetagenerationMatch sets the optional parameter |
| // "ifMetagenerationMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration matches |
| // the given value. |
| func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsUpdateCall { |
| c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch)) |
| return c |
| } |
| |
| // IfMetagenerationNotMatch sets the optional parameter |
| // "ifMetagenerationNotMatch": Makes the return of the bucket metadata |
| // conditional on whether the bucket's current metageneration does not |
| // match the given value. |
| func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsUpdateCall { |
| c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch)) |
| return c |
| } |
| |
| // Projection sets the optional parameter "projection": Set of |
| // properties to return. Defaults to full. |
| // |
| // Possible values: |
| // "full" - Include all properties. |
| // "noAcl" - Omit acl and defaultObjectAcl properties. |
| func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall { |
| c.urlParams_.Set("projection", projection) |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *BucketsUpdateCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("PUT", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.buckets.update" call. |
| // Exactly one of *Bucket or error will be non-nil. Any non-2xx status |
| // code is an error. Response headers are in either |
| // *Bucket.ServerResponse.Header or (if a response was returned at all) |
| // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to |
| // check whether the returned error was because http.StatusNotModified |
| // was returned. |
| func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &Bucket{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Updates a bucket.", |
| // "httpMethod": "PUT", |
| // "id": "storage.buckets.update", |
| // "parameterOrder": [ |
| // "bucket" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "ifMetagenerationMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "ifMetagenerationNotMatch": { |
| // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", |
| // "format": "uint64", |
| // "location": "query", |
| // "type": "string" |
| // }, |
| // "projection": { |
| // "description": "Set of properties to return. Defaults to full.", |
| // "enum": [ |
| // "full", |
| // "noAcl" |
| // ], |
| // "enumDescriptions": [ |
| // "Include all properties.", |
| // "Omit acl and defaultObjectAcl properties." |
| // ], |
| // "location": "query", |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}", |
| // "request": { |
| // "$ref": "Bucket" |
| // }, |
| // "response": { |
| // "$ref": "Bucket" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.channels.stop": |
| |
| type ChannelsStopCall struct { |
| s *Service |
| channel *Channel |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Stop: Stop watching resources through this channel |
| func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { |
| c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.channel = channel |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *ChannelsStopCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) |
| if err != nil { |
| return nil, err |
| } |
| reqHeaders.Set("Content-Type", "application/json") |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("POST", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.channels.stop" call. |
| func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if err != nil { |
| return err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return err |
| } |
| return nil |
| // { |
| // "description": "Stop watching resources through this channel", |
| // "httpMethod": "POST", |
| // "id": "storage.channels.stop", |
| // "path": "channels/stop", |
| // "request": { |
| // "$ref": "Channel", |
| // "parameterName": "resource" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control", |
| // "https://www.googleapis.com/auth/devstorage.read_only", |
| // "https://www.googleapis.com/auth/devstorage.read_write" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.defaultObjectAccessControls.delete": |
| |
| type DefaultObjectAccessControlsDeleteCall struct { |
| s *Service |
| bucket string |
| entity string |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Delete: Permanently deletes the default object ACL entry for the |
| // specified entity on the specified bucket. |
| func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall { |
| c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.entity = entity |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("DELETE", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| "entity": c.entity, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.defaultObjectAccessControls.delete" call. |
| func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if err != nil { |
| return err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return err |
| } |
| return nil |
| // { |
| // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", |
| // "httpMethod": "DELETE", |
| // "id": "storage.defaultObjectAccessControls.delete", |
| // "parameterOrder": [ |
| // "bucket", |
| // "entity" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "entity": { |
| // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/defaultObjectAcl/{entity}", |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.defaultObjectAccessControls.get": |
| |
| type DefaultObjectAccessControlsGetCall struct { |
| s *Service |
| bucket string |
| entity string |
| urlParams_ gensupport.URLParams |
| ifNoneMatch_ string |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Get: Returns the default object ACL entry for the specified entity on |
| // the specified bucket. |
| func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall { |
| c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.entity = entity |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // IfNoneMatch sets the optional parameter which makes the operation |
| // fail if the object's ETag matches the given value. This is useful for |
| // getting updates only after the object has changed since the last |
| // request. Use googleapi.IsNotModified to check whether the response |
| // error from Do is the result of In-None-Match. |
| func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall { |
| c.ifNoneMatch_ = entityTag |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| // Header returns an http.Header that can be modified by the caller to |
| // add HTTP headers to the request. |
| func (c *DefaultObjectAccessControlsGetCall) Header() http.Header { |
| if c.header_ == nil { |
| c.header_ = make(http.Header) |
| } |
| return c.header_ |
| } |
| |
| func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { |
| reqHeaders := make(http.Header) |
| reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200708") |
| for k, v := range c.header_ { |
| reqHeaders[k] = v |
| } |
| reqHeaders.Set("User-Agent", c.s.userAgent()) |
| if c.ifNoneMatch_ != "" { |
| reqHeaders.Set("If-None-Match", c.ifNoneMatch_) |
| } |
| var body io.Reader = nil |
| c.urlParams_.Set("alt", alt) |
| c.urlParams_.Set("prettyPrint", "false") |
| urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") |
| urls += "?" + c.urlParams_.Encode() |
| req, err := http.NewRequest("GET", urls, body) |
| if err != nil { |
| return nil, err |
| } |
| req.Header = reqHeaders |
| googleapi.Expand(req.URL, map[string]string{ |
| "bucket": c.bucket, |
| "entity": c.entity, |
| }) |
| return gensupport.SendRequest(c.ctx_, c.s.client, req) |
| } |
| |
| // Do executes the "storage.defaultObjectAccessControls.get" call. |
| // Exactly one of *ObjectAccessControl or error will be non-nil. Any |
| // non-2xx status code is an error. Response headers are in either |
| // *ObjectAccessControl.ServerResponse.Header or (if a response was |
| // returned at all) in error.(*googleapi.Error).Header. Use |
| // googleapi.IsNotModified to check whether the returned error was |
| // because http.StatusNotModified was returned. |
| func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) { |
| gensupport.SetOptions(c.urlParams_, opts...) |
| res, err := c.doRequest("json") |
| if res != nil && res.StatusCode == http.StatusNotModified { |
| if res.Body != nil { |
| res.Body.Close() |
| } |
| return nil, &googleapi.Error{ |
| Code: res.StatusCode, |
| Header: res.Header, |
| } |
| } |
| if err != nil { |
| return nil, err |
| } |
| defer googleapi.CloseBody(res) |
| if err := googleapi.CheckResponse(res); err != nil { |
| return nil, err |
| } |
| ret := &ObjectAccessControl{ |
| ServerResponse: googleapi.ServerResponse{ |
| Header: res.Header, |
| HTTPStatusCode: res.StatusCode, |
| }, |
| } |
| target := &ret |
| if err := gensupport.DecodeResponse(target, res); err != nil { |
| return nil, err |
| } |
| return ret, nil |
| // { |
| // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", |
| // "httpMethod": "GET", |
| // "id": "storage.defaultObjectAccessControls.get", |
| // "parameterOrder": [ |
| // "bucket", |
| // "entity" |
| // ], |
| // "parameters": { |
| // "bucket": { |
| // "description": "Name of a bucket.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // }, |
| // "entity": { |
| // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", |
| // "location": "path", |
| // "required": true, |
| // "type": "string" |
| // } |
| // }, |
| // "path": "b/{bucket}/defaultObjectAcl/{entity}", |
| // "response": { |
| // "$ref": "ObjectAccessControl" |
| // }, |
| // "scopes": [ |
| // "https://www.googleapis.com/auth/devstorage.full_control" |
| // ] |
| // } |
| |
| } |
| |
| // method id "storage.defaultObjectAccessControls.insert": |
| |
| type DefaultObjectAccessControlsInsertCall struct { |
| s *Service |
| bucket string |
| objectaccesscontrol *ObjectAccessControl |
| urlParams_ gensupport.URLParams |
| ctx_ context.Context |
| header_ http.Header |
| } |
| |
| // Insert: Creates a new default object ACL entry on the specified |
| // bucket. |
| func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall { |
| c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
| c.bucket = bucket |
| c.objectaccesscontrol = objectaccesscontrol |
| return c |
| } |
| |
| // Fields allows partial responses to be retrieved. See |
| // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse |
| // for more information. |
| func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall { |
| c.urlParams_.Set("fields", googleapi.CombineFields(s)) |
| return c |
| } |
| |
| // Context sets the context to be used in this call's Do method. Any |
| // pending HTTP request will be aborted if the provided context is |
| // canceled. |
| func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall { |
| c.ctx_ = ctx |
| return c |
| } |
| |
| |