Switch to using the dep tool and update all the dependencies
This commit is contained in:
+5145
File diff suppressed because it is too large
Load Diff
+78
@@ -0,0 +1,78 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package kinesisanalytics provides the client and types for making API
|
||||
// requests to Amazon Kinesis Analytics.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14 for more information on this service.
|
||||
//
|
||||
// See kinesisanalytics package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/kinesisanalytics/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To use the client for Amazon Kinesis Analytics 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 := kinesisanalytics.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 Analytics client KinesisAnalytics for more
|
||||
// information on creating the service's client.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/kinesisanalytics/#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.AddApplicationInput(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("AddApplicationInput 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.AddApplicationInputWithContext(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 kinesisanalytics
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package kinesisanalytics
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeCodeValidationException for service response error code
|
||||
// "CodeValidationException".
|
||||
//
|
||||
// User-provided application code (query) is invalid. This can be a simple syntax
|
||||
// error.
|
||||
ErrCodeCodeValidationException = "CodeValidationException"
|
||||
|
||||
// ErrCodeConcurrentModificationException for service response error code
|
||||
// "ConcurrentModificationException".
|
||||
//
|
||||
// Exception thrown as a result of concurrent modification to an application.
|
||||
// For example, two individuals attempting to edit the same application at the
|
||||
// same time.
|
||||
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
|
||||
|
||||
// ErrCodeInvalidApplicationConfigurationException for service response error code
|
||||
// "InvalidApplicationConfigurationException".
|
||||
//
|
||||
// User-provided application configuration is not valid.
|
||||
ErrCodeInvalidApplicationConfigurationException = "InvalidApplicationConfigurationException"
|
||||
|
||||
// ErrCodeInvalidArgumentException for service response error code
|
||||
// "InvalidArgumentException".
|
||||
//
|
||||
// Specified input parameter value is invalid.
|
||||
ErrCodeInvalidArgumentException = "InvalidArgumentException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// Exceeded the number of applications allowed.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeResourceInUseException for service response error code
|
||||
// "ResourceInUseException".
|
||||
//
|
||||
// Application is not available for this operation.
|
||||
ErrCodeResourceInUseException = "ResourceInUseException"
|
||||
|
||||
// ErrCodeResourceNotFoundException for service response error code
|
||||
// "ResourceNotFoundException".
|
||||
//
|
||||
// Specified application can't be found.
|
||||
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
|
||||
|
||||
// ErrCodeResourceProvisionedThroughputExceededException for service response error code
|
||||
// "ResourceProvisionedThroughputExceededException".
|
||||
//
|
||||
// Discovery failed to get a record from the streaming source because of the
|
||||
// Kinesis Streams ProvisionedThroughputExceededException.
|
||||
ErrCodeResourceProvisionedThroughputExceededException = "ResourceProvisionedThroughputExceededException"
|
||||
|
||||
// ErrCodeUnableToDetectSchemaException for service response error code
|
||||
// "UnableToDetectSchemaException".
|
||||
//
|
||||
// Data format is not valid, Kinesis Analytics is not able to detect schema
|
||||
// for the given streaming source.
|
||||
ErrCodeUnableToDetectSchemaException = "UnableToDetectSchemaException"
|
||||
)
|
||||
+550
@@ -0,0 +1,550 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package kinesisanalytics_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/kinesisanalytics"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleKinesisAnalytics_AddApplicationInput() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.AddApplicationInputInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
CurrentApplicationVersionId: aws.Int64(1), // Required
|
||||
Input: &kinesisanalytics.Input{ // Required
|
||||
InputSchema: &kinesisanalytics.SourceSchema{ // Required
|
||||
RecordColumns: []*kinesisanalytics.RecordColumn{ // Required
|
||||
{ // Required
|
||||
Name: aws.String("RecordColumnName"), // Required
|
||||
SqlType: aws.String("RecordColumnSqlType"), // Required
|
||||
Mapping: aws.String("RecordColumnMapping"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RecordFormat: &kinesisanalytics.RecordFormat{ // Required
|
||||
RecordFormatType: aws.String("RecordFormatType"), // Required
|
||||
MappingParameters: &kinesisanalytics.MappingParameters{
|
||||
CSVMappingParameters: &kinesisanalytics.CSVMappingParameters{
|
||||
RecordColumnDelimiter: aws.String("RecordColumnDelimiter"), // Required
|
||||
RecordRowDelimiter: aws.String("RecordRowDelimiter"), // Required
|
||||
},
|
||||
JSONMappingParameters: &kinesisanalytics.JSONMappingParameters{
|
||||
RecordRowPath: aws.String("RecordRowPath"), // Required
|
||||
},
|
||||
},
|
||||
},
|
||||
RecordEncoding: aws.String("RecordEncoding"),
|
||||
},
|
||||
NamePrefix: aws.String("InAppStreamName"), // Required
|
||||
InputParallelism: &kinesisanalytics.InputParallelism{
|
||||
Count: aws.Int64(1),
|
||||
},
|
||||
KinesisFirehoseInput: &kinesisanalytics.KinesisFirehoseInput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
KinesisStreamsInput: &kinesisanalytics.KinesisStreamsInput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
},
|
||||
}
|
||||
resp, err := svc.AddApplicationInput(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 ExampleKinesisAnalytics_AddApplicationOutput() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.AddApplicationOutputInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
CurrentApplicationVersionId: aws.Int64(1), // Required
|
||||
Output: &kinesisanalytics.Output{ // Required
|
||||
DestinationSchema: &kinesisanalytics.DestinationSchema{ // Required
|
||||
RecordFormatType: aws.String("RecordFormatType"),
|
||||
},
|
||||
Name: aws.String("InAppStreamName"), // Required
|
||||
KinesisFirehoseOutput: &kinesisanalytics.KinesisFirehoseOutput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
KinesisStreamsOutput: &kinesisanalytics.KinesisStreamsOutput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
},
|
||||
}
|
||||
resp, err := svc.AddApplicationOutput(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 ExampleKinesisAnalytics_AddApplicationReferenceDataSource() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.AddApplicationReferenceDataSourceInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
CurrentApplicationVersionId: aws.Int64(1), // Required
|
||||
ReferenceDataSource: &kinesisanalytics.ReferenceDataSource{ // Required
|
||||
ReferenceSchema: &kinesisanalytics.SourceSchema{ // Required
|
||||
RecordColumns: []*kinesisanalytics.RecordColumn{ // Required
|
||||
{ // Required
|
||||
Name: aws.String("RecordColumnName"), // Required
|
||||
SqlType: aws.String("RecordColumnSqlType"), // Required
|
||||
Mapping: aws.String("RecordColumnMapping"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RecordFormat: &kinesisanalytics.RecordFormat{ // Required
|
||||
RecordFormatType: aws.String("RecordFormatType"), // Required
|
||||
MappingParameters: &kinesisanalytics.MappingParameters{
|
||||
CSVMappingParameters: &kinesisanalytics.CSVMappingParameters{
|
||||
RecordColumnDelimiter: aws.String("RecordColumnDelimiter"), // Required
|
||||
RecordRowDelimiter: aws.String("RecordRowDelimiter"), // Required
|
||||
},
|
||||
JSONMappingParameters: &kinesisanalytics.JSONMappingParameters{
|
||||
RecordRowPath: aws.String("RecordRowPath"), // Required
|
||||
},
|
||||
},
|
||||
},
|
||||
RecordEncoding: aws.String("RecordEncoding"),
|
||||
},
|
||||
TableName: aws.String("InAppTableName"), // Required
|
||||
S3ReferenceDataSource: &kinesisanalytics.S3ReferenceDataSource{
|
||||
BucketARN: aws.String("BucketARN"), // Required
|
||||
FileKey: aws.String("FileKey"), // Required
|
||||
ReferenceRoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
},
|
||||
}
|
||||
resp, err := svc.AddApplicationReferenceDataSource(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 ExampleKinesisAnalytics_CreateApplication() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.CreateApplicationInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
ApplicationCode: aws.String("ApplicationCode"),
|
||||
ApplicationDescription: aws.String("ApplicationDescription"),
|
||||
Inputs: []*kinesisanalytics.Input{
|
||||
{ // Required
|
||||
InputSchema: &kinesisanalytics.SourceSchema{ // Required
|
||||
RecordColumns: []*kinesisanalytics.RecordColumn{ // Required
|
||||
{ // Required
|
||||
Name: aws.String("RecordColumnName"), // Required
|
||||
SqlType: aws.String("RecordColumnSqlType"), // Required
|
||||
Mapping: aws.String("RecordColumnMapping"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RecordFormat: &kinesisanalytics.RecordFormat{ // Required
|
||||
RecordFormatType: aws.String("RecordFormatType"), // Required
|
||||
MappingParameters: &kinesisanalytics.MappingParameters{
|
||||
CSVMappingParameters: &kinesisanalytics.CSVMappingParameters{
|
||||
RecordColumnDelimiter: aws.String("RecordColumnDelimiter"), // Required
|
||||
RecordRowDelimiter: aws.String("RecordRowDelimiter"), // Required
|
||||
},
|
||||
JSONMappingParameters: &kinesisanalytics.JSONMappingParameters{
|
||||
RecordRowPath: aws.String("RecordRowPath"), // Required
|
||||
},
|
||||
},
|
||||
},
|
||||
RecordEncoding: aws.String("RecordEncoding"),
|
||||
},
|
||||
NamePrefix: aws.String("InAppStreamName"), // Required
|
||||
InputParallelism: &kinesisanalytics.InputParallelism{
|
||||
Count: aws.Int64(1),
|
||||
},
|
||||
KinesisFirehoseInput: &kinesisanalytics.KinesisFirehoseInput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
KinesisStreamsInput: &kinesisanalytics.KinesisStreamsInput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
Outputs: []*kinesisanalytics.Output{
|
||||
{ // Required
|
||||
DestinationSchema: &kinesisanalytics.DestinationSchema{ // Required
|
||||
RecordFormatType: aws.String("RecordFormatType"),
|
||||
},
|
||||
Name: aws.String("InAppStreamName"), // Required
|
||||
KinesisFirehoseOutput: &kinesisanalytics.KinesisFirehoseOutput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
KinesisStreamsOutput: &kinesisanalytics.KinesisStreamsOutput{
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateApplication(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 ExampleKinesisAnalytics_DeleteApplication() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.DeleteApplicationInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
CreateTimestamp: aws.Time(time.Now()), // Required
|
||||
}
|
||||
resp, err := svc.DeleteApplication(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 ExampleKinesisAnalytics_DeleteApplicationOutput() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.DeleteApplicationOutputInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
CurrentApplicationVersionId: aws.Int64(1), // Required
|
||||
OutputId: aws.String("Id"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteApplicationOutput(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 ExampleKinesisAnalytics_DeleteApplicationReferenceDataSource() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.DeleteApplicationReferenceDataSourceInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
CurrentApplicationVersionId: aws.Int64(1), // Required
|
||||
ReferenceId: aws.String("Id"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteApplicationReferenceDataSource(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 ExampleKinesisAnalytics_DescribeApplication() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.DescribeApplicationInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeApplication(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 ExampleKinesisAnalytics_DiscoverInputSchema() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.DiscoverInputSchemaInput{
|
||||
InputStartingPositionConfiguration: &kinesisanalytics.InputStartingPositionConfiguration{ // Required
|
||||
InputStartingPosition: aws.String("InputStartingPosition"),
|
||||
},
|
||||
ResourceARN: aws.String("ResourceARN"), // Required
|
||||
RoleARN: aws.String("RoleARN"), // Required
|
||||
}
|
||||
resp, err := svc.DiscoverInputSchema(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 ExampleKinesisAnalytics_ListApplications() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.ListApplicationsInput{
|
||||
ExclusiveStartApplicationName: aws.String("ApplicationName"),
|
||||
Limit: aws.Int64(1),
|
||||
}
|
||||
resp, err := svc.ListApplications(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 ExampleKinesisAnalytics_StartApplication() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.StartApplicationInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
InputConfigurations: []*kinesisanalytics.InputConfiguration{ // Required
|
||||
{ // Required
|
||||
Id: aws.String("Id"), // Required
|
||||
InputStartingPositionConfiguration: &kinesisanalytics.InputStartingPositionConfiguration{ // Required
|
||||
InputStartingPosition: aws.String("InputStartingPosition"),
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.StartApplication(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 ExampleKinesisAnalytics_StopApplication() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.StopApplicationInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
}
|
||||
resp, err := svc.StopApplication(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 ExampleKinesisAnalytics_UpdateApplication() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := kinesisanalytics.New(sess)
|
||||
|
||||
params := &kinesisanalytics.UpdateApplicationInput{
|
||||
ApplicationName: aws.String("ApplicationName"), // Required
|
||||
ApplicationUpdate: &kinesisanalytics.ApplicationUpdate{ // Required
|
||||
ApplicationCodeUpdate: aws.String("ApplicationCode"),
|
||||
InputUpdates: []*kinesisanalytics.InputUpdate{
|
||||
{ // Required
|
||||
InputId: aws.String("Id"), // Required
|
||||
InputParallelismUpdate: &kinesisanalytics.InputParallelismUpdate{
|
||||
CountUpdate: aws.Int64(1),
|
||||
},
|
||||
InputSchemaUpdate: &kinesisanalytics.InputSchemaUpdate{
|
||||
RecordColumnUpdates: []*kinesisanalytics.RecordColumn{
|
||||
{ // Required
|
||||
Name: aws.String("RecordColumnName"), // Required
|
||||
SqlType: aws.String("RecordColumnSqlType"), // Required
|
||||
Mapping: aws.String("RecordColumnMapping"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RecordEncodingUpdate: aws.String("RecordEncoding"),
|
||||
RecordFormatUpdate: &kinesisanalytics.RecordFormat{
|
||||
RecordFormatType: aws.String("RecordFormatType"), // Required
|
||||
MappingParameters: &kinesisanalytics.MappingParameters{
|
||||
CSVMappingParameters: &kinesisanalytics.CSVMappingParameters{
|
||||
RecordColumnDelimiter: aws.String("RecordColumnDelimiter"), // Required
|
||||
RecordRowDelimiter: aws.String("RecordRowDelimiter"), // Required
|
||||
},
|
||||
JSONMappingParameters: &kinesisanalytics.JSONMappingParameters{
|
||||
RecordRowPath: aws.String("RecordRowPath"), // Required
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
KinesisFirehoseInputUpdate: &kinesisanalytics.KinesisFirehoseInputUpdate{
|
||||
ResourceARNUpdate: aws.String("ResourceARN"),
|
||||
RoleARNUpdate: aws.String("RoleARN"),
|
||||
},
|
||||
KinesisStreamsInputUpdate: &kinesisanalytics.KinesisStreamsInputUpdate{
|
||||
ResourceARNUpdate: aws.String("ResourceARN"),
|
||||
RoleARNUpdate: aws.String("RoleARN"),
|
||||
},
|
||||
NamePrefixUpdate: aws.String("InAppStreamName"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
OutputUpdates: []*kinesisanalytics.OutputUpdate{
|
||||
{ // Required
|
||||
OutputId: aws.String("Id"), // Required
|
||||
DestinationSchemaUpdate: &kinesisanalytics.DestinationSchema{
|
||||
RecordFormatType: aws.String("RecordFormatType"),
|
||||
},
|
||||
KinesisFirehoseOutputUpdate: &kinesisanalytics.KinesisFirehoseOutputUpdate{
|
||||
ResourceARNUpdate: aws.String("ResourceARN"),
|
||||
RoleARNUpdate: aws.String("RoleARN"),
|
||||
},
|
||||
KinesisStreamsOutputUpdate: &kinesisanalytics.KinesisStreamsOutputUpdate{
|
||||
ResourceARNUpdate: aws.String("ResourceARN"),
|
||||
RoleARNUpdate: aws.String("RoleARN"),
|
||||
},
|
||||
NameUpdate: aws.String("InAppStreamName"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
ReferenceDataSourceUpdates: []*kinesisanalytics.ReferenceDataSourceUpdate{
|
||||
{ // Required
|
||||
ReferenceId: aws.String("Id"), // Required
|
||||
ReferenceSchemaUpdate: &kinesisanalytics.SourceSchema{
|
||||
RecordColumns: []*kinesisanalytics.RecordColumn{ // Required
|
||||
{ // Required
|
||||
Name: aws.String("RecordColumnName"), // Required
|
||||
SqlType: aws.String("RecordColumnSqlType"), // Required
|
||||
Mapping: aws.String("RecordColumnMapping"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
RecordFormat: &kinesisanalytics.RecordFormat{ // Required
|
||||
RecordFormatType: aws.String("RecordFormatType"), // Required
|
||||
MappingParameters: &kinesisanalytics.MappingParameters{
|
||||
CSVMappingParameters: &kinesisanalytics.CSVMappingParameters{
|
||||
RecordColumnDelimiter: aws.String("RecordColumnDelimiter"), // Required
|
||||
RecordRowDelimiter: aws.String("RecordRowDelimiter"), // Required
|
||||
},
|
||||
JSONMappingParameters: &kinesisanalytics.JSONMappingParameters{
|
||||
RecordRowPath: aws.String("RecordRowPath"), // Required
|
||||
},
|
||||
},
|
||||
},
|
||||
RecordEncoding: aws.String("RecordEncoding"),
|
||||
},
|
||||
S3ReferenceDataSourceUpdate: &kinesisanalytics.S3ReferenceDataSourceUpdate{
|
||||
BucketARNUpdate: aws.String("BucketARN"),
|
||||
FileKeyUpdate: aws.String("FileKey"),
|
||||
ReferenceRoleARNUpdate: aws.String("RoleARN"),
|
||||
},
|
||||
TableNameUpdate: aws.String("InAppTableName"),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
CurrentApplicationVersionId: aws.Int64(1), // Required
|
||||
}
|
||||
resp, err := svc.UpdateApplication(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)
|
||||
}
|
||||
Generated
Vendored
+116
@@ -0,0 +1,116 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package kinesisanalyticsiface provides an interface to enable mocking the Amazon Kinesis Analytics 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 kinesisanalyticsiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/kinesisanalytics"
|
||||
)
|
||||
|
||||
// KinesisAnalyticsAPI provides an interface to enable mocking the
|
||||
// kinesisanalytics.KinesisAnalytics 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 Analytics.
|
||||
// func myFunc(svc kinesisanalyticsiface.KinesisAnalyticsAPI) bool {
|
||||
// // Make svc.AddApplicationInput request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := kinesisanalytics.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockKinesisAnalyticsClient struct {
|
||||
// kinesisanalyticsiface.KinesisAnalyticsAPI
|
||||
// }
|
||||
// func (m *mockKinesisAnalyticsClient) AddApplicationInput(input *kinesisanalytics.AddApplicationInputInput) (*kinesisanalytics.AddApplicationInputOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockKinesisAnalyticsClient{}
|
||||
//
|
||||
// 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 KinesisAnalyticsAPI interface {
|
||||
AddApplicationInput(*kinesisanalytics.AddApplicationInputInput) (*kinesisanalytics.AddApplicationInputOutput, error)
|
||||
AddApplicationInputWithContext(aws.Context, *kinesisanalytics.AddApplicationInputInput, ...request.Option) (*kinesisanalytics.AddApplicationInputOutput, error)
|
||||
AddApplicationInputRequest(*kinesisanalytics.AddApplicationInputInput) (*request.Request, *kinesisanalytics.AddApplicationInputOutput)
|
||||
|
||||
AddApplicationOutput(*kinesisanalytics.AddApplicationOutputInput) (*kinesisanalytics.AddApplicationOutputOutput, error)
|
||||
AddApplicationOutputWithContext(aws.Context, *kinesisanalytics.AddApplicationOutputInput, ...request.Option) (*kinesisanalytics.AddApplicationOutputOutput, error)
|
||||
AddApplicationOutputRequest(*kinesisanalytics.AddApplicationOutputInput) (*request.Request, *kinesisanalytics.AddApplicationOutputOutput)
|
||||
|
||||
AddApplicationReferenceDataSource(*kinesisanalytics.AddApplicationReferenceDataSourceInput) (*kinesisanalytics.AddApplicationReferenceDataSourceOutput, error)
|
||||
AddApplicationReferenceDataSourceWithContext(aws.Context, *kinesisanalytics.AddApplicationReferenceDataSourceInput, ...request.Option) (*kinesisanalytics.AddApplicationReferenceDataSourceOutput, error)
|
||||
AddApplicationReferenceDataSourceRequest(*kinesisanalytics.AddApplicationReferenceDataSourceInput) (*request.Request, *kinesisanalytics.AddApplicationReferenceDataSourceOutput)
|
||||
|
||||
CreateApplication(*kinesisanalytics.CreateApplicationInput) (*kinesisanalytics.CreateApplicationOutput, error)
|
||||
CreateApplicationWithContext(aws.Context, *kinesisanalytics.CreateApplicationInput, ...request.Option) (*kinesisanalytics.CreateApplicationOutput, error)
|
||||
CreateApplicationRequest(*kinesisanalytics.CreateApplicationInput) (*request.Request, *kinesisanalytics.CreateApplicationOutput)
|
||||
|
||||
DeleteApplication(*kinesisanalytics.DeleteApplicationInput) (*kinesisanalytics.DeleteApplicationOutput, error)
|
||||
DeleteApplicationWithContext(aws.Context, *kinesisanalytics.DeleteApplicationInput, ...request.Option) (*kinesisanalytics.DeleteApplicationOutput, error)
|
||||
DeleteApplicationRequest(*kinesisanalytics.DeleteApplicationInput) (*request.Request, *kinesisanalytics.DeleteApplicationOutput)
|
||||
|
||||
DeleteApplicationOutput(*kinesisanalytics.DeleteApplicationOutputInput) (*kinesisanalytics.DeleteApplicationOutputOutput, error)
|
||||
DeleteApplicationOutputWithContext(aws.Context, *kinesisanalytics.DeleteApplicationOutputInput, ...request.Option) (*kinesisanalytics.DeleteApplicationOutputOutput, error)
|
||||
DeleteApplicationOutputRequest(*kinesisanalytics.DeleteApplicationOutputInput) (*request.Request, *kinesisanalytics.DeleteApplicationOutputOutput)
|
||||
|
||||
DeleteApplicationReferenceDataSource(*kinesisanalytics.DeleteApplicationReferenceDataSourceInput) (*kinesisanalytics.DeleteApplicationReferenceDataSourceOutput, error)
|
||||
DeleteApplicationReferenceDataSourceWithContext(aws.Context, *kinesisanalytics.DeleteApplicationReferenceDataSourceInput, ...request.Option) (*kinesisanalytics.DeleteApplicationReferenceDataSourceOutput, error)
|
||||
DeleteApplicationReferenceDataSourceRequest(*kinesisanalytics.DeleteApplicationReferenceDataSourceInput) (*request.Request, *kinesisanalytics.DeleteApplicationReferenceDataSourceOutput)
|
||||
|
||||
DescribeApplication(*kinesisanalytics.DescribeApplicationInput) (*kinesisanalytics.DescribeApplicationOutput, error)
|
||||
DescribeApplicationWithContext(aws.Context, *kinesisanalytics.DescribeApplicationInput, ...request.Option) (*kinesisanalytics.DescribeApplicationOutput, error)
|
||||
DescribeApplicationRequest(*kinesisanalytics.DescribeApplicationInput) (*request.Request, *kinesisanalytics.DescribeApplicationOutput)
|
||||
|
||||
DiscoverInputSchema(*kinesisanalytics.DiscoverInputSchemaInput) (*kinesisanalytics.DiscoverInputSchemaOutput, error)
|
||||
DiscoverInputSchemaWithContext(aws.Context, *kinesisanalytics.DiscoverInputSchemaInput, ...request.Option) (*kinesisanalytics.DiscoverInputSchemaOutput, error)
|
||||
DiscoverInputSchemaRequest(*kinesisanalytics.DiscoverInputSchemaInput) (*request.Request, *kinesisanalytics.DiscoverInputSchemaOutput)
|
||||
|
||||
ListApplications(*kinesisanalytics.ListApplicationsInput) (*kinesisanalytics.ListApplicationsOutput, error)
|
||||
ListApplicationsWithContext(aws.Context, *kinesisanalytics.ListApplicationsInput, ...request.Option) (*kinesisanalytics.ListApplicationsOutput, error)
|
||||
ListApplicationsRequest(*kinesisanalytics.ListApplicationsInput) (*request.Request, *kinesisanalytics.ListApplicationsOutput)
|
||||
|
||||
StartApplication(*kinesisanalytics.StartApplicationInput) (*kinesisanalytics.StartApplicationOutput, error)
|
||||
StartApplicationWithContext(aws.Context, *kinesisanalytics.StartApplicationInput, ...request.Option) (*kinesisanalytics.StartApplicationOutput, error)
|
||||
StartApplicationRequest(*kinesisanalytics.StartApplicationInput) (*request.Request, *kinesisanalytics.StartApplicationOutput)
|
||||
|
||||
StopApplication(*kinesisanalytics.StopApplicationInput) (*kinesisanalytics.StopApplicationOutput, error)
|
||||
StopApplicationWithContext(aws.Context, *kinesisanalytics.StopApplicationInput, ...request.Option) (*kinesisanalytics.StopApplicationOutput, error)
|
||||
StopApplicationRequest(*kinesisanalytics.StopApplicationInput) (*request.Request, *kinesisanalytics.StopApplicationOutput)
|
||||
|
||||
UpdateApplication(*kinesisanalytics.UpdateApplicationInput) (*kinesisanalytics.UpdateApplicationOutput, error)
|
||||
UpdateApplicationWithContext(aws.Context, *kinesisanalytics.UpdateApplicationInput, ...request.Option) (*kinesisanalytics.UpdateApplicationOutput, error)
|
||||
UpdateApplicationRequest(*kinesisanalytics.UpdateApplicationInput) (*request.Request, *kinesisanalytics.UpdateApplicationOutput)
|
||||
}
|
||||
|
||||
var _ KinesisAnalyticsAPI = (*kinesisanalytics.KinesisAnalytics)(nil)
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package kinesisanalytics
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// KinesisAnalytics provides the API operation methods for making requests to
|
||||
// Amazon Kinesis Analytics. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// KinesisAnalytics methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type KinesisAnalytics 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 = "kinesisanalytics" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the KinesisAnalytics 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 KinesisAnalytics client from just a session.
|
||||
// svc := kinesisanalytics.New(mySession)
|
||||
//
|
||||
// // Create a KinesisAnalytics client with additional configuration
|
||||
// svc := kinesisanalytics.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *KinesisAnalytics {
|
||||
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) *KinesisAnalytics {
|
||||
svc := &KinesisAnalytics{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2015-08-14",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "KinesisAnalytics_20150814",
|
||||
},
|
||||
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 KinesisAnalytics operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *KinesisAnalytics) 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