com.amazonaws.services.cloudfront.model

## Class S3OriginConfig

- java.lang.Object
- - com.amazonaws.services.cloudfront.model.S3OriginConfig

All Implemented Interfaces:
  Serializable, Cloneable

    public class S3OriginConfig
    extends Object
    implements Serializable, Cloneable

A complex type that contains information about the Amazon S3 origin. If the origin is a custom origin, use the `CustomOriginConfig` element instead.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`S3OriginConfig()`

### Method Summary

All Methods Instance Methods Concrete Methods
`S3OriginConfig` `clone()`
`boolean` `equals(Object obj)`
`String` `getOriginAccessIdentity()` The CloudFront origin access identity to associate with the origin.
`int` `hashCode()`
`void` `setOriginAccessIdentity(String originAccessIdentity)` The CloudFront origin access identity to associate with the origin.
`String` `toString()` Returns a string representation of this object; useful for testing and debugging.
`S3OriginConfig` `withOriginAccessIdentity(String originAccessIdentity)` The CloudFront origin access identity to associate with the origin.

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### S3OriginConfig

    public S3OriginConfig()

### Method Detail

#### setOriginAccessIdentity

    public void setOriginAccessIdentity(String originAccessIdentity)

The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

origin-access-identity/CloudFront/ID-of-origin-access-identity

where `ID-of-origin-access-identity` is the value that CloudFront returned in the `ID` element when you created the origin access identity.

If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Parameters:
  `originAccessIdentity` - The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

  origin-access-identity/CloudFront/ID-of-origin-access-identity

  where `ID-of-origin-access-identity` is the value that CloudFront returned in the `ID` element when you created the origin access identity.

  If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

  To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

  To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

  For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

#### getOriginAccessIdentity

    public String getOriginAccessIdentity()

The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

origin-access-identity/CloudFront/ID-of-origin-access-identity

where `ID-of-origin-access-identity` is the value that CloudFront returned in the `ID` element when you created the origin access identity.

If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Returns:
  The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

  origin-access-identity/CloudFront/ID-of-origin-access-identity

  where `ID-of-origin-access-identity` is the value that CloudFront returned in the `ID` element when you created the origin access identity.

  If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

  To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

  To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

  For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

#### withOriginAccessIdentity

    public S3OriginConfig withOriginAccessIdentity(String originAccessIdentity)

The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

origin-access-identity/CloudFront/ID-of-origin-access-identity

where `ID-of-origin-access-identity` is the value that CloudFront returned in the `ID` element when you created the origin access identity.

If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Parameters:
  `originAccessIdentity` - The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront. The format of the value is:

  origin-access-identity/CloudFront/ID-of-origin-access-identity

  where `ID-of-origin-access-identity` is the value that CloudFront returned in the `ID` element when you created the origin access identity.

  If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.

  To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.

  To replace the origin access identity, update the distribution configuration and specify the new origin access identity.

  For more information about the origin access identity, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Returns:
  Returns a reference to this object so that method calls can be chained together.

#### toString

    public String toString()

Returns a string representation of this object; useful for testing and debugging.

Overrides:
  `toString` in class `Object`
Returns:
  A string representation of this object.
See Also:
  `Object.toString()`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### clone

    public S3OriginConfig clone()

Overrides:
  `clone` in class `Object`