com.aliyun.oss.model

## 类 BucketVersioningConfiguration

- java.lang.Object
- - com.aliyun.oss.model.BucketVersioningConfiguration

- 所有已实现的接口:
    Serializable

      public class BucketVersioningConfiguration
      extends Object
      implements Serializable

  Represents the versioning configuration for a bucket.

  A bucket's versioning configuration can be in one of three possible states:

  - `OFF`
  - `ENABLED`
  - `SUSPENDED`

  By default, new buckets are in the `off` state. Once versioning is enabled for a bucket the status can never be reverted to `off`.

  The versioning configuration of a bucket has different implications for each operation performed on that bucket or for objects within that bucket. For instance, when versioning is enabled, a PutObject operation creates a unique object version-id for the object being uploaded. The PutObject API guarantees that, if versioning is enabled for a bucket at the time of the request, the new object can only be permanently deleted using the DeleteVersion operation. It can never be overwritten. Additionally, PutObject guarantees that, if versioning is enabled for a bucket the request, no other object will be overwritten by that request. Refer to the documentation sections for each API for information on how versioning status affects the semantics of that particular API.

  OSS is eventually consistent. It may take time for the versioning status of a bucket to be propagated throughout the system.

  另请参阅:
    `OSS#getBucketVersioning(String)`, `OSS#setBucketVersioning(SetBucketVersioningRequest)`, 序列化表格

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `static String` | `ENABLED` OSS bucket versioning status indicating that versioning is enabled for a bucket.
    `static String` | `OFF` OSS bucket versioning status indicating that versioning is off for a bucket.
    `static String` | `SUSPENDED` OSS bucket versioning status indicating that versioning is suspended for a bucket.

  - ### 构造器概要

    构造器
    构造器和说明
    `BucketVersioningConfiguration()` Creates a new bucket versioning configuration object which defaults to `OFF` status.
    `BucketVersioningConfiguration(String status)` Creates a new bucket versioning configuration object with the specified status.

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `String` | `getStatus()` Returns the current status of versioning for this bucket versioning configuration object, indicating if versioning is enabled or not for a bucket.
    `void` | `setStatus(String status)` Sets the desired status of versioning for this bucket versioning configuration object.
    `BucketVersioningConfiguration` | `withStatus(String status)` Sets the desired status of versioning for this bucket versioning configuration object, and returns this object so that additional method calls may be chained together.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 字段详细资料

    - #### OFF

          public static final String OFF

      OSS bucket versioning status indicating that versioning is off for a bucket. By default, all buckets start off with versioning off. Once you enable versioning for a bucket, you can never set the status back to "Off". You can only suspend versioning on a bucket once you've enabled.
      另请参阅:
        常量字段值

    - #### SUSPENDED

          public static final String SUSPENDED

      OSS bucket versioning status indicating that versioning is suspended for a bucket. Use the "Suspended" status when you want to disable versioning on a bucket that has versioning enabled.
      另请参阅:
        常量字段值

    - #### ENABLED

          public static final String ENABLED

      OSS bucket versioning status indicating that versioning is enabled for a bucket.
      另请参阅:
        常量字段值

  - ### 构造器详细资料

    - #### BucketVersioningConfiguration

          public BucketVersioningConfiguration()

      Creates a new bucket versioning configuration object which defaults to `OFF` status.

    - #### BucketVersioningConfiguration

          public BucketVersioningConfiguration(String status)

      Creates a new bucket versioning configuration object with the specified status.

      Note that once versioning has been enabled for a bucket, its status can only be `suspended` and can never be set back to `off`.

      参数:
        `status` - The desired bucket versioning status for the new configuration object.
      另请参阅:
        `ENABLED`, `SUSPENDED`

  - ### 方法详细资料

    - #### getStatus

          public String getStatus()

      Returns the current status of versioning for this bucket versioning configuration object, indicating if versioning is enabled or not for a bucket.
      返回:
        The current status of versioning for this bucket versioning configuration.
      另请参阅:
        `OFF`, `ENABLED`, `SUSPENDED`

    - #### setStatus

          public void setStatus(String status)

      Sets the desired status of versioning for this bucket versioning configuration object.

      Note that once versioning has been enabled for a bucket, its status can only be `suspended` and can never be set back to `off`.

      参数:
        `status` - The desired status of versioning for this bucket versioning configuration.
      另请参阅:
        `ENABLED`, `SUSPENDED`

    - #### withStatus

          public BucketVersioningConfiguration withStatus(String status)

      Sets the desired status of versioning for this bucket versioning configuration object, and returns this object so that additional method calls may be chained together.

      Note that once versioning has been enabled for a bucket, its status can only be `suspended` and can never be set back to `off`.

      参数:
        `status` - The desired status of versioning for this bucket versioning configuration.
      返回:
        The updated OSS BucketVersioningConfiguration object so that additional method calls may be chained together.
      另请参阅:
        `ENABLED`, `SUSPENDED`

Copyright © 2020. All Rights Reserved.