google_cloud_storage/signed_url.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Types related to the signed URL feature. See [SignedUrlBuilder][crate::builder::storage::SignedUrlBuilder].
16
17/// Formatting style for signed URLs.
18///
19/// There are several equivalent formats for signed URLs, see the [resource path] docs for more information.
20///
21/// [resource path]: https://docs.cloud.google.com/storage/docs/authentication/canonical-requests#about-resource-path
22#[derive(Debug, Clone, Copy, Default)]
23#[allow(clippy::exhaustive_enums)]
24pub enum UrlStyle {
25 /// Path style URL: `https://storage.googleapis.com/bucket/object`.
26 ///
27 /// This is the default style.
28 #[default]
29 PathStyle,
30
31 /// Bucket bound hostname URL: `https://bucket-name/object`.
32 ///
33 /// This style is used when you have a CNAME alias for your bucket.
34 BucketBoundHostname,
35
36 /// Virtual hosted style URL: `https://bucket.storage.googleapis.com/object`.
37 VirtualHostedStyle,
38}