firebasestorage

package
v0.207.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package firebasestorage provides access to the Cloud Storage for Firebase API.

For product documentation, see: https://firebase.google.com/docs/storage

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

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 google.golang.org/api/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 google.golang.org/api/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 google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
firebasestorageService, err := firebasestorage.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (
	// See, edit, configure, and delete your Google Cloud data and see the email
	// address for your Google Account.
	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: Output only. Resource name of the bucket.
	Name string `json:"name,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	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. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Bucket: A storage bucket and its relation to a parent Firebase project.

func (Bucket) MarshalJSON

func (s Bucket) MarshalJSON() ([]byte, error)

type DefaultBucket added in v0.207.0

type DefaultBucket struct {
	// Bucket: Output only. Underlying bucket resource.
	Bucket *Bucket `json:"bucket,omitempty"`
	// Location: Immutable. Location of the default bucket.
	Location string `json:"location,omitempty"`
	// Name: Resource name of the default bucket.
	Name string `json:"name,omitempty"`
	// StorageClass: Immutable. Storage class of the default bucket. Supported
	// values are available at
	// https://cloud.google.com/storage/docs/storage-classes#classes.
	StorageClass string `json:"storageClass,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 or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	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. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

DefaultBucket: Spark tier-eligible Cloud Storage bucket. One per project. This resource exists if the underlying Cloud Storage bucket exists and it is linked to your Firebase project. See https://firebase.google.com/pricing for pricing details.

func (DefaultBucket) MarshalJSON added in v0.207.0

func (s DefaultBucket) MarshalJSON() ([]byte, error)

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); }

type GoogleFirebaseStorageControlplaneV1alphaMigrateLocationDestructivelyMetadata added in v0.51.0

type GoogleFirebaseStorageControlplaneV1alphaMigrateLocationDestructivelyMetadata struct {
	// CreateTime: The time the LRO was created.
	CreateTime string `json:"createTime,omitempty"`
	// LastUpdateTime: The time the LRO was last updated.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`
	// State: The current state of the migration.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - Unspecified state. Should not be used.
	//   "PENDING" - The MigrateLocationDestructively request has passed
	// precondition checks and the bucket migration will begin soon.
	//   "CREATING_TEMP_BUCKET" - Generating a unique bucket name, storing the
	// source -> temp mapping in Spanner, and actually creating the temporary
	// bucket via Bigstore.
	//   "TRANSFERRING_TO_TEMP" - The first STS transfer to move all objects from
	// the source bucket to the temp bucket is underway.
	//   "DELETING_SOURCE_BUCKET" - The source bucket is being emptied and deleted.
	//   "CREATING_DESTINATION_BUCKET" - The source bucket is being recreated in
	// the new location.
	//   "TRANSFERRING_TO_DESTINATION" - The second STS transfer to move all
	// objects from the temp bucket to the final bucket is underway.
	//   "DELETING_TEMP_BUCKET" - The temp bucket is being emptied and deleted.
	//   "SUCCEEDED" - All stages of the migration have completed and the operation
	// has been marked done and updated with a response.
	//   "FAILED" - The migration failed at some stage and it is not possible to
	// continue retrying that stage. Manual recovery may be needed. Rollback is
	// either impossible at this stage, or has been attempted and failed.
	//   "ROLLING_BACK" - The migration has encountered a permanent failure and is
	// now being rolled back so that the source bucket is restored to its original
	// state.
	//   "ROLLED_BACK" - The migration has been successfully rolled back.
	State string `json:"state,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateTime") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleFirebaseStorageControlplaneV1alphaMigrateLocationDestructivelyMetadata:

Metadata for MigrateLocationDestructively LRO.

func (GoogleFirebaseStorageControlplaneV1alphaMigrateLocationDestructivelyMetadata) MarshalJSON added in v0.51.0

type GoogleFirebaseStorageControlplaneV1betaMigrateLocationDestructivelyMetadata added in v0.51.0

type GoogleFirebaseStorageControlplaneV1betaMigrateLocationDestructivelyMetadata struct {
	// CreateTime: The time the LRO was created.
	CreateTime string `json:"createTime,omitempty"`
	// LastUpdateTime: The time the LRO was last updated.
	LastUpdateTime string `json:"lastUpdateTime,omitempty"`
	// State: The current state of the migration.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - Unspecified state. Should not be used.
	//   "PENDING" - The MigrateLocationDestructively request has passed
	// precondition checks and the bucket migration will begin soon.
	//   "CREATING_TEMP_BUCKET" - Generating a unique bucket name, storing the
	// source -> temp mapping in Spanner, and actually creating the temporary
	// bucket via Bigstore.
	//   "TRANSFERRING_TO_TEMP" - The first STS transfer to move all objects from
	// the source bucket to the temp bucket is underway.
	//   "DELETING_SOURCE_BUCKET" - The source bucket is being emptied and deleted.
	//   "CREATING_DESTINATION_BUCKET" - The source bucket is being recreated in
	// the new location.
	//   "TRANSFERRING_TO_DESTINATION" - The second STS transfer to move all
	// objects from the temp bucket to the final bucket is underway.
	//   "DELETING_TEMP_BUCKET" - The temp bucket is being emptied and deleted.
	//   "SUCCEEDED" - All stages of the migration have completed and the operation
	// has been marked done and updated with a response.
	//   "FAILED" - The migration failed at some stage and it is not possible to
	// continue retrying that stage. Manual recovery may be needed. Rollback is
	// either impossible at this stage, or has been attempted and failed.
	//   "ROLLING_BACK" - The migration has encountered a permanent failure and is
	// now being rolled back so that the source bucket is restored to its original
	// state.
	//   "ROLLED_BACK" - The migration has been successfully rolled back.
	State string `json:"state,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateTime") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleFirebaseStorageControlplaneV1betaMigrateLocationDestructivelyMetadata: Metadata for MigrateLocationDestructively LRO.

