// /*******************************************************************************
// * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
// * this file except in compliance with the License. A copy of the License is located at
// *
// * http://aws.amazon.com/apache2.0
// *
// * or in the "license" file accompanying this file.
// * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// * CONDITIONS OF ANY KIND, either express or implied. See the License for the
// * specific language governing permissions and limitations under the License.
// * *****************************************************************************
// * __ _ _ ___
// * ( )( \/\/ )/ __)
// * /__\ \ / \__ \
// * (_)(_) \/\/ (___/
// *
// * AWS SDK for .NET
// *
// */
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using System;
namespace Amazon.S3.Model
{
///
/// Container for the parameters to the SelectObjectContent operation.
/// This action filters the contents of an Amazon S3 object based on a simple structured
/// query language (SQL) statement. In the request, along with the SQL expression, you
/// must also specify a data serialization format (JSON, CSV, or Apache Parquet) of the
/// object. Amazon S3 uses this format to parse object data into records, and returns
/// only records that match the specified SQL expression. You must also specify the data
/// serialization format for the response.
///
///
///
/// This action is not supported by Amazon S3 on Outposts.
///
///
///
/// For more information about Amazon S3 Select, see Selecting
/// Content from Objects in the Amazon S3 User Guide.
///
/// - Permissions
-
///
///
/// You must have
s3:GetObject
permission for this operation. Amazon S3 Select
/// does not support anonymous access. For more information about permissions, see Specifying
/// Permissions in a Policy in the Amazon S3 User Guide.
///
///
/// - Object Data Formats
-
///
///
/// You can use Amazon S3 Select to query objects that have the following format properties:
///
///
-
///
/// CSV, JSON, and Parquet - Objects must be in CSV, JSON, or Parquet format.
///
///
-
///
/// UTF-8 - UTF-8 is the only encoding type Amazon S3 Select supports.
///
///
-
///
/// GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP or BZIP2.
/// GZIP and BZIP2 are the only compression formats that Amazon S3 Select supports for
/// CSV and JSON files. Amazon S3 Select supports columnar compression for Parquet using
/// GZIP or Snappy. Amazon S3 Select does not support whole-object compression for Parquet
/// objects.
///
///
-
///
/// Server-side encryption - Amazon S3 Select supports querying objects that are
/// protected with server-side encryption.
///
///
///
/// For objects that are encrypted with customer-provided encryption keys (SSE-C), you
/// must use HTTPS, and you must use the headers that are documented in the GetObject.
/// For more information about SSE-C, see Server-Side
/// Encryption (Using Customer-Provided Encryption Keys) in the Amazon S3 User
/// Guide.
///
///
///
/// For objects that are encrypted with Amazon S3 managed encryption keys (SSE-S3) and
/// Amazon Web Services KMS keys (SSE-KMS), server-side encryption is handled transparently,
/// so you don't need to specify anything. For more information about server-side encryption,
/// including SSE-S3 and SSE-KMS, see Protecting
/// Data Using Server-Side Encryption in the Amazon S3 User Guide.
///
///
- Working with the Response Body
-
///
///
/// Given the response size is unknown, Amazon S3 Select streams the response as a series
/// of messages and includes a
Transfer-Encoding
header with chunked
/// as its value in the response. For more information, see Appendix:
/// SelectObjectContent Response.
///
/// - GetObject Support
-
///
/// The
SelectObjectContent
action does not support the following GetObject
/// functionality. For more information, see GetObject.
///
/// -
///
///
Range
: Although you can specify a scan range for an Amazon S3 Select
/// request (see SelectObjectContentRequest
/// - ScanRange in the request parameters), you cannot specify the range of bytes
/// of an object to return.
///
/// -
///
/// GLACIER, DEEP_ARCHIVE and REDUCED_REDUNDANCY storage classes: You cannot specify the
/// GLACIER, DEEP_ARCHIVE, or
REDUCED_REDUNDANCY
storage classes. For more
/// information, about storage classes see Storage
/// Classes in the Amazon S3 User Guide.
///
///
- Special Errors
-
///
/// For a list of special errors for this operation, see List
/// of SELECT Object Content Error Codes
///
///
///
/// The following operations are related to SelectObjectContent
:
///
///
///
public class SelectObjectContentRequest : AmazonWebServiceRequest
{
///
/// The S3 Bucket.
///
[Obsolete("Use BucketName instead")]
public string Bucket
{
get { return BucketName; }
set { BucketName = value; }
}
///
/// The S3 Bucket name.
///
public string BucketName { get; set; }
private string expectedBucketOwner;
internal bool IsSetBucket() => BucketName != null;
///
/// The Object Key.
///
public string Key { get; set; }
internal bool IsSetKey() => Key != null;
///
/// The SSE Algorithm used to encrypt the object.
///
///
/// The SSE algorithm used to encrypt the object. This is only needed when the object
/// was created using a checksum algorithm. For more information, see Protecting
/// data using SSE-C keys in the Amazon S3 User Guide.
///
public ServerSideEncryptionCustomerMethod ServerSideCustomerEncryptionMethod { get; set; }
internal bool IsSetServerSideCustomerEncryptionMethod() => ServerSideCustomerEncryptionMethod != null;
///
/// The SSE Customer Key.
///
///
/// The SSE customer key. This is only needed when the object was cureated using a checksum
/// algorithm. For more information, see Protecting
/// data using SSE-C keys in the Amazon S3 User Guide.
///
[AWSProperty(Sensitive=true)]
public string ServerSideEncryptionCustomerProvidedKey { get; set; }
internal bool IsSetServerSideEncryptionCustomerProvidedKey() => ServerSideEncryptionCustomerProvidedKey != null;
///
/// The SSE Customer Key MD5.
///
///
/// The MD5 SSE customer key. This is only needed when the object was cureated using a
/// checksum algorithm. For more information, see Protecting
/// data using SSE-C keys in the Amazon S3 User Guide.
///
public string ServerSideEncryptionCustomerProvidedKeyMD5 { get; set; }
internal bool IsSetServerSideEncryptionCustomerProvidedKeyMD5() =>
ServerSideEncryptionCustomerProvidedKeyMD5 != null;
///
/// The expression that is used to query the object.
///
public string Expression { get; set; }
internal bool IsSetExpression() => Expression != null;
///
/// The type of the provided expression (e.g., SQL).
///
public ExpressionType ExpressionType { get; set; }
internal bool IsSetExpressionType() => ExpressionType != null;
///
/// Specifies if periodic request progress information should be enabled.
///
public bool? RequestProgress { get; set; }
internal bool IsSetRequestProgress() => RequestProgress != null;
///
/// Describes the format of the data in the object that is being queried.
///
public InputSerialization InputSerialization { get; set; }
internal bool IsSetInputSerialization() => InputSerialization != null;
///
/// Describes the format of the data that you want Amazon S3 to return in response.
///
public OutputSerialization OutputSerialization { get; set; }
internal bool IsSetOutputSerialization() => OutputSerialization != null;
///
/// The byte range of the object to get the records from.
///
public ScanRange ScanRange { get; set; }
internal bool IsSetScanRange() => ScanRange != null;
///
/// The account ID of the expected bucket owner.
/// If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
///
public string ExpectedBucketOwner
{
get { return this.expectedBucketOwner; }
set { this.expectedBucketOwner = value; }
}
///
/// Checks to see if ExpectedBucketOwner is set.
///
/// true, if ExpectedBucketOwner property is set.
internal bool IsSetExpectedBucketOwner()
{
return !String.IsNullOrEmpty(this.expectedBucketOwner);
}
}
}