Documentation ¶
Overview ¶
Package firebasestorage provides access to the Cloud Storage for Firebase API.
For product documentation, see: https://firebase.google.com/docs/storage
Creating a client ¶
Usage example:
import "google.golang.org/api/firebasestorage/v1beta" ... ctx := context.Background() firebasestorageService, err := firebasestorage.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:
firebasestorageService, err := firebasestorage.NewService(ctx, option.WithScopes(firebasestorage.FirebaseScope))
To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
firebasestorageService, err := firebasestorage.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, ...) firebasestorageService, err := firebasestorage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See https://godoc.org/google.golang.org/api/option/ for details on options.
Index ¶
- Constants
- type AddFirebaseRequest
- type Bucket
- type Empty
- type ListBucketsResponse
- type ProjectsBucketsAddFirebaseCall
- func (c *ProjectsBucketsAddFirebaseCall) Context(ctx context.Context) *ProjectsBucketsAddFirebaseCall
- func (c *ProjectsBucketsAddFirebaseCall) Do(opts ...googleapi.CallOption) (*Bucket, error)
- func (c *ProjectsBucketsAddFirebaseCall) Fields(s ...googleapi.Field) *ProjectsBucketsAddFirebaseCall
- func (c *ProjectsBucketsAddFirebaseCall) Header() http.Header
- type ProjectsBucketsGetCall
- func (c *ProjectsBucketsGetCall) Context(ctx context.Context) *ProjectsBucketsGetCall
- func (c *ProjectsBucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error)
- func (c *ProjectsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsBucketsGetCall
- func (c *ProjectsBucketsGetCall) Header() http.Header
- func (c *ProjectsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsBucketsGetCall
- type ProjectsBucketsListCall
- func (c *ProjectsBucketsListCall) Context(ctx context.Context) *ProjectsBucketsListCall
- func (c *ProjectsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error)
- func (c *ProjectsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsBucketsListCall
- func (c *ProjectsBucketsListCall) Header() http.Header
- func (c *ProjectsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsBucketsListCall
- func (c *ProjectsBucketsListCall) PageSize(pageSize int64) *ProjectsBucketsListCall
- func (c *ProjectsBucketsListCall) PageToken(pageToken string) *ProjectsBucketsListCall
- func (c *ProjectsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error
- type ProjectsBucketsRemoveFirebaseCall
- func (c *ProjectsBucketsRemoveFirebaseCall) Context(ctx context.Context) *ProjectsBucketsRemoveFirebaseCall
- func (c *ProjectsBucketsRemoveFirebaseCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *ProjectsBucketsRemoveFirebaseCall) Fields(s ...googleapi.Field) *ProjectsBucketsRemoveFirebaseCall
- func (c *ProjectsBucketsRemoveFirebaseCall) Header() http.Header
- type ProjectsBucketsService
- func (r *ProjectsBucketsService) AddFirebase(bucket string, addfirebaserequest *AddFirebaseRequest) *ProjectsBucketsAddFirebaseCall
- func (r *ProjectsBucketsService) Get(name string) *ProjectsBucketsGetCall
- func (r *ProjectsBucketsService) List(parent string) *ProjectsBucketsListCall
- func (r *ProjectsBucketsService) RemoveFirebase(bucket string, removefirebaserequest *RemoveFirebaseRequest) *ProjectsBucketsRemoveFirebaseCall
- type ProjectsService
- type RemoveFirebaseRequest
- type Service
Constants ¶
const ( // See, edit, configure, and delete your Google Cloud Platform data CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" // View and administer all your Firebase data and settings FirebaseScope = "https://www.googleapis.com/auth/firebase" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddFirebaseRequest ¶
type AddFirebaseRequest struct { }
AddFirebaseRequest: The request used to link a Google Cloud Storage bucket to a Firebase project.
type Bucket ¶
type Bucket struct { // Name: Resource name of the bucket. Name string `json:"name,omitempty"` // Reconciling: Output only. Represents whether a bucket is being moved // to a new location, in which case reconciling is set to true. Reconciling bool `json:"reconciling,omitempty"` // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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:"-"` }
Bucket: A storage bucket and its relation to a parent Firebase project.
func (*Bucket) MarshalJSON ¶
type Empty ¶
type Empty struct { // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` }
Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
type ListBucketsResponse ¶
type ListBucketsResponse struct { // Buckets: The list of linked buckets. Buckets []*Bucket `json:"buckets,omitempty"` // NextPageToken: A token that can be sent as `page_token` to retrieve // the next page. If this field is omitted, there are no subsequent // pages. 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. "Buckets") 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. "Buckets") 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:"-"` }
ListBucketsResponse: The response returned by `ListBuckets`.
func (*ListBucketsResponse) MarshalJSON ¶
func (s *ListBucketsResponse) MarshalJSON() ([]byte, error)
type ProjectsBucketsAddFirebaseCall ¶
type ProjectsBucketsAddFirebaseCall struct {
// contains filtered or unexported fields
}
func (*ProjectsBucketsAddFirebaseCall) Context ¶
func (c *ProjectsBucketsAddFirebaseCall) Context(ctx context.Context) *ProjectsBucketsAddFirebaseCall
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 (*ProjectsBucketsAddFirebaseCall) Do ¶
func (c *ProjectsBucketsAddFirebaseCall) Do(opts ...googleapi.CallOption) (*Bucket, error)
Do executes the "firebasestorage.projects.buckets.addFirebase" 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 (*ProjectsBucketsAddFirebaseCall) Fields ¶
func (c *ProjectsBucketsAddFirebaseCall) Fields(s ...googleapi.Field) *ProjectsBucketsAddFirebaseCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsBucketsAddFirebaseCall) Header ¶
func (c *ProjectsBucketsAddFirebaseCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type ProjectsBucketsGetCall ¶
type ProjectsBucketsGetCall struct {
// contains filtered or unexported fields
}
func (*ProjectsBucketsGetCall) Context ¶
func (c *ProjectsBucketsGetCall) Context(ctx context.Context) *ProjectsBucketsGetCall
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 (*ProjectsBucketsGetCall) Do ¶
func (c *ProjectsBucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error)
Do executes the "firebasestorage.projects.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 (*ProjectsBucketsGetCall) Fields ¶
func (c *ProjectsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsBucketsGetCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsBucketsGetCall) Header ¶
func (c *ProjectsBucketsGetCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*ProjectsBucketsGetCall) IfNoneMatch ¶
func (c *ProjectsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsBucketsGetCall
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.
type ProjectsBucketsListCall ¶
type ProjectsBucketsListCall struct {
// contains filtered or unexported fields
}
func (*ProjectsBucketsListCall) Context ¶
func (c *ProjectsBucketsListCall) Context(ctx context.Context) *ProjectsBucketsListCall
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 (*ProjectsBucketsListCall) Do ¶
func (c *ProjectsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error)
Do executes the "firebasestorage.projects.buckets.list" call. Exactly one of *ListBucketsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListBucketsResponse.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 (*ProjectsBucketsListCall) Fields ¶
func (c *ProjectsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsBucketsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsBucketsListCall) Header ¶
func (c *ProjectsBucketsListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*ProjectsBucketsListCall) IfNoneMatch ¶
func (c *ProjectsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsBucketsListCall
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 (*ProjectsBucketsListCall) PageSize ¶
func (c *ProjectsBucketsListCall) PageSize(pageSize int64) *ProjectsBucketsListCall
PageSize sets the optional parameter "pageSize": The maximum number of buckets to return. If not set, the server will use a reasonable default.
func (*ProjectsBucketsListCall) PageToken ¶
func (c *ProjectsBucketsListCall) PageToken(pageToken string) *ProjectsBucketsListCall
PageToken sets the optional parameter "pageToken": A page token, received from a previous `ListBuckets` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListBuckets` must match the call that provided the page token.
func (*ProjectsBucketsListCall) Pages ¶
func (c *ProjectsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error
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.
type ProjectsBucketsRemoveFirebaseCall ¶
type ProjectsBucketsRemoveFirebaseCall struct {
// contains filtered or unexported fields
}
func (*ProjectsBucketsRemoveFirebaseCall) Context ¶
func (c *ProjectsBucketsRemoveFirebaseCall) Context(ctx context.Context) *ProjectsBucketsRemoveFirebaseCall
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 (*ProjectsBucketsRemoveFirebaseCall) Do ¶
func (c *ProjectsBucketsRemoveFirebaseCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "firebasestorage.projects.buckets.removeFirebase" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*ProjectsBucketsRemoveFirebaseCall) Fields ¶
func (c *ProjectsBucketsRemoveFirebaseCall) Fields(s ...googleapi.Field) *ProjectsBucketsRemoveFirebaseCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*ProjectsBucketsRemoveFirebaseCall) Header ¶
func (c *ProjectsBucketsRemoveFirebaseCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type ProjectsBucketsService ¶
type ProjectsBucketsService struct {
// contains filtered or unexported fields
}
func NewProjectsBucketsService ¶
func NewProjectsBucketsService(s *Service) *ProjectsBucketsService
func (*ProjectsBucketsService) AddFirebase ¶
func (r *ProjectsBucketsService) AddFirebase(bucket string, addfirebaserequest *AddFirebaseRequest) *ProjectsBucketsAddFirebaseCall
AddFirebase: Links a Google Cloud Storage bucket to a Firebase project.
- bucket: Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket. Because bucket resource names are unique across projects, you may omit the project number, `projects/-/buckets/{bucket_id}`.
func (*ProjectsBucketsService) Get ¶
func (r *ProjectsBucketsService) Get(name string) *ProjectsBucketsGetCall
Get: Gets a single linked storage bucket.
- name: Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket. Because bucket resource names are unique across projects, you may omit the project number, `projects/-/buckets/{bucket_id}`.
func (*ProjectsBucketsService) List ¶
func (r *ProjectsBucketsService) List(parent string) *ProjectsBucketsListCall
List: Lists the linked storage buckets for a project.
- parent: Resource name of the parent Firebase project, `projects/{project_number}`.
func (*ProjectsBucketsService) RemoveFirebase ¶
func (r *ProjectsBucketsService) RemoveFirebase(bucket string, removefirebaserequest *RemoveFirebaseRequest) *ProjectsBucketsRemoveFirebaseCall
RemoveFirebase: Unlinks a linked Google Cloud Storage bucket from a Firebase project.
- bucket: Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket. Because bucket resource names are unique across projects, you may omit the project number, `projects/-/buckets/{bucket_id}`.
type ProjectsService ¶
type ProjectsService struct { Buckets *ProjectsBucketsService // contains filtered or unexported fields }
func NewProjectsService ¶
func NewProjectsService(s *Service) *ProjectsService
type RemoveFirebaseRequest ¶
type RemoveFirebaseRequest struct { }
RemoveFirebaseRequest: The request used to unlink a Google Cloud Storage bucket from a Firebase project.
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Projects *ProjectsService // contains filtered or unexported fields }
func New
deprecated
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 NewService ¶
NewService creates a new Service.