func (GoogleFirebaseStorageControlplaneV1betaMigrateLocationDestructivelyMetadata) MarshalJSON added in v0.51.0

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 or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	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. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	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

Context sets the context to be used in this call's Do method.

func (*ProjectsBucketsAddFirebaseCall) Do

Do executes the "firebasestorage.projects.buckets.addFirebase" call. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsBucketsAddFirebaseCall) Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type ProjectsBucketsGetCall

type ProjectsBucketsGetCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsBucketsGetCall) Context

Context sets the context to be used in this call's Do method.

func (*ProjectsBucketsGetCall) Do

Do executes the "firebasestorage.projects.buckets.get" call. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsBucketsGetCall) Header

func (c *ProjectsBucketsGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*ProjectsBucketsGetCall) IfNoneMatch

func (c *ProjectsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsBucketsGetCall

IfNoneMatch sets an 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.

type ProjectsBucketsListCall

type ProjectsBucketsListCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsBucketsListCall) Context

Context sets the context to be used in this call's Do method.

func (*ProjectsBucketsListCall) Do

Do executes the "firebasestorage.projects.buckets.list" call. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsBucketsListCall) Header

func (c *ProjectsBucketsListCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*ProjectsBucketsListCall) IfNoneMatch

func (c *ProjectsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsBucketsListCall

IfNoneMatch sets an 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.

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

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

Context sets the context to be used in this call's Do method.

func (*ProjectsBucketsRemoveFirebaseCall) Do

Do executes the "firebasestorage.projects.buckets.removeFirebase" call. 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

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsBucketsRemoveFirebaseCall) Header

Header returns a http.Header that can be modified by the caller to add 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, `projects/{project_id_or_number}/buckets/{bucket_id}`.

func (*ProjectsBucketsService) Get

Get: Gets a single linked storage bucket.

  • name: Resource name of the bucket, mirrors the ID of the underlying Google Cloud Storage bucket, `projects/{project_id_or_number}/buckets/{bucket_id}`.

