Switch to using the dep tool and update all the dependencies
This commit is contained in:
+4096
File diff suppressed because it is too large
Load Diff
+82
@@ -0,0 +1,82 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package firehose provides the client and types for making API
|
||||
// requests to Amazon Kinesis Firehose.
|
||||
//
|
||||
// Amazon Kinesis Firehose is a fully-managed service that delivers real-time
|
||||
// streaming data to destinations such as Amazon Simple Storage Service (Amazon
|
||||
// S3), Amazon Elasticsearch Service (Amazon ES), and Amazon Redshift.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04 for more information on this service.
|
||||
//
|
||||
// See firehose package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/firehose/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To use the client for Amazon Kinesis Firehose you will first need
|
||||
// to create a new instance of it.
|
||||
//
|
||||
// When creating a client for an AWS service you'll first need to have a Session
|
||||
// already created. The Session provides configuration that can be shared
|
||||
// between multiple service clients. Additional configuration can be applied to
|
||||
// the Session and service's client when they are constructed. The aws package's
|
||||
// Config type contains several fields such as Region for the AWS Region the
|
||||
// client should make API requests too. The optional Config value can be provided
|
||||
// as the variadic argument for Sessions and client creation.
|
||||
//
|
||||
// Once the service's client is created you can use it to make API requests the
|
||||
// AWS service. These clients are safe to use concurrently.
|
||||
//
|
||||
// // Create a session to share configuration, and load external configuration.
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create the service's client with the session.
|
||||
// svc := firehose.New(sess)
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use service clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws package's Config type for more information on configuration options.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Amazon Kinesis Firehose client Firehose for more
|
||||
// information on creating the service's client.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/firehose/#New
|
||||
//
|
||||
// Once the client is created you can make an API request to the service.
|
||||
// Each API method takes a input parameter, and returns the service response
|
||||
// and an error.
|
||||
//
|
||||
// The API method will document which error codes the service can be returned
|
||||
// by the operation if the service models the API operation's errors. These
|
||||
// errors will also be available as const strings prefixed with "ErrCode".
|
||||
//
|
||||
// result, err := svc.CreateDeliveryStream(params)
|
||||
// if err != nil {
|
||||
// // Cast err to awserr.Error to handle specific error codes.
|
||||
// aerr, ok := err.(awserr.Error)
|
||||
// if ok && aerr.Code() == <error code to check for> {
|
||||
// // Specific error code handling
|
||||
// }
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// fmt.Println("CreateDeliveryStream result:")
|
||||
// fmt.Println(result)
|
||||
//
|
||||
// Using the Client with Context
|
||||
//
|
||||
// The service's client also provides methods to make API requests with a Context
|
||||
// value. This allows you to control the timeout, and cancellation of pending
|
||||
// requests. These methods also take request Option as variadic parameter to apply
|
||||
// additional configuration to the API request.
|
||||
//
|
||||
// ctx := context.Background()
|
||||
//
|
||||
// result, err := svc.CreateDeliveryStreamWithContext(ctx, params)
|
||||
//
|
||||
// See the request package documentation for more information on using Context pattern
|
||||
// with the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
|
||||
package firehose
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package firehose
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeConcurrentModificationException for service response error code
|
||||
// "ConcurrentModificationException".
|
||||
//
|
||||
// Another modification has already happened. Fetch VersionId again and use
|
||||
// it to update the destination.
|
||||
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
|
||||
|
||||
// ErrCodeInvalidArgumentException for service response error code
|
||||
// "InvalidArgumentException".
|
||||
//
|
||||
// The specified input parameter has an value that is not valid.
|
||||
ErrCodeInvalidArgumentException = "InvalidArgumentException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// You have already reached the limit for a requested resource.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeResourceInUseException for service response error code
|
||||
// "ResourceInUseException".
|
||||
//
|
||||
// The resource is already in use and not available for this operation.
|
||||
ErrCodeResourceInUseException = "ResourceInUseException"
|
||||
|
||||
// ErrCodeResourceNotFoundException for service response error code
|
||||
// "ResourceNotFoundException".
|
||||
//
|
||||
// The specified resource could not be found.
|
||||
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
|
||||
|
||||
// ErrCodeServiceUnavailableException for service response error code
|
||||
// "ServiceUnavailableException".
|
||||
//
|
||||
// The service is unavailable, back off and retry the operation. If you continue
|
||||
// to see the exception, throughput limits for the delivery stream may have
|
||||
// been exceeded. For more information about limits and how to request an increase,
|
||||
// see Amazon Kinesis Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html).
|
||||
ErrCodeServiceUnavailableException = "ServiceUnavailableException"
|
||||
)
|
||||
+606
@@ -0,0 +1,606 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package firehose_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/firehose"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleFirehose_CreateDeliveryStream() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.CreateDeliveryStreamInput{
|
||||
DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
|
||||
ElasticsearchDestinationConfiguration: &firehose.ElasticsearchDestinationConfiguration{
|
||||
DomainARN: aws.String("ElasticsearchDomainARN"), // Required
|
||||
IndexName: aws.String("ElasticsearchIndexName"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
S3Configuration: &firehose.S3DestinationConfiguration{ // Required
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
},
|
||||
TypeName: aws.String("ElasticsearchTypeName"), // Required
|
||||
BufferingHints: &firehose.ElasticsearchBufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
IndexRotationPeriod: aws.String("ElasticsearchIndexRotationPeriod"),
|
||||
ProcessingConfiguration: &firehose.ProcessingConfiguration{
|
||||
Enabled: aws.Bool(true),
|
||||
Processors: []*firehose.Processor{
|
||||
{ // Required
|
||||
Type: aws.String("ProcessorType"), // Required
|
||||
Parameters: []*firehose.ProcessorParameter{
|
||||
{ // Required
|
||||
ParameterName: aws.String("ProcessorParameterName"), // Required
|
||||
ParameterValue: aws.String("ProcessorParameterValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RetryOptions: &firehose.ElasticsearchRetryOptions{
|
||||
DurationInSeconds: aws.Int64(1),
|
||||
},
|
||||
S3BackupMode: aws.String("ElasticsearchS3BackupMode"),
|
||||
},
|
||||
ExtendedS3DestinationConfiguration: &firehose.ExtendedS3DestinationConfiguration{
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
ProcessingConfiguration: &firehose.ProcessingConfiguration{
|
||||
Enabled: aws.Bool(true),
|
||||
Processors: []*firehose.Processor{
|
||||
{ // Required
|
||||
Type: aws.String("ProcessorType"), // Required
|
||||
Parameters: []*firehose.ProcessorParameter{
|
||||
{ // Required
|
||||
ParameterName: aws.String("ProcessorParameterName"), // Required
|
||||
ParameterValue: aws.String("ProcessorParameterValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
S3BackupConfiguration: &firehose.S3DestinationConfiguration{
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
},
|
||||
S3BackupMode: aws.String("S3BackupMode"),
|
||||
},
|
||||
RedshiftDestinationConfiguration: &firehose.RedshiftDestinationConfiguration{
|
||||
ClusterJDBCURL: aws.String("ClusterJDBCURL"), // Required
|
||||
CopyCommand: &firehose.CopyCommand{ // Required
|
||||
DataTableName: aws.String("DataTableName"), // Required
|
||||
CopyOptions: aws.String("CopyOptions"),
|
||||
DataTableColumns: aws.String("DataTableColumns"),
|
||||
},
|
||||
Password: aws.String("Password"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
S3Configuration: &firehose.S3DestinationConfiguration{ // Required
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
},
|
||||
Username: aws.String("Username"), // Required
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
ProcessingConfiguration: &firehose.ProcessingConfiguration{
|
||||
Enabled: aws.Bool(true),
|
||||
Processors: []*firehose.Processor{
|
||||
{ // Required
|
||||
Type: aws.String("ProcessorType"), // Required
|
||||
Parameters: []*firehose.ProcessorParameter{
|
||||
{ // Required
|
||||
ParameterName: aws.String("ProcessorParameterName"), // Required
|
||||
ParameterValue: aws.String("ProcessorParameterValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RetryOptions: &firehose.RedshiftRetryOptions{
|
||||
DurationInSeconds: aws.Int64(1),
|
||||
},
|
||||
S3BackupConfiguration: &firehose.S3DestinationConfiguration{
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
},
|
||||
S3BackupMode: aws.String("RedshiftS3BackupMode"),
|
||||
},
|
||||
S3DestinationConfiguration: &firehose.S3DestinationConfiguration{
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateDeliveryStream(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleFirehose_DeleteDeliveryStream() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.DeleteDeliveryStreamInput{
|
||||
DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteDeliveryStream(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleFirehose_DescribeDeliveryStream() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.DescribeDeliveryStreamInput{
|
||||
DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
|
||||
ExclusiveStartDestinationId: aws.String("DestinationId"),
|
||||
Limit: aws.Int64(1),
|
||||
}
|
||||
resp, err := svc.DescribeDeliveryStream(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleFirehose_ListDeliveryStreams() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.ListDeliveryStreamsInput{
|
||||
ExclusiveStartDeliveryStreamName: aws.String("DeliveryStreamName"),
|
||||
Limit: aws.Int64(1),
|
||||
}
|
||||
resp, err := svc.ListDeliveryStreams(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleFirehose_PutRecord() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.PutRecordInput{
|
||||
DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
|
||||
Record: &firehose.Record{ // Required
|
||||
Data: []byte("PAYLOAD"), // Required
|
||||
},
|
||||
}
|
||||
resp, err := svc.PutRecord(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleFirehose_PutRecordBatch() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.PutRecordBatchInput{
|
||||
DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
|
||||
Records: []*firehose.Record{ // Required
|
||||
{ // Required
|
||||
Data: []byte("PAYLOAD"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.PutRecordBatch(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleFirehose_UpdateDestination() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := firehose.New(sess)
|
||||
|
||||
params := &firehose.UpdateDestinationInput{
|
||||
CurrentDeliveryStreamVersionId: aws.String("DeliveryStreamVersionId"), // Required
|
||||
DeliveryStreamName: aws.String("DeliveryStreamName"), // Required
|
||||
DestinationId: aws.String("DestinationId"), // Required
|
||||
ElasticsearchDestinationUpdate: &firehose.ElasticsearchDestinationUpdate{
|
||||
BufferingHints: &firehose.ElasticsearchBufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
DomainARN: aws.String("ElasticsearchDomainARN"),
|
||||
IndexName: aws.String("ElasticsearchIndexName"),
|
||||
IndexRotationPeriod: aws.String("ElasticsearchIndexRotationPeriod"),
|
||||
ProcessingConfiguration: &firehose.ProcessingConfiguration{
|
||||
Enabled: aws.Bool(true),
|
||||
Processors: []*firehose.Processor{
|
||||
{ // Required
|
||||
Type: aws.String("ProcessorType"), // Required
|
||||
Parameters: []*firehose.ProcessorParameter{
|
||||
{ // Required
|
||||
ParameterName: aws.String("ProcessorParameterName"), // Required
|
||||
ParameterValue: aws.String("ProcessorParameterValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RetryOptions: &firehose.ElasticsearchRetryOptions{
|
||||
DurationInSeconds: aws.Int64(1),
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
S3Update: &firehose.S3DestinationUpdate{
|
||||
BucketARN: aws.String("BucketARN"),
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
},
|
||||
TypeName: aws.String("ElasticsearchTypeName"),
|
||||
},
|
||||
ExtendedS3DestinationUpdate: &firehose.ExtendedS3DestinationUpdate{
|
||||
BucketARN: aws.String("BucketARN"),
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
ProcessingConfiguration: &firehose.ProcessingConfiguration{
|
||||
Enabled: aws.Bool(true),
|
||||
Processors: []*firehose.Processor{
|
||||
{ // Required
|
||||
Type: aws.String("ProcessorType"), // Required
|
||||
Parameters: []*firehose.ProcessorParameter{
|
||||
{ // Required
|
||||
ParameterName: aws.String("ProcessorParameterName"), // Required
|
||||
ParameterValue: aws.String("ProcessorParameterValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
S3BackupMode: aws.String("S3BackupMode"),
|
||||
S3BackupUpdate: &firehose.S3DestinationUpdate{
|
||||
BucketARN: aws.String("BucketARN"),
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
},
|
||||
},
|
||||
RedshiftDestinationUpdate: &firehose.RedshiftDestinationUpdate{
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
ClusterJDBCURL: aws.String("ClusterJDBCURL"),
|
||||
CopyCommand: &firehose.CopyCommand{
|
||||
DataTableName: aws.String("DataTableName"), // Required
|
||||
CopyOptions: aws.String("CopyOptions"),
|
||||
DataTableColumns: aws.String("DataTableColumns"),
|
||||
},
|
||||
Password: aws.String("Password"),
|
||||
ProcessingConfiguration: &firehose.ProcessingConfiguration{
|
||||
Enabled: aws.Bool(true),
|
||||
Processors: []*firehose.Processor{
|
||||
{ // Required
|
||||
Type: aws.String("ProcessorType"), // Required
|
||||
Parameters: []*firehose.ProcessorParameter{
|
||||
{ // Required
|
||||
ParameterName: aws.String("ProcessorParameterName"), // Required
|
||||
ParameterValue: aws.String("ProcessorParameterValue"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
RetryOptions: &firehose.RedshiftRetryOptions{
|
||||
DurationInSeconds: aws.Int64(1),
|
||||
},
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
S3BackupMode: aws.String("RedshiftS3BackupMode"),
|
||||
S3BackupUpdate: &firehose.S3DestinationUpdate{
|
||||
BucketARN: aws.String("BucketARN"),
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
},
|
||||
S3Update: &firehose.S3DestinationUpdate{
|
||||
BucketARN: aws.String("BucketARN"),
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
},
|
||||
Username: aws.String("Username"),
|
||||
},
|
||||
S3DestinationUpdate: &firehose.S3DestinationUpdate{
|
||||
BucketARN: aws.String("BucketARN"),
|
||||
BufferingHints: &firehose.BufferingHints{
|
||||
IntervalInSeconds: aws.Int64(1),
|
||||
SizeInMBs: aws.Int64(1),
|
||||
},
|
||||
CloudWatchLoggingOptions: &firehose.CloudWatchLoggingOptions{
|
||||
Enabled: aws.Bool(true),
|
||||
LogGroupName: aws.String("LogGroupName"),
|
||||
LogStreamName: aws.String("LogStreamName"),
|
||||
},
|
||||
CompressionFormat: aws.String("CompressionFormat"),
|
||||
EncryptionConfiguration: &firehose.EncryptionConfiguration{
|
||||
KMSEncryptionConfig: &firehose.KMSEncryptionConfig{
|
||||
AWSKMSKeyARN: aws.String("AWSKMSKeyARN"), // Required
|
||||
},
|
||||
NoEncryptionConfig: aws.String("NoEncryptionConfig"),
|
||||
},
|
||||
Prefix: aws.String("Prefix"),
|
||||
RoleARN: aws.String("RoleARN"),
|
||||
},
|
||||
}
|
||||
resp, err := svc.UpdateDestination(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package firehoseiface provides an interface to enable mocking the Amazon Kinesis Firehose service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package firehoseiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/firehose"
|
||||
)
|
||||
|
||||
// FirehoseAPI provides an interface to enable mocking the
|
||||
// firehose.Firehose service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon Kinesis Firehose.
|
||||
// func myFunc(svc firehoseiface.FirehoseAPI) bool {
|
||||
// // Make svc.CreateDeliveryStream request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := firehose.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockFirehoseClient struct {
|
||||
// firehoseiface.FirehoseAPI
|
||||
// }
|
||||
// func (m *mockFirehoseClient) CreateDeliveryStream(input *firehose.CreateDeliveryStreamInput) (*firehose.CreateDeliveryStreamOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockFirehoseClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type FirehoseAPI interface {
|
||||
CreateDeliveryStream(*firehose.CreateDeliveryStreamInput) (*firehose.CreateDeliveryStreamOutput, error)
|
||||
CreateDeliveryStreamWithContext(aws.Context, *firehose.CreateDeliveryStreamInput, ...request.Option) (*firehose.CreateDeliveryStreamOutput, error)
|
||||
CreateDeliveryStreamRequest(*firehose.CreateDeliveryStreamInput) (*request.Request, *firehose.CreateDeliveryStreamOutput)
|
||||
|
||||
DeleteDeliveryStream(*firehose.DeleteDeliveryStreamInput) (*firehose.DeleteDeliveryStreamOutput, error)
|
||||
DeleteDeliveryStreamWithContext(aws.Context, *firehose.DeleteDeliveryStreamInput, ...request.Option) (*firehose.DeleteDeliveryStreamOutput, error)
|
||||
DeleteDeliveryStreamRequest(*firehose.DeleteDeliveryStreamInput) (*request.Request, *firehose.DeleteDeliveryStreamOutput)
|
||||
|
||||
DescribeDeliveryStream(*firehose.DescribeDeliveryStreamInput) (*firehose.DescribeDeliveryStreamOutput, error)
|
||||
DescribeDeliveryStreamWithContext(aws.Context, *firehose.DescribeDeliveryStreamInput, ...request.Option) (*firehose.DescribeDeliveryStreamOutput, error)
|
||||
DescribeDeliveryStreamRequest(*firehose.DescribeDeliveryStreamInput) (*request.Request, *firehose.DescribeDeliveryStreamOutput)
|
||||
|
||||
ListDeliveryStreams(*firehose.ListDeliveryStreamsInput) (*firehose.ListDeliveryStreamsOutput, error)
|
||||
ListDeliveryStreamsWithContext(aws.Context, *firehose.ListDeliveryStreamsInput, ...request.Option) (*firehose.ListDeliveryStreamsOutput, error)
|
||||
ListDeliveryStreamsRequest(*firehose.ListDeliveryStreamsInput) (*request.Request, *firehose.ListDeliveryStreamsOutput)
|
||||
|
||||
PutRecord(*firehose.PutRecordInput) (*firehose.PutRecordOutput, error)
|
||||
PutRecordWithContext(aws.Context, *firehose.PutRecordInput, ...request.Option) (*firehose.PutRecordOutput, error)
|
||||
PutRecordRequest(*firehose.PutRecordInput) (*request.Request, *firehose.PutRecordOutput)
|
||||
|
||||
PutRecordBatch(*firehose.PutRecordBatchInput) (*firehose.PutRecordBatchOutput, error)
|
||||
PutRecordBatchWithContext(aws.Context, *firehose.PutRecordBatchInput, ...request.Option) (*firehose.PutRecordBatchOutput, error)
|
||||
PutRecordBatchRequest(*firehose.PutRecordBatchInput) (*request.Request, *firehose.PutRecordBatchOutput)
|
||||
|
||||
UpdateDestination(*firehose.UpdateDestinationInput) (*firehose.UpdateDestinationOutput, error)
|
||||
UpdateDestinationWithContext(aws.Context, *firehose.UpdateDestinationInput, ...request.Option) (*firehose.UpdateDestinationOutput, error)
|
||||
UpdateDestinationRequest(*firehose.UpdateDestinationInput) (*request.Request, *firehose.UpdateDestinationOutput)
|
||||
}
|
||||
|
||||
var _ FirehoseAPI = (*firehose.Firehose)(nil)
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package firehose
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// Firehose provides the API operation methods for making requests to
|
||||
// Amazon Kinesis Firehose. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// Firehose methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type Firehose struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "firehose" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Firehose client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a Firehose client from just a session.
|
||||
// svc := firehose.New(mySession)
|
||||
//
|
||||
// // Create a Firehose client with additional configuration
|
||||
// svc := firehose.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Firehose {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Firehose {
|
||||
svc := &Firehose{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2015-08-04",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "Firehose_20150804",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a Firehose operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Firehose) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
Reference in New Issue
Block a user