### GET /intelligent-tiering-configurations/{bucket} Source: https://docs.rs/s3s/latest/s3s/trait Lists Intelligent-Tiering configurations for a bucket. ```APIDOC ## GET /intelligent-tiering-configurations/{bucket} ### Description Lists Intelligent-Tiering configurations for a specified S3 bucket. ### Method GET ### Endpoint `/intelligent-tiering-configurations/{bucket}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket for which to list Intelligent-Tiering configurations. #### Query Parameters - **continuation-token** (string) - Optional - Used for paginating through a large number of configurations. ### Request Example ```json { "example": "GET /intelligent-tiering-configurations/my-bucket?continuation-token=xyz HTTP/1.1" } ``` ### Response #### Success Response (200) - **intelligentTieringConfigurationList** (array) - **id** (string) - The ID of the Intelligent-Tiering configuration. - **enabled** (boolean) - Indicates if the configuration is enabled. - **tiering** (object) - Configuration for intelligent tiering. - **continuationToken** (string) - Token to retrieve the next page of results. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"intelligentTieringConfigurationList\": [ { \"id\": \"tier1\", \"enabled\": true, \"tiering\": {} } ], \"continuationToken\": \"abc\" }" } ``` ``` -------------------------------- ### GET /inventoryConfigurations/{bucket} Source: https://docs.rs/s3s/latest/s3s/trait Lists inventory configurations for a bucket. ```APIDOC ## GET /inventoryConfigurations/{bucket} ### Description Lists inventory configurations for a specified S3 bucket, which define inventory reports for objects. ### Method GET ### Endpoint `/inventoryConfigurations/{bucket}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket for which to list inventory configurations. #### Query Parameters - **continuation-token** (string) - Optional - Used for paginating through a large number of configurations. ### Request Example ```json { "example": "GET /inventoryConfigurations/my-bucket?continuation-token=xyz HTTP/1.1" } ``` ### Response #### Success Response (200) - **inventoryConfigurationList** (array) - **id** (string) - The ID of the inventory configuration. - **enabled** (boolean) - Indicates if the configuration is enabled. - **schedule** (object) - Schedule for generating inventory reports. - **continuationToken** (string) - Token to retrieve the next page of results. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"inventoryConfigurationList\": [ { \"id\": \"inv1\", \"enabled\": true, \"schedule\": {} } ], \"continuationToken\": \"abc\" }" } ``` ``` -------------------------------- ### GET /metricsConfigurations/{bucket} Source: https://docs.rs/s3s/latest/s3s/trait Lists metrics configurations for a bucket. ```APIDOC ## GET /metricsConfigurations/{bucket} ### Description Lists metrics configurations for a specified S3 bucket, which control S3 Storage Lens metrics. ### Method GET ### Endpoint `/metricsConfigurations/{bucket}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket for which to list metrics configurations. #### Query Parameters - **continuation-token** (string) - Optional - Used for paginating through a large number of configurations. ### Request Example ```json { "example": "GET /metricsConfigurations/my-bucket?continuation-token=xyz HTTP/1.1" } ``` ### Response #### Success Response (200) - **metricsConfigurationList** (array) - **id** (string) - The ID of the metrics configuration. - **enabled** (boolean) - Indicates if the configuration is enabled. - **continuationToken** (string) - Token to retrieve the next page of results. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"metricsConfigurationList\": [ { \"id\": \"metrics1\", \"enabled\": true } ], \"continuationToken\": \"abc\" }" } ``` ``` -------------------------------- ### GET /analyticsConfigurations/{bucket} Source: https://docs.rs/s3s/latest/s3s/trait Lists analytics configurations for a bucket. ```APIDOC ## GET /analyticsConfigurations/{bucket} ### Description Lists analytics configurations associated with a specified S3 bucket. ### Method GET ### Endpoint `/analyticsConfigurations/{bucket}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket for which to list analytics configurations. #### Query Parameters - **continuation-token** (string) - Optional - Used for paginating through a large number of configurations. ### Request Example ```json { "example": "GET /analyticsConfigurations/my-bucket?continuation-token=xyz HTTP/1.1" } ``` ### Response #### Success Response (200) - **analyticsConfigurationList** (array) - **id** (string) - The ID of the analytics configuration. - **enabled** (boolean) - Indicates if the configuration is enabled. - **storageClassAnalysis** (object) - Configuration for storage class analysis. - **continuationToken** (string) - Token to retrieve the next page of results. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"analyticsConfigurationList\": [ { \"id\": \"config1\", \"enabled\": true, \"storageClassAnalysis\": {} } ], \"continuationToken\": \"abc\" }" } ``` ``` -------------------------------- ### GET /bucket/website Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the website configuration for an S3 bucket. This operation is not supported for directory buckets. Requires `S3:GetBucketWebsite` permission. ```APIDOC ## GET /bucket/website ### Description Returns the website configuration for a bucket. This operation is not supported for directory buckets. To host a website on Amazon S3, you can configure a bucket with a website configuration. This GET action requires the `S3:GetBucketWebsite` permission. ### Method GET ### Endpoint `/bucket/website` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **WebsiteConfiguration** (object) - **IndexDocument** (object) - Specifies the index document. - **Suffix** (string) - A suffix that is appended so that you can more easily بإمكانية الوصول إلى المستندات index document. - **ErrorDocument** (object, optional) - Specifies the error document. - **Key** (string) - The object key prefix that identifies the endpoint. #### Response Example ```json { "WebsiteConfiguration": { "IndexDocument": { "Suffix": "index.html" }, "ErrorDocument": { "Key": "error.html" } } } ``` ``` -------------------------------- ### Rust String Creation Methods Source: https://docs.rs/s3s/latest/s3s/dto/type Demonstrates how to create new String instances, including an empty String using `String::new()` and a String with a specified initial capacity using `String::with_capacity()`. `String::new()` is efficient for unknown data sizes, while `with_capacity` helps optimize for known or estimated data sizes to reduce reallocations. ```rust let s = String::new(); ``` ```rust let mut s = String::with_capacity(10); assert_eq!(s.len(), 0); let cap = s.capacity(); for _ in 0..10 { s.push('a'); } assert_eq!(s.capacity(), cap); s.push('a'); ``` -------------------------------- ### Get Byte Slice Reference from String (Rust) Source: https://docs.rs/s3s/latest/s3s/dto/type This example shows how to get an immutable byte slice (`&[u8]`) reference to the UTF-8 encoded contents of a `String`. This is useful for operations that require raw byte access. ```rust let s = String::from("bytes"); let bytes: &[u8] = s.as_ref(); ``` -------------------------------- ### Get Secret Key via S3Auth Trait in Rust Source: https://docs.rs/s3s/latest/s3s/auth/struct Implements the `S3Auth` trait to get the corresponding secret key for a given access key asynchronously. Requires `Send` and `'async_trait` bounds for the future. ```rust fn get_secret_key<'life0, 'life1, 'async_trait>( &'life0 self, access_key: &'life1 str, ) -> Pin> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, ``` -------------------------------- ### String Serialization Methods Source: https://docs.rs/s3s/latest/s3s/dto/type Methods for serializing String data into different formats using Serde. ```APIDOC ## String Serialization Methods ### Description Methods for serializing String data. ### Methods #### `serialize( &self, serializer: S, ) -> Result<::Ok, ::Error> where S: Serializer` Serializes the String value into the given Serde serializer. #### `serialize_content(&self, s: &mut Serializer) -> SerResult` Serializes the content of the String data type. ### Type Implementations - `impl Serialize for String` - `impl SerializeContent for String` ``` -------------------------------- ### GET /bucket/replication Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the replication configuration of an S3 bucket. Note that this operation is not supported for directory buckets. Propagation of changes can take time, so immediate GET requests after PUT or DELETE might return inconsistent results. ```APIDOC ## GET /bucket/replication ### Description Returns the replication configuration of a bucket. This operation is not supported for directory buckets. It can take a while for changes to propagate, so a GET request soon after a PUT or DELETE might return an incorrect result. ### Method GET ### Endpoint `/bucket/replication` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **replicationConfiguration** (object) - The replication configuration of the bucket. #### Response Example ```json { "replicationConfiguration": { "Role": "arn:aws:iam::123456789012:role/RoleForReplication", "Rules": [ { "ID": "Rule1", "Priority": 1, "Destination": { "Bucket": "arn:aws:s3:::destination-bucket" }, "SourceSelectionCriteria": { "SseKmsEncryptedObjects": { "Status": "Enabled" } }, "Status": "Enabled" } ] } } ``` ``` -------------------------------- ### Rust Generic Blanket Implementations (Any, Borrow, CloneToUninit) Source: https://docs.rs/s3s/latest/s3s/host/enum Demonstrates generic blanket implementations for types in Rust, including `Any`, `Borrow`, and `CloneToUninit`, which apply to `DomainError`. ```rust impl Any for T where T: 'static + ?Sized { fn type_id(&self) -> TypeId { // ... implementation details ... } } impl Borrow for T where T: ?Sized { fn borrow(&self) -> &T { // ... implementation details ... } } impl BorrowMut for T where T: ?Sized { fn borrow_mut(&mut self) -> &mut T { // ... implementation details ... } } unsafe impl CloneToUninit for T where T: Clone { unsafe fn clone_to_uninit(&self, dest: *mut u8) { // ... implementation details ... } } ``` -------------------------------- ### Set Object ACL using Explicit Grant Headers Source: https://docs.rs/s3s/latest/s3s/trait This example shows how to explicitly grant permissions to specific grantees using headers like 'x-amz-grant-read', 'x-amz-grant-write-acp', etc. This provides granular control over access. When using these headers, the 'x-amz-acl' header for canned ACLs cannot be used. ```text x-amz-grant-read: id="111122223333",uri="http://acs.amazonaws.com/groups/global/AllUsers" x-amz-grant-write-acp: emailAddress="user@example.com" ``` -------------------------------- ### MultiDomain Constructor Source: https://docs.rs/s3s/latest/s3s/host/struct Creates a new MultiDomain instance with the specified base domains. It returns an error if any domain is invalid, if domains overlap, or if no domains are provided. ```APIDOC ## POST /multi-domain/new ### Description Creates a new `MultiDomain` with the base domains. ### Method POST ### Endpoint `/multi-domain/new` ### Parameters #### Query Parameters - **base_domains** (array of strings) - Required - A list of base domain strings. ### Request Body ```json { "base_domains": ["example.com", "another.com"] } ``` ### Response #### Success Response (200) - **MultiDomain** (object) - A successfully created MultiDomain instance. #### Response Example ```json { "message": "MultiDomain created successfully" } ``` #### Error Response (400) - **DomainError** (string) - Describes the error encountered during MultiDomain creation (e.g., invalid domain, overlap, no domains specified). #### Error Response Example ```json { "error": "No base domains specified" } ``` ``` -------------------------------- ### Set Object ACL using Canned ACL Header Source: https://docs.rs/s3s/latest/s3s/trait This example demonstrates setting an object's ACL using a canned ACL via the 'x-amz-acl' request header. This method is suitable for applying predefined permission sets. Ensure you do not use other access control-specific headers when using this method. ```text x-amz-acl: public-read ``` -------------------------------- ### Rust Result ok() Conversion Example Source: https://docs.rs/s3s/latest/s3s/xml/type Shows how to convert a `Result` into an `Option` using the `ok` method, discarding any error values. ```rust let x: Result = Ok(2); assert_eq!(x.ok(), Some(2)); let x: Result = Err("Nothing here"); assert_eq!(x.ok(), None); ``` -------------------------------- ### Get Object Methods (Rust) Source: https://docs.rs/s3s/latest/s3s/trait Provides asynchronous methods for retrieving various object-related information from S3. These include getting the object itself, its ACL, attributes, legal hold status, lock configuration, retention details, and tagging. Each method returns a `Pin>>>>`. ```rust fn get_object<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_acl<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_attributes<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_legal_hold<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_lock_configuration<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_retention<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_tagging<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_object_torrent<'life0, 'async_trait>( &'life0 self, _req: S3Request, ) -> Pin>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } ``` -------------------------------- ### Rust: Define and Construct MultiDomain Source: https://docs.rs/s3s/latest/s3s/host/struct Defines the MultiDomain struct and provides a constructor function to initialize it with a collection of base domains. It outlines the requirements for base domains and the potential errors that can occur during initialization, such as invalid or overlapping domains, or an empty domain list. ```rust pub struct MultiDomain { /* private fields */ } pub fn new(base_domains: I) -> Result where I: IntoIterator, I::Item: AsRef, { // ... implementation details ... } ``` -------------------------------- ### String Creation from Raw Parts API Source: https://docs.rs/s3s/latest/s3s/dto/type Creates a new String from a raw pointer, length, and capacity. This operation is unsafe and requires careful memory management. ```APIDOC ## from_raw_parts ### Description Creates a new `String` from a pointer, a length and a capacity. This function is highly unsafe due to the number of invariants that aren’t checked. ### Method `pub unsafe fn from_raw_parts(buf: *mut u8, length: usize, capacity: usize) -> String` ### Endpoint N/A (Rust method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - `buf` (*mut u8) - Required - A raw pointer to the byte buffer. - `length` (usize) - Required - The length of the string in bytes. - `capacity` (usize) - Required - The allocated capacity of the buffer in bytes. ### Request Example ```rust use std::mem; unsafe { let s = String::from("hello"); let mut s = mem::ManuallyDrop::new(s); let ptr = s.as_mut_ptr(); let len = s.len(); let capacity = s.capacity(); let s = String::from_raw_parts(ptr, len, capacity); assert_eq!(String::from("hello"), s); } ``` ### Response #### Success Response (200) - `String`: The newly created String object. #### Response Example ```json { "example": "hello" } ``` ``` -------------------------------- ### String Partial Ordering Methods (Rust) Source: https://docs.rs/s3s/latest/s3s/dto/type Implements methods for partial comparison of String values, including less than, less than or equal to, greater than, and greater than or equal to. ```Rust fn lt(&self, other: &Rhs) -> bool fn le(&self, other: &Rhs) -> bool fn gt(&self, other: &Rhs) -> bool fn ge(&self, other: &Rhs) -> bool ``` -------------------------------- ### S3Service - Other Implementations Source: https://docs.rs/s3s/latest/s3s/service/struct This section details various trait implementations for S3Service, including `AsRef`, `Debug`, `Freeze`, `Send`, `Sync`, `Unpin`, and blanket implementations like `Any`, `Borrow`, `From`, `Into`, `Instrument`, `TryFrom`, `TryInto`, and `WithSubscriber`. ```APIDOC ## S3Service Trait Implementations ### `AsRef` for `SharedS3Service` - **`as_ref`**: Converts `SharedS3Service` into a shared reference of `S3Service`. ### `Debug` for `S3Service` - **`fmt`**: Formats the `S3Service` for debugging purposes. ### Auto Trait Implementations - **`Freeze`** - **`!RefUnwindSafe`** - **`Send`** - **`Sync`** - **`Unpin`** - **`!UnwindSafe`** ### Blanket Implementations - **`Any`**: Provides `type_id`. - **`Borrow`**: Provides `borrow`. - **`BorrowMut`**: Provides `borrow_mut`. - **`From`**: Provides `from`. - **`FromExt`**: Provides `from_`. - **`Instrument`**: Provides `instrument` and `in_current_span`. - **`Into`**: Provides `into`. - **`IntoExt`**: Provides `into_`. - **`Same`**: Provides associated type `Output`. - **`TryFrom`**: Provides `try_from` and associated type `Error`. - **`TryFromExt`**: Provides `try_from_`. - **`TryInto`**: Provides `try_into` and associated type `Error`. - **`TryIntoExt`**: Provides `try_into_`. - **`WithSubscriber`**: Provides `with_subscriber` and `with_current_subscriber`. ``` -------------------------------- ### Rust Result as_ref() Example Source: https://docs.rs/s3s/latest/s3s/xml/type Illustrates using `as_ref` to convert a `&Result` into a `Result<&T, &E>`, providing references without consuming the original `Result`. ```rust let x: Result = Ok(2); assert_eq!(x.as_ref(), Ok(&2)); let x: Result = Err("Error"); assert_eq!(x.as_ref(), Err(&"Error")); ``` -------------------------------- ### S3Response Constructors Source: https://docs.rs/s3s/latest/s3s/struct Provides methods for creating new instances of S3Response. ```APIDOC ## Implementations for S3Response ### `new(output: T) -> Self` Creates a new `S3Response` with the specified output and default empty headers and extensions. ### `with_headers(output: T, headers: HeaderMap) -> Self` Creates a new `S3Response` with the specified output and response headers. ``` -------------------------------- ### GET /objects/tagging/{bucket}/{key} Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the tagging-set for an object. ```APIDOC ## GET /objects/tagging/{bucket}/{key} ### Description Retrieves the tagging-set for an object. ### Method GET ### Endpoint `/objects/tagging/{bucket}/{key}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket containing the object. - **key** (string) - Required - The key (name) of the object whose tags are to be retrieved. ### Request Example ```json { "example": "GET /my-bucket/my-object/tagging HTTP/1.1" } ``` ### Response #### Success Response (200) - **tagging** (object) - **tagSet** (array) - **key** (string) - The tag key. - **value** (string) - The tag value. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"tagging\": { \"tagSet\": [ { \"key\": \"environment\", \"value\": \"production\" } ] }}" } ``` ``` -------------------------------- ### String Visitor and Writer Methods Source: https://docs.rs/s3s/latest/s3s/dto/type Methods related to visiting string content and writing to string-based writers. ```APIDOC ## String Visitor and Writer Methods ### Description Methods for interacting with String data through visitors and writers. ### Methods #### `record(&self, key: &Field, visitor: &mut dyn Visit)` Visits the String value with a given `Visitor`. #### `write_str(&mut self, s: &str) -> Result<(), Error>` Writes a string slice into this writer. #### `write_char(&mut self, c: char) -> Result<(), Error>` Writes a character into this writer. #### `write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>` Handles formatted string writing using the `write!` macro. ### Type Implementations - `impl Value for String` - `impl Write for String` ``` -------------------------------- ### GET /multipart-uploads/{bucket} Source: https://docs.rs/s3s/latest/s3s/trait Lists all incomplete multipart uploads for a bucket. ```APIDOC ## GET /multipart-uploads/{bucket} ### Description Lists all incomplete multipart uploads for a specified S3 bucket. This is useful for managing ongoing uploads and identifying potential orphaned parts. ### Method GET ### Endpoint `/multipart-uploads/{bucket}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket for which to list multipart uploads. #### Query Parameters - **prefix** (string) - Optional - Limits the response to keys that begin with the specified prefix. - **key-marker** (string) - Optional - Specifies the key to start listing multipart uploads from. - **upload-id-marker** (string) - Optional - Specifies the upload ID to start listing multipart uploads from. - **max-uploads** (integer) - Optional - Sets the maximum number of multipart uploads to return in the response. ### Request Example ```json { "example": "GET /multipart-uploads/my-bucket?prefix=logs/&max-uploads=10 HTTP/1.1" } ``` ### Response #### Success Response (200) - **uploads** (array) - **key** (string) - The key of the object for which the multipart upload is initiated. - **uploadId** (string) - The ID of the multipart upload. - **initiated** (string) - The date and time when the multipart upload was initiated. - **isTruncated** (boolean) - Indicates if the list of uploads is truncated. - **nextKeyMarker** (string) - If `isTruncated` is true, this specifies the key to start the next listing from. - **nextUploadIdMarker** (string) - If `isTruncated` is true, this specifies the upload ID to start the next listing from. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"uploads\": [ { \"key\": \"logs/archive.zip\", \"uploadId\": \"upload123\", \"initiated\": \"2023-11-15T10:00:00Z\" } ], \"isTruncated\": false }" } ``` ``` -------------------------------- ### GET /buckets Source: https://docs.rs/s3s/latest/s3s/trait Lists all S3 buckets owned by the authenticated sender. ```APIDOC ## GET /buckets ### Description Retrieves a list of all S3 buckets that are owned by the authenticated AWS account. ### Method GET ### Endpoint `/buckets` ### Parameters None ### Request Example ```json { "example": "GET /buckets HTTP/1.1" } ``` ### Response #### Success Response (200) - **buckets** (array) - **name** (string) - The name of the bucket. - **creationDate** (string) - The date and time when the bucket was created. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"buckets\": [ { \"name\": \"my-bucket-1\", \"creationDate\": \"2023-01-01T10:00:00Z\" }, { \"name\": \"my-bucket-2\", \"creationDate\": \"2023-02-01T11:00:00Z\" } ] }" } ``` ``` -------------------------------- ### Result Methods Overview Source: https://docs.rs/s3s/latest/s3s/xml/type This section provides an overview of common methods available on the `Result` type, used for handling success and error conditions. ```APIDOC ## Result Type Methods ### `sq_then_to_string(x: u32) -> Result` **Description**: A helper function demonstrating chaining fallible operations. It squares a `u32` and converts it to a `String`, returning an error string on overflow. **Method**: `and_then` (as demonstrated in example) **Endpoint**: N/A (Method on `Result` type) ### `or(self, res: Result) -> Result` **Description**: Returns `res` if the result is `Err`, otherwise returns the `Ok` value of `self`. Arguments are eagerly evaluated. **Method**: `or` **Endpoint**: N/A (Method on `Result` type) ### `or_else(self, op: O) -> Result` **Description**: Calls `op` if the result is `Err`, otherwise returns the `Ok` value of `self`. `op` is lazily evaluated. **Method**: `or_else` **Endpoint**: N/A (Method on `Result` type) ### `unwrap_or(self, default: T) -> T` **Description**: Returns the contained `Ok` value or a provided default. Arguments are eagerly evaluated. **Method**: `unwrap_or` **Endpoint**: N/A (Method on `Result` type) ### `unwrap_or_else(self, op: F) -> T` **Description**: Returns the contained `Ok` value or computes it from a closure. `op` is lazily evaluated. **Method**: `unwrap_or_else` **Endpoint**: N/A (Method on `Result` type) ### `unwrap_unchecked(self) -> T` **Description**: Returns the contained `Ok` value without checking if it's an `Err`. **Unsafe**. **Method**: `unwrap_unchecked` **Endpoint**: N/A (Method on `Result` type) ### `unwrap_err_unchecked(self) -> E` **Description**: Returns the contained `Err` value without checking if it's an `Ok`. **Unsafe**. **Method**: `unwrap_err_unchecked` **Endpoint**: N/A (Method on `Result` type) ### Request Example ```json { "example": "No request body for these methods" } ``` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example ```json { "example": "Resulting value or default" } ``` ``` -------------------------------- ### GET /objects/torrent/{bucket}/{key} Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the torrent file for an object. ```APIDOC ## GET /objects/torrent/{bucket}/{key} ### Description Retrieves the torrent file for an object, which can be used for peer-to-peer distribution. ### Method GET ### Endpoint `/objects/torrent/{bucket}/{key}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket containing the object. - **key** (string) - Required - The key (name) of the object for which to retrieve the torrent file. ### Request Example ```json { "example": "GET /my-bucket/my-object/torrent HTTP/1.1" } ``` ### Response #### Success Response (200) - **torrent_file** (file) - The content of the torrent file. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/x-bittorrent\n\n" } ``` ``` -------------------------------- ### PUT Bucket Website Source: https://docs.rs/s3s/latest/s3s/trait Configures a website for an S3 bucket. This allows you to host static websites directly from your S3 bucket. ```APIDOC ## PUT /websites/rs_s3s_s3s/{bucket-name}/website ### Description Configures a website for an S3 bucket. This allows you to host static websites directly from your S3 bucket. ### Method PUT ### Endpoint `/websites/rs_s3s_s3s/{bucket-name}/website` ### Parameters #### Path Parameters - **bucket-name** (string) - Required - The name of the bucket for which to configure the website. #### Request Body - **WebsiteConfiguration** (Object) - Required - Specifies the website configuration. - **IndexDocument** (Object) - Optional - Specifies the index document. - **Suffix** (string) - Required - The suffix for the index document (e.g., `index.html`). - **ErrorDocument** (Object) - Optional - Specifies the error document. - **Key** (string) - Required - The key of the error document (e.g., `error.html`). - **RedirectAllRequestsTo** (Object) - Optional - Specifies a redirect for all requests. - **HostName** (string) - Required - The hostname to which all requests should be redirected. - **ReplaceKeyPrefixWith** (string) - Optional - The prefix to replace in the request key. ### Request Example ```json { "WebsiteConfiguration": { "IndexDocument": { "Suffix": "index.html" }, "ErrorDocument": { "Key": "error.html" } } } ``` ### Response #### Success Response (200) Indicates that the website configuration was successfully updated. #### Response Example (Empty response body on success) ``` -------------------------------- ### GET /objects/retention/{bucket}/{key} Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the retention policy for an object. ```APIDOC ## GET /objects/retention/{bucket}/{key} ### Description Retrieves the retention policy for an object, including the mode and expiration date. ### Method GET ### Endpoint `/objects/retention/{bucket}/{key}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket containing the object. - **key** (string) - Required - The key (name) of the object whose retention policy is to be retrieved. ### Request Example ```json { "example": "GET /my-bucket/my-object/retention HTTP/1.1" } ``` ### Response #### Success Response (200) - **retention** (object) - **mode** (string) - The retention mode ('GOVERNANCE' or 'COMPLIANCE'). - **retainUntilDate** (string) - The date until which the object is retained. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"retention\": { \"mode\": \"COMPLIANCE\", \"retainUntilDate\": \"2024-12-31T23:59:59Z\" }}" } ``` ``` -------------------------------- ### Implement S3Response Constructors in Rust Source: https://docs.rs/s3s/latest/s3s/struct Provides methods to create new S3Response instances. `new` initializes with output only, while `with_headers` allows specifying response headers. ```rust impl S3Response { pub fn new(output: T) -> Self pub fn with_headers(output: T, headers: HeaderMap) -> Self } ``` -------------------------------- ### Rust Result map() Example Source: https://docs.rs/s3s/latest/s3s/xml/type Shows how to use the `map` method to apply a function to the `Ok` value of a `Result`, leaving `Err` values unchanged. ```rust let line = "1\n2\n3\n4\n"; for num in line.lines() { match num.parse::().map(|i| i * 2) { Ok(n) => println!( Hiện{n}), Err(..) => {} // Ignore parsing errors } } ``` -------------------------------- ### GET /publicAccessBlock/{bucket} Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the Public Access Block configuration for a bucket. ```APIDOC ## GET /publicAccessBlock/{bucket} ### Description Retrieves the Public Access Block configuration for a bucket, which helps to manage public access settings. ### Method GET ### Endpoint `/publicAccessBlock/{bucket}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket for which to retrieve the Public Access Block configuration. ### Request Example ```json { "example": "GET /publicAccessBlock/my-bucket HTTP/1.1" } ``` ### Response #### Success Response (200) - **publicAccessBlockConfiguration** (object) - **blockPublicAcls** (boolean) - Indicates whether public ACLs are blocked. - **ignorePublicAcls** (boolean) - Indicates whether public ACLs are ignored. - **blockPublicPolicy** (boolean) - Indicates whether public bucket policies are blocked. - **restrictPublicBuckets** (boolean) - Indicates whether public bucket access is restricted. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"publicAccessBlockConfiguration\": { \"blockPublicAcls\": true, \"ignorePublicAcls\": true, \"blockPublicPolicy\": true, \"restrictPublicBuckets\": true }}" } ``` ``` -------------------------------- ### GET /objects/lock-configuration/{bucket}/{key} Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the Object Lock configuration for an object. ```APIDOC ## GET /objects/lock-configuration/{bucket}/{key} ### Description Retrieves the Object Lock configuration for an object, including retention mode and date. ### Method GET ### Endpoint `/objects/lock-configuration/{bucket}/{key}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket containing the object. - **key** (string) - Required - The key (name) of the object whose Object Lock configuration is to be retrieved. ### Request Example ```json { "example": "GET /my-bucket/my-object/lock-configuration HTTP/1.1" } ``` ### Response #### Success Response (200) - **objectLockConfiguration** (object) - **rule** (object) - **defaultRetention** (object) - **mode** (string) - The retention mode ('GOVERNANCE' or 'COMPLIANCE'). - **days** (integer) - The number of days to retain the object. - **years** (integer) - The number of years to retain the object. #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"objectLockConfiguration\": { \"rule\": { \"defaultRetention\": { \"mode\": \"GOVERNANCE\", \"days\": 30 }}} }" } ``` ``` -------------------------------- ### Rust Generic Blanket Implementations (TryFrom, TryFromExt, TryInto) Source: https://docs.rs/s3s/latest/s3s/host/enum Details generic blanket implementations in Rust for `TryFrom`, `TryFromExt`, and `TryInto`, which facilitate fallible type conversions and are applicable to `DomainError`. ```rust impl TryFrom for T where U: Into { type Error = Infallible; fn try_from(value: U) -> Result>::Error> { // ... implementation details ... } } impl TryFromExt for T { fn try_from_(t: T) -> Result where Self: TryFrom { // ... implementation details ... } } impl TryInto for T where U: TryFrom { type Error = >::Error; } ``` -------------------------------- ### WriteGetObjectResponseInputBuilder Methods Source: https://docs.rs/s3s/latest/s3s/dto/builders/struct This section details the methods available on the WriteGetObjectResponseInputBuilder to customize the S3 GetObjectResponse. ```APIDOC ## WriteGetObjectResponseInputBuilder Methods ### Description Methods to configure various aspects of the S3 GetObjectResponse, such as checksums, content-related headers, error information, and object lock status. ### Methods - **checksum_sha256**: Sets the SHA256 checksum for the object. - **content_disposition**: Sets the `Content-Disposition` header. - **content_encoding**: Sets the `Content-Encoding` header. - **content_language**: Sets the `Content-Language` header. - **content_length**: Sets the `Content-Length` header. - **content_range**: Sets the `Content-Range` header. - **content_type**: Sets the `Content-Type` header. - **delete_marker**: Indicates if the response is a delete marker. - **e_tag**: Sets the ETag of the object. - **error_code**: Sets the error code in case of an error response. - **error_message**: Sets the error message in case of an error response. - **expiration**: Sets the expiration time for the object. - **expires**: Sets the `Expires` header. - **last_modified**: Sets the last modified date of the object. - **metadata**: Sets custom metadata for the object. - **missing_meta**: Indicates if metadata is missing. - **object_lock_legal_hold_status**: Sets the legal hold status for object lock. - **object_lock_mode**: Sets the object lock mode. - **object_lock_retain_until_date**: Sets the date until which the object lock is retained. - **parts_count**: Sets the number of parts for a multipart upload response. - **replication_status**: Sets the replication status of the object. - **request_charged**: Indicates if the request was charged. - **request_route**: Sets the request route. - **request_token**: Sets the request token. - **restore**: Sets the restore status for the object. - **sse_customer_algorithm**: Sets the server-side encryption customer algorithm. - **sse_customer_key_md5**: Sets the MD5 of the server-side encryption customer key. - **ssekms_key_id**: Sets the SSE-KMS key ID. - **server_side_encryption**: Sets the server-side encryption configuration. - **status_code**: Sets the HTTP status code for the response. - **storage_class**: Sets the storage class of the object. - **tag_count**: Sets the number of tags associated with the object. - **version_id**: Sets the version ID of the object. ### Build Method - **build**: Constructs the `WriteGetObjectResponseInput` from the configured builder. ### Default Implementation - **Default**: Provides a default instance of `WriteGetObjectResponseInputBuilder`. ### Request Example ```json { "checksum_sha256": "a1b2c3d4e5f6...", "content_type": "application/json", "metadata": { "x-amz-meta-my-key": "my-value" } } ``` ### Success Response Example ```json { "status_code": 200, "content_type": "application/json", "metadata": { "x-amz-meta-my-key": "my-value" } } ``` ``` -------------------------------- ### GET /objects/legal-hold/{bucket}/{key} Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the legal hold status of an object. ```APIDOC ## GET /objects/legal-hold/{bucket}/{key} ### Description Retrieves the legal hold status of an object. ### Method GET ### Endpoint `/objects/legal-hold/{bucket}/{key}` ### Parameters #### Path Parameters - **bucket** (string) - Required - The name of the bucket containing the object. - **key** (string) - Required - The key (name) of the object whose legal hold status is to be retrieved. ### Request Example ```json { "example": "GET /my-bucket/my-object/legal-hold HTTP/1.1" } ``` ### Response #### Success Response (200) - **legalHold** (object) - **status** (string) - The legal hold status ('ON' or 'OFF'). #### Response Example ```json { "example": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\"legalHold\": { \"status\": \"ON\" }}" } ``` ``` -------------------------------- ### GET Object Tagging Source: https://docs.rs/s3s/latest/s3s/trait Retrieves the tag-set of an object. This operation is not supported for directory buckets. ```APIDOC ## GET /objects/{bucket-name}/{object-key}/tagging ### Description Returns the tag-set of an object. You send the GET request against the tagging subresource associated with the object. This operation is not supported for directory buckets. ### Method GET ### Endpoint /objects/{bucket-name}/{object-key}/tagging ### Parameters #### Query Parameters - **versionId** (string) - Optional - The version ID of the object to retrieve tags for. ### Request Example ```json { "example": "GET /objects/my-bucket/my-object?versionId=some-version-id" } ``` ### Response #### Success Response (200) - **Tagging** (object) - Contains the tag set. - **TagSet** (array) - A list of tags. - **Key** (string) - The tag key. - **Value** (string) - The tag value. #### Response Example ```json { "example": { "TagSet": [ { "Key": "Environment", "Value": "Production" } ] } } ``` ``` -------------------------------- ### Rust String Reserve and Shrink Capacity Example Source: https://docs.rs/s3s/latest/s3s/dto/type Demonstrates how to reserve capacity in a Rust String and shrink its capacity. The reserve method ensures the string has at least the specified capacity, while shrink_to adjusts it. Note that shrink_to(0) does not necessarily result in zero capacity due to internal optimizations. ```rust let mut s = String::from("foo"); s.reserve(100); assert!(s.capacity() >= 100); s.shrink_to(10); assert!(s.capacity() >= 10); s.shrink_to(0); assert!(s.capacity() >= 3); ```