func (*ProjectsBucketsService) List

List: Lists the linked storage buckets for a project.

  • parent: Resource name of the parent Firebase project, `projects/{project_id_or_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, `projects/{project_id_or_number}/buckets/{bucket_id}`.

type ProjectsDefaultBucketCreateCall added in v0.207.0

type ProjectsDefaultBucketCreateCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsDefaultBucketCreateCall) Context added in v0.207.0

Context sets the context to be used in this call's Do method.

func (*ProjectsDefaultBucketCreateCall) Do added in v0.207.0

Do executes the "firebasestorage.projects.defaultBucket.create" call. Any non-2xx status code is an error. Response headers are in either *DefaultBucket.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 (*ProjectsDefaultBucketCreateCall) Fields added in v0.207.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsDefaultBucketCreateCall) Header added in v0.207.0

Header returns a http.Header that can be modified by the caller to add headers to the request.

type ProjectsDefaultBucketService added in v0.207.0

type ProjectsDefaultBucketService struct {
	// contains filtered or unexported fields
}

func NewProjectsDefaultBucketService added in v0.207.0

func NewProjectsDefaultBucketService(s *Service) *ProjectsDefaultBucketService

func (*ProjectsDefaultBucketService) Create added in v0.207.0

Create: Creates a Spark tier-eligible Cloud Storage bucket and links it to your Firebase project. If the default bucket already exists, this method will re-link it to your Firebase project. See https://firebase.google.com/pricing for pricing details.

  • parent: The parent resource where the default bucket will be created, `projects/{project_id_or_number}`.

type ProjectsDeleteDefaultBucketCall added in v0.207.0

type ProjectsDeleteDefaultBucketCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsDeleteDefaultBucketCall) Context added in v0.207.0

Context sets the context to be used in this call's Do method.

func (*ProjectsDeleteDefaultBucketCall) Do added in v0.207.0

Do executes the "firebasestorage.projects.deleteDefaultBucket" call. 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 (*ProjectsDeleteDefaultBucketCall) Fields added in v0.207.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsDeleteDefaultBucketCall) Header added in v0.207.0

Header returns a http.Header that can be modified by the caller to add headers to the request.

type ProjectsGetDefaultBucketCall added in v0.207.0

type ProjectsGetDefaultBucketCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsGetDefaultBucketCall) Context added in v0.207.0

Context sets the context to be used in this call's Do method.

func (*ProjectsGetDefaultBucketCall) Do added in v0.207.0

Do executes the "firebasestorage.projects.getDefaultBucket" call. Any non-2xx status code is an error. Response headers are in either *DefaultBucket.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 (*ProjectsGetDefaultBucketCall) Fields added in v0.207.0

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ProjectsGetDefaultBucketCall) Header added in v0.207.0

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*ProjectsGetDefaultBucketCall) IfNoneMatch added in v0.207.0

IfNoneMatch sets an 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.

type ProjectsService

type ProjectsService struct {
	Buckets *ProjectsBucketsService

	DefaultBucket *ProjectsDefaultBucketService
	// contains filtered or unexported fields
}

func NewProjectsService

func NewProjectsService(s *Service) *ProjectsService

func (*ProjectsService) DeleteDefaultBucket added in v0.207.0

func (r *ProjectsService) DeleteDefaultBucket(name string) *ProjectsDeleteDefaultBucketCall

DeleteDefaultBucket: Unlinks and deletes the default bucket.

  • name: The name of the default bucket to delete, `projects/{project_id_or_number}/defaultBucket`.

func (*ProjectsService) GetDefaultBucket added in v0.207.0

func (r *ProjectsService) GetDefaultBucket(name string) *ProjectsGetDefaultBucketCall

GetDefaultBucket: Gets the default bucket.

  • name: The name of the default bucket to retrieve, `projects/{project_id_or_number}/defaultBucket`.

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

func New(client *http.Client) (*Service, error)

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

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL