com.aliyun.oss.model

## 类 SetBucketVersioningRequest

- java.lang.Object
- - com.aliyun.oss.model.WebServiceRequest
  - - com.aliyun.oss.model.GenericRequest
    - - com.aliyun.oss.model.SetBucketVersioningRequest

-     public class SetBucketVersioningRequest
      extends GenericRequest

  Contains options for setting the versioning configuration for a bucket.

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

  - `BucketVersioningConfiguration.OFF`
  - `BucketVersioningConfiguration.ENABLED`
  - `BucketVersioningConfiguration.SUSPENDED`

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

  Objects created before versioning is enabled or while versioning is suspended will be given the default `null` version ID (see `OSSConstants.NULL_VERSION_ID`). Note that the `null` version ID is a valid version ID and is not the same as having no version ID.

  The versioning configuration of a bucket has different implications for each operation performed on that bucket or for objects within that bucket. When versioning is enabled, a `PutObject` operation creates a unique object version ID for the object being uploaded. The `PutObject` operation guarantees that if versioning is enabled for a bucket at the time of the request, the new object can only be permanently deleted by calling the `DeleteVersion` operation and can never be overwritten.

  Additionally, the `PutObject` operation guarantees that if versioning is enabled for a bucket at the time of the request, no other object will be overwritten by that request. Refer to the documentation sections for individual APIs 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.

  另请参阅:
    `SetBucketVersioningRequest(String, BucketVersioningConfiguration)`

- - ### 字段概要

    - ### 从类继承的字段 com.aliyun.oss.model.WebServiceRequest

      `NOOP`

  - ### 构造器概要

    构造器
    构造器和说明
    `SetBucketVersioningRequest(String bucketName, BucketVersioningConfiguration configuration)` Constructs a new `SetBucketVersioningRequest` to set the bucket versioning configuration of the specified bucket.

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `BucketVersioningConfiguration` | `getVersioningConfiguration()` Gets the new versioning configuration for the specified bucket.
    `void` | `setVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)` Sets the new versioning configuration for the specified bucket.
    `SetBucketVersioningRequest` | `withVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)` Sets the new versioning configuration for the specified bucket and returns this object, enabling additional method calls to be chained together.

    - ### 从类继承的方法 com.aliyun.oss.model.GenericRequest

      `getBucketName, getKey, getRequestPayer, getVersionId, setBucketName, setKey, setRequestPayer, setVersionId, withBucketName, withKey, withRequestPayer, withVersionId`

    - ### 从类继承的方法 com.aliyun.oss.model.WebServiceRequest

      `addAdditionalHeaderName, addHeader, addParameter, getAdditionalHeaderNames, getHeaders, getParameters, getProgressListener, isLogEnabled, setAdditionalHeaderNames, setHeaders, setLogEnabled, setParameters, setProgressListener, withProgressListener`

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

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

- - ### 构造器详细资料

    - #### SetBucketVersioningRequest

          public SetBucketVersioningRequest(String bucketName,
                                    BucketVersioningConfiguration configuration)

      Constructs a new `SetBucketVersioningRequest` to set the bucket versioning configuration of the specified bucket.
      参数:
        `bucketName` - The name of the bucket whose versioning configuration is being set.
        `configuration` - The new versioning configuration for the specified bucket.
      另请参阅:
        `SetBucketVersioningRequest(String, BucketVersioningConfiguration)`

  - ### 方法详细资料

    - #### getVersioningConfiguration

          public BucketVersioningConfiguration getVersioningConfiguration()

      Gets the new versioning configuration for the specified bucket.
      返回:
        The new versioning configuration for the specified bucket.
      另请参阅:
        `setVersioningConfiguration(BucketVersioningConfiguration)`, `withVersioningConfiguration(BucketVersioningConfiguration)`

    - #### setVersioningConfiguration

          public void setVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)

      Sets the new versioning configuration for the specified bucket.
      参数:
        `versioningConfiguration` - The new versioning configuration for the specified bucket.
      另请参阅:
        `getVersioningConfiguration()`, `withVersioningConfiguration(BucketVersioningConfiguration)`

    - #### withVersioningConfiguration

          public SetBucketVersioningRequest withVersioningConfiguration(BucketVersioningConfiguration versioningConfiguration)

      Sets the new versioning configuration for the specified bucket and returns this object, enabling additional method calls to be chained together.
      参数:
        `versioningConfiguration` - The new versioning configuration for the specified bucket.
      返回:
        This `SetBucketVersioningRequest` object, enabling that additional method calls may be chained together.
      另请参阅:
        `getVersioningConfiguration()`, `getVersioningConfiguration()`

Copyright © 2020. All Rights Reserved.