Vendor aws-sdk-go (dep ensure) (#178)
This commit is contained in:
7194
vendor/github.com/aws/aws-sdk-go/service/lambda/api.go
generated
vendored
Normal file
7194
vendor/github.com/aws/aws-sdk-go/service/lambda/api.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
34
vendor/github.com/aws/aws-sdk-go/service/lambda/doc.go
generated
vendored
Normal file
34
vendor/github.com/aws/aws-sdk-go/service/lambda/doc.go
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package lambda provides the client and types for making API
|
||||
// requests to AWS Lambda.
|
||||
//
|
||||
// Overview
|
||||
//
|
||||
// This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides
|
||||
// additional information. For the service overview, see What is AWS Lambda
|
||||
// (http://docs.aws.amazon.com/lambda/latest/dg/welcome.html), and for information
|
||||
// about how the service works, see AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html)
|
||||
// in the AWS Lambda Developer Guide.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31 for more information on this service.
|
||||
//
|
||||
// See lambda package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/lambda/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact AWS Lambda with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AWS Lambda client Lambda for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/lambda/#New
|
||||
package lambda
|
||||
162
vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go
generated
vendored
Normal file
162
vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go
generated
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package lambda
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeCodeStorageExceededException for service response error code
|
||||
// "CodeStorageExceededException".
|
||||
//
|
||||
// You have exceeded your maximum total code size per account. Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html)
|
||||
ErrCodeCodeStorageExceededException = "CodeStorageExceededException"
|
||||
|
||||
// ErrCodeEC2AccessDeniedException for service response error code
|
||||
// "EC2AccessDeniedException".
|
||||
ErrCodeEC2AccessDeniedException = "EC2AccessDeniedException"
|
||||
|
||||
// ErrCodeEC2ThrottledException for service response error code
|
||||
// "EC2ThrottledException".
|
||||
//
|
||||
// AWS Lambda was throttled by Amazon EC2 during Lambda function initialization
|
||||
// using the execution role provided for the Lambda function.
|
||||
ErrCodeEC2ThrottledException = "EC2ThrottledException"
|
||||
|
||||
// ErrCodeEC2UnexpectedException for service response error code
|
||||
// "EC2UnexpectedException".
|
||||
//
|
||||
// AWS Lambda received an unexpected EC2 client exception while setting up for
|
||||
// the Lambda function.
|
||||
ErrCodeEC2UnexpectedException = "EC2UnexpectedException"
|
||||
|
||||
// ErrCodeENILimitReachedException for service response error code
|
||||
// "ENILimitReachedException".
|
||||
//
|
||||
// AWS Lambda was not able to create an Elastic Network Interface (ENI) in the
|
||||
// VPC, specified as part of Lambda function configuration, because the limit
|
||||
// for network interfaces has been reached.
|
||||
ErrCodeENILimitReachedException = "ENILimitReachedException"
|
||||
|
||||
// ErrCodeInvalidParameterValueException for service response error code
|
||||
// "InvalidParameterValueException".
|
||||
//
|
||||
// One of the parameters in the request is invalid. For example, if you provided
|
||||
// an IAM role for AWS Lambda to assume in the CreateFunction or the UpdateFunctionConfiguration
|
||||
// API, that AWS Lambda is unable to assume you will get this exception.
|
||||
ErrCodeInvalidParameterValueException = "InvalidParameterValueException"
|
||||
|
||||
// ErrCodeInvalidRequestContentException for service response error code
|
||||
// "InvalidRequestContentException".
|
||||
//
|
||||
// The request body could not be parsed as JSON.
|
||||
ErrCodeInvalidRequestContentException = "InvalidRequestContentException"
|
||||
|
||||
// ErrCodeInvalidRuntimeException for service response error code
|
||||
// "InvalidRuntimeException".
|
||||
//
|
||||
// The runtime or runtime version specified is not supported.
|
||||
ErrCodeInvalidRuntimeException = "InvalidRuntimeException"
|
||||
|
||||
// ErrCodeInvalidSecurityGroupIDException for service response error code
|
||||
// "InvalidSecurityGroupIDException".
|
||||
//
|
||||
// The Security Group ID provided in the Lambda function VPC configuration is
|
||||
// invalid.
|
||||
ErrCodeInvalidSecurityGroupIDException = "InvalidSecurityGroupIDException"
|
||||
|
||||
// ErrCodeInvalidSubnetIDException for service response error code
|
||||
// "InvalidSubnetIDException".
|
||||
//
|
||||
// The Subnet ID provided in the Lambda function VPC configuration is invalid.
|
||||
ErrCodeInvalidSubnetIDException = "InvalidSubnetIDException"
|
||||
|
||||
// ErrCodeInvalidZipFileException for service response error code
|
||||
// "InvalidZipFileException".
|
||||
//
|
||||
// AWS Lambda could not unzip the function zip file.
|
||||
ErrCodeInvalidZipFileException = "InvalidZipFileException"
|
||||
|
||||
// ErrCodeKMSAccessDeniedException for service response error code
|
||||
// "KMSAccessDeniedException".
|
||||
//
|
||||
// Lambda was unable to decrypt the environment variables because KMS access
|
||||
// was denied. Check the Lambda function's KMS permissions.
|
||||
ErrCodeKMSAccessDeniedException = "KMSAccessDeniedException"
|
||||
|
||||
// ErrCodeKMSDisabledException for service response error code
|
||||
// "KMSDisabledException".
|
||||
//
|
||||
// Lambda was unable to decrypt the environment variables because the KMS key
|
||||
// used is disabled. Check the Lambda function's KMS key settings.
|
||||
ErrCodeKMSDisabledException = "KMSDisabledException"
|
||||
|
||||
// ErrCodeKMSInvalidStateException for service response error code
|
||||
// "KMSInvalidStateException".
|
||||
//
|
||||
// Lambda was unable to decrypt the environment variables because the KMS key
|
||||
// used is in an invalid state for Decrypt. Check the function's KMS key settings.
|
||||
ErrCodeKMSInvalidStateException = "KMSInvalidStateException"
|
||||
|
||||
// ErrCodeKMSNotFoundException for service response error code
|
||||
// "KMSNotFoundException".
|
||||
//
|
||||
// Lambda was unable to decrypt the environment variables because the KMS key
|
||||
// was not found. Check the function's KMS key settings.
|
||||
ErrCodeKMSNotFoundException = "KMSNotFoundException"
|
||||
|
||||
// ErrCodePolicyLengthExceededException for service response error code
|
||||
// "PolicyLengthExceededException".
|
||||
//
|
||||
// Lambda function access policy is limited to 20 KB.
|
||||
ErrCodePolicyLengthExceededException = "PolicyLengthExceededException"
|
||||
|
||||
// ErrCodePreconditionFailedException for service response error code
|
||||
// "PreconditionFailedException".
|
||||
//
|
||||
// The RevisionId provided does not match the latest RevisionId for the Lambda
|
||||
// function or alias. Call the GetFunction or the GetAlias API to retrieve the
|
||||
// latest RevisionId for your resource.
|
||||
ErrCodePreconditionFailedException = "PreconditionFailedException"
|
||||
|
||||
// ErrCodeRequestTooLargeException for service response error code
|
||||
// "RequestTooLargeException".
|
||||
//
|
||||
// The request payload exceeded the Invoke request body JSON input limit. For
|
||||
// more information, see Limits (http://docs.aws.amazon.com/lambda/latest/dg/limits.html).
|
||||
ErrCodeRequestTooLargeException = "RequestTooLargeException"
|
||||
|
||||
// ErrCodeResourceConflictException for service response error code
|
||||
// "ResourceConflictException".
|
||||
//
|
||||
// The resource already exists.
|
||||
ErrCodeResourceConflictException = "ResourceConflictException"
|
||||
|
||||
// ErrCodeResourceNotFoundException for service response error code
|
||||
// "ResourceNotFoundException".
|
||||
//
|
||||
// The resource (for example, a Lambda function or access policy statement)
|
||||
// specified in the request does not exist.
|
||||
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
|
||||
|
||||
// ErrCodeServiceException for service response error code
|
||||
// "ServiceException".
|
||||
//
|
||||
// The AWS Lambda service encountered an internal error.
|
||||
ErrCodeServiceException = "ServiceException"
|
||||
|
||||
// ErrCodeSubnetIPAddressLimitReachedException for service response error code
|
||||
// "SubnetIPAddressLimitReachedException".
|
||||
//
|
||||
// AWS Lambda was not able to set up VPC access for the Lambda function because
|
||||
// one or more configured subnets has no available IP addresses.
|
||||
ErrCodeSubnetIPAddressLimitReachedException = "SubnetIPAddressLimitReachedException"
|
||||
|
||||
// ErrCodeTooManyRequestsException for service response error code
|
||||
// "TooManyRequestsException".
|
||||
ErrCodeTooManyRequestsException = "TooManyRequestsException"
|
||||
|
||||
// ErrCodeUnsupportedMediaTypeException for service response error code
|
||||
// "UnsupportedMediaTypeException".
|
||||
//
|
||||
// The content type of the Invoke request body is not JSON.
|
||||
ErrCodeUnsupportedMediaTypeException = "UnsupportedMediaTypeException"
|
||||
)
|
||||
902
vendor/github.com/aws/aws-sdk-go/service/lambda/examples_test.go
generated
vendored
Normal file
902
vendor/github.com/aws/aws-sdk-go/service/lambda/examples_test.go
generated
vendored
Normal file
@@ -0,0 +1,902 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package lambda_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/lambda"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ strings.Reader
|
||||
var _ aws.Config
|
||||
|
||||
func parseTime(layout, value string) *time.Time {
|
||||
t, err := time.Parse(layout, value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &t
|
||||
}
|
||||
|
||||
// add-permission
|
||||
//
|
||||
// This example adds a permission for an S3 bucket to invoke a Lambda function.
|
||||
func ExampleLambda_AddPermission_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.AddPermissionInput{
|
||||
Action: aws.String("lambda:InvokeFunction"),
|
||||
FunctionName: aws.String("MyFunction"),
|
||||
Principal: aws.String("s3.amazonaws.com"),
|
||||
SourceAccount: aws.String("123456789012"),
|
||||
SourceArn: aws.String("arn:aws:s3:::examplebucket/*"),
|
||||
StatementId: aws.String("ID-1"),
|
||||
}
|
||||
|
||||
result, err := svc.AddPermission(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeResourceConflictException:
|
||||
fmt.Println(lambda.ErrCodeResourceConflictException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodePolicyLengthExceededException:
|
||||
fmt.Println(lambda.ErrCodePolicyLengthExceededException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodePreconditionFailedException:
|
||||
fmt.Println(lambda.ErrCodePreconditionFailedException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// create-function
|
||||
//
|
||||
// This example creates a Lambda function.
|
||||
func ExampleLambda_CreateFunction_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.CreateFunctionInput{
|
||||
Code: &lambda.FunctionCode{},
|
||||
Description: aws.String(""),
|
||||
FunctionName: aws.String("MyFunction"),
|
||||
Handler: aws.String("souce_file.handler_name"),
|
||||
MemorySize: aws.Int64(128),
|
||||
Publish: aws.Bool(true),
|
||||
Role: aws.String("arn:aws:iam::123456789012:role/service-role/role-name"),
|
||||
Runtime: aws.String("nodejs4.3"),
|
||||
Timeout: aws.Int64(15),
|
||||
VpcConfig: &lambda.VpcConfig{},
|
||||
}
|
||||
|
||||
result, err := svc.CreateFunction(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeResourceConflictException:
|
||||
fmt.Println(lambda.ErrCodeResourceConflictException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeCodeStorageExceededException:
|
||||
fmt.Println(lambda.ErrCodeCodeStorageExceededException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To delete a Lambda function alias
|
||||
//
|
||||
// This operation deletes a Lambda function alias
|
||||
func ExampleLambda_DeleteAlias_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.DeleteAliasInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Name: aws.String("alias"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteAlias(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To delete a Lambda function event source mapping
|
||||
//
|
||||
// This operation deletes a Lambda function event source mapping
|
||||
func ExampleLambda_DeleteEventSourceMapping_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.DeleteEventSourceMappingInput{
|
||||
UUID: aws.String("12345kxodurf3443"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteEventSourceMapping(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To delete a Lambda function
|
||||
//
|
||||
// This operation deletes a Lambda function
|
||||
func ExampleLambda_DeleteFunction_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.DeleteFunctionInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Qualifier: aws.String("1"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteFunction(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeResourceConflictException:
|
||||
fmt.Println(lambda.ErrCodeResourceConflictException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieves a Lambda customer's account settings
|
||||
//
|
||||
// This operation retrieves a Lambda customer's account settings
|
||||
func ExampleLambda_GetAccountSettings_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.GetAccountSettingsInput{}
|
||||
|
||||
result, err := svc.GetAccountSettings(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a Lambda function alias
|
||||
//
|
||||
// This operation retrieves a Lambda function alias
|
||||
func ExampleLambda_GetAlias_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.GetAliasInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Name: aws.String("myFunctionAlias"),
|
||||
}
|
||||
|
||||
result, err := svc.GetAlias(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a Lambda function's event source mapping
|
||||
//
|
||||
// This operation retrieves a Lambda function's event source mapping
|
||||
func ExampleLambda_GetEventSourceMapping_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.GetEventSourceMappingInput{
|
||||
UUID: aws.String("123489-xxxxx-kdla8d89d7"),
|
||||
}
|
||||
|
||||
result, err := svc.GetEventSourceMapping(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a Lambda function's event source mapping
|
||||
//
|
||||
// This operation retrieves a Lambda function's event source mapping
|
||||
func ExampleLambda_GetFunction_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.GetFunctionInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Qualifier: aws.String("1"),
|
||||
}
|
||||
|
||||
result, err := svc.GetFunction(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a Lambda function's event source mapping
|
||||
//
|
||||
// This operation retrieves a Lambda function's event source mapping
|
||||
func ExampleLambda_GetFunctionConfiguration_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.GetFunctionConfigurationInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Qualifier: aws.String("1"),
|
||||
}
|
||||
|
||||
result, err := svc.GetFunctionConfiguration(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a Lambda function policy
|
||||
//
|
||||
// This operation retrieves a Lambda function policy
|
||||
func ExampleLambda_GetPolicy_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.GetPolicyInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Qualifier: aws.String("1"),
|
||||
}
|
||||
|
||||
result, err := svc.GetPolicy(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To invoke a Lambda function
|
||||
//
|
||||
// This operation invokes a Lambda function
|
||||
func ExampleLambda_Invoke_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.InvokeInput{
|
||||
ClientContext: aws.String("MyApp"),
|
||||
FunctionName: aws.String("MyFunction"),
|
||||
InvocationType: aws.String("Event"),
|
||||
LogType: aws.String("Tail"),
|
||||
Payload: []byte("fileb://file-path/input.json"),
|
||||
Qualifier: aws.String("1"),
|
||||
}
|
||||
|
||||
result, err := svc.Invoke(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidRequestContentException:
|
||||
fmt.Println(lambda.ErrCodeInvalidRequestContentException, aerr.Error())
|
||||
case lambda.ErrCodeRequestTooLargeException:
|
||||
fmt.Println(lambda.ErrCodeRequestTooLargeException, aerr.Error())
|
||||
case lambda.ErrCodeUnsupportedMediaTypeException:
|
||||
fmt.Println(lambda.ErrCodeUnsupportedMediaTypeException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeEC2UnexpectedException:
|
||||
fmt.Println(lambda.ErrCodeEC2UnexpectedException, aerr.Error())
|
||||
case lambda.ErrCodeSubnetIPAddressLimitReachedException:
|
||||
fmt.Println(lambda.ErrCodeSubnetIPAddressLimitReachedException, aerr.Error())
|
||||
case lambda.ErrCodeENILimitReachedException:
|
||||
fmt.Println(lambda.ErrCodeENILimitReachedException, aerr.Error())
|
||||
case lambda.ErrCodeEC2ThrottledException:
|
||||
fmt.Println(lambda.ErrCodeEC2ThrottledException, aerr.Error())
|
||||
case lambda.ErrCodeEC2AccessDeniedException:
|
||||
fmt.Println(lambda.ErrCodeEC2AccessDeniedException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidSubnetIDException:
|
||||
fmt.Println(lambda.ErrCodeInvalidSubnetIDException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidSecurityGroupIDException:
|
||||
fmt.Println(lambda.ErrCodeInvalidSecurityGroupIDException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidZipFileException:
|
||||
fmt.Println(lambda.ErrCodeInvalidZipFileException, aerr.Error())
|
||||
case lambda.ErrCodeKMSDisabledException:
|
||||
fmt.Println(lambda.ErrCodeKMSDisabledException, aerr.Error())
|
||||
case lambda.ErrCodeKMSInvalidStateException:
|
||||
fmt.Println(lambda.ErrCodeKMSInvalidStateException, aerr.Error())
|
||||
case lambda.ErrCodeKMSAccessDeniedException:
|
||||
fmt.Println(lambda.ErrCodeKMSAccessDeniedException, aerr.Error())
|
||||
case lambda.ErrCodeKMSNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeKMSNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidRuntimeException:
|
||||
fmt.Println(lambda.ErrCodeInvalidRuntimeException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To invoke a Lambda function asynchronously
|
||||
//
|
||||
// This operation invokes a Lambda function asynchronously
|
||||
func ExampleLambda_InvokeAsync_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.InvokeAsyncInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
InvokeArgs: aws.ReadSeekCloser(strings.NewReader("fileb://file-path/input.json")),
|
||||
}
|
||||
|
||||
result, err := svc.InvokeAsync(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidRequestContentException:
|
||||
fmt.Println(lambda.ErrCodeInvalidRequestContentException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidRuntimeException:
|
||||
fmt.Println(lambda.ErrCodeInvalidRuntimeException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a Lambda function aliases
|
||||
//
|
||||
// This operation retrieves a Lambda function's aliases
|
||||
func ExampleLambda_ListAliases_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.ListAliasesInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
FunctionVersion: aws.String("1"),
|
||||
Marker: aws.String(""),
|
||||
MaxItems: aws.Int64(123),
|
||||
}
|
||||
|
||||
result, err := svc.ListAliases(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a list of Lambda functions
|
||||
//
|
||||
// This operation retrieves a Lambda functions
|
||||
func ExampleLambda_ListFunctions_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.ListFunctionsInput{
|
||||
Marker: aws.String(""),
|
||||
MaxItems: aws.Int64(123),
|
||||
}
|
||||
|
||||
result, err := svc.ListFunctions(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To retrieve a list of Lambda function versions
|
||||
//
|
||||
// This operation retrieves a Lambda function versions
|
||||
func ExampleLambda_ListVersionsByFunction_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.ListVersionsByFunctionInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Marker: aws.String(""),
|
||||
MaxItems: aws.Int64(123),
|
||||
}
|
||||
|
||||
result, err := svc.ListVersionsByFunction(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To publish a version of a Lambda function
|
||||
//
|
||||
// This operation publishes a version of a Lambda function
|
||||
func ExampleLambda_PublishVersion_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.PublishVersionInput{
|
||||
CodeSha256: aws.String(""),
|
||||
Description: aws.String(""),
|
||||
FunctionName: aws.String("myFunction"),
|
||||
}
|
||||
|
||||
result, err := svc.PublishVersion(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeCodeStorageExceededException:
|
||||
fmt.Println(lambda.ErrCodeCodeStorageExceededException, aerr.Error())
|
||||
case lambda.ErrCodePreconditionFailedException:
|
||||
fmt.Println(lambda.ErrCodePreconditionFailedException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To remove a Lambda function's permissions
|
||||
//
|
||||
// This operation removes a Lambda function's permissions
|
||||
func ExampleLambda_RemovePermission_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.RemovePermissionInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Qualifier: aws.String("1"),
|
||||
StatementId: aws.String("role-statement-id"),
|
||||
}
|
||||
|
||||
result, err := svc.RemovePermission(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodePreconditionFailedException:
|
||||
fmt.Println(lambda.ErrCodePreconditionFailedException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To update a Lambda function alias
|
||||
//
|
||||
// This operation updates a Lambda function alias
|
||||
func ExampleLambda_UpdateAlias_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.UpdateAliasInput{
|
||||
Description: aws.String(""),
|
||||
FunctionName: aws.String("myFunction"),
|
||||
FunctionVersion: aws.String("1"),
|
||||
Name: aws.String("functionAlias"),
|
||||
}
|
||||
|
||||
result, err := svc.UpdateAlias(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodePreconditionFailedException:
|
||||
fmt.Println(lambda.ErrCodePreconditionFailedException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To update a Lambda function event source mapping
|
||||
//
|
||||
// This operation updates a Lambda function event source mapping
|
||||
func ExampleLambda_UpdateEventSourceMapping_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.UpdateEventSourceMappingInput{
|
||||
BatchSize: aws.Int64(123),
|
||||
Enabled: aws.Bool(true),
|
||||
FunctionName: aws.String("myFunction"),
|
||||
UUID: aws.String("1234xCy789012"),
|
||||
}
|
||||
|
||||
result, err := svc.UpdateEventSourceMapping(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeResourceConflictException:
|
||||
fmt.Println(lambda.ErrCodeResourceConflictException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To update a Lambda function's code
|
||||
//
|
||||
// This operation updates a Lambda function's code
|
||||
func ExampleLambda_UpdateFunctionCode_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.UpdateFunctionCodeInput{
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Publish: aws.Bool(true),
|
||||
S3Bucket: aws.String("myBucket"),
|
||||
S3Key: aws.String("myKey"),
|
||||
S3ObjectVersion: aws.String("1"),
|
||||
ZipFile: []byte("fileb://file-path/file.zip"),
|
||||
}
|
||||
|
||||
result, err := svc.UpdateFunctionCode(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeCodeStorageExceededException:
|
||||
fmt.Println(lambda.ErrCodeCodeStorageExceededException, aerr.Error())
|
||||
case lambda.ErrCodePreconditionFailedException:
|
||||
fmt.Println(lambda.ErrCodePreconditionFailedException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To update a Lambda function's configuration
|
||||
//
|
||||
// This operation updates a Lambda function's configuration
|
||||
func ExampleLambda_UpdateFunctionConfiguration_shared00() {
|
||||
svc := lambda.New(session.New())
|
||||
input := &lambda.UpdateFunctionConfigurationInput{
|
||||
Description: aws.String(""),
|
||||
FunctionName: aws.String("myFunction"),
|
||||
Handler: aws.String("index.handler"),
|
||||
MemorySize: aws.Int64(128),
|
||||
Role: aws.String("arn:aws:iam::123456789012:role/lambda_basic_execution"),
|
||||
Runtime: aws.String("python2.7"),
|
||||
Timeout: aws.Int64(123),
|
||||
VpcConfig: &lambda.VpcConfig{},
|
||||
}
|
||||
|
||||
result, err := svc.UpdateFunctionConfiguration(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case lambda.ErrCodeServiceException:
|
||||
fmt.Println(lambda.ErrCodeServiceException, aerr.Error())
|
||||
case lambda.ErrCodeResourceNotFoundException:
|
||||
fmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())
|
||||
case lambda.ErrCodeInvalidParameterValueException:
|
||||
fmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())
|
||||
case lambda.ErrCodeTooManyRequestsException:
|
||||
fmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())
|
||||
case lambda.ErrCodeResourceConflictException:
|
||||
fmt.Println(lambda.ErrCodeResourceConflictException, aerr.Error())
|
||||
case lambda.ErrCodePreconditionFailedException:
|
||||
fmt.Println(lambda.ErrCodePreconditionFailedException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
190
vendor/github.com/aws/aws-sdk-go/service/lambda/lambdaiface/interface.go
generated
vendored
Normal file
190
vendor/github.com/aws/aws-sdk-go/service/lambda/lambdaiface/interface.go
generated
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package lambdaiface provides an interface to enable mocking the AWS Lambda 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 lambdaiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/lambda"
|
||||
)
|
||||
|
||||
// LambdaAPI provides an interface to enable mocking the
|
||||
// lambda.Lambda 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 SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Lambda.
|
||||
// func myFunc(svc lambdaiface.LambdaAPI) bool {
|
||||
// // Make svc.AddPermission request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := lambda.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockLambdaClient struct {
|
||||
// lambdaiface.LambdaAPI
|
||||
// }
|
||||
// func (m *mockLambdaClient) AddPermission(input *lambda.AddPermissionInput) (*lambda.AddPermissionOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockLambdaClient{}
|
||||
//
|
||||
// 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 LambdaAPI interface {
|
||||
AddPermission(*lambda.AddPermissionInput) (*lambda.AddPermissionOutput, error)
|
||||
AddPermissionWithContext(aws.Context, *lambda.AddPermissionInput, ...request.Option) (*lambda.AddPermissionOutput, error)
|
||||
AddPermissionRequest(*lambda.AddPermissionInput) (*request.Request, *lambda.AddPermissionOutput)
|
||||
|
||||
CreateAlias(*lambda.CreateAliasInput) (*lambda.AliasConfiguration, error)
|
||||
CreateAliasWithContext(aws.Context, *lambda.CreateAliasInput, ...request.Option) (*lambda.AliasConfiguration, error)
|
||||
CreateAliasRequest(*lambda.CreateAliasInput) (*request.Request, *lambda.AliasConfiguration)
|
||||
|
||||
CreateEventSourceMapping(*lambda.CreateEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error)
|
||||
CreateEventSourceMappingWithContext(aws.Context, *lambda.CreateEventSourceMappingInput, ...request.Option) (*lambda.EventSourceMappingConfiguration, error)
|
||||
CreateEventSourceMappingRequest(*lambda.CreateEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration)
|
||||
|
||||
CreateFunction(*lambda.CreateFunctionInput) (*lambda.FunctionConfiguration, error)
|
||||
CreateFunctionWithContext(aws.Context, *lambda.CreateFunctionInput, ...request.Option) (*lambda.FunctionConfiguration, error)
|
||||
CreateFunctionRequest(*lambda.CreateFunctionInput) (*request.Request, *lambda.FunctionConfiguration)
|
||||
|
||||
DeleteAlias(*lambda.DeleteAliasInput) (*lambda.DeleteAliasOutput, error)
|
||||
DeleteAliasWithContext(aws.Context, *lambda.DeleteAliasInput, ...request.Option) (*lambda.DeleteAliasOutput, error)
|
||||
DeleteAliasRequest(*lambda.DeleteAliasInput) (*request.Request, *lambda.DeleteAliasOutput)
|
||||
|
||||
DeleteEventSourceMapping(*lambda.DeleteEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error)
|
||||
DeleteEventSourceMappingWithContext(aws.Context, *lambda.DeleteEventSourceMappingInput, ...request.Option) (*lambda.EventSourceMappingConfiguration, error)
|
||||
DeleteEventSourceMappingRequest(*lambda.DeleteEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration)
|
||||
|
||||
DeleteFunction(*lambda.DeleteFunctionInput) (*lambda.DeleteFunctionOutput, error)
|
||||
DeleteFunctionWithContext(aws.Context, *lambda.DeleteFunctionInput, ...request.Option) (*lambda.DeleteFunctionOutput, error)
|
||||
DeleteFunctionRequest(*lambda.DeleteFunctionInput) (*request.Request, *lambda.DeleteFunctionOutput)
|
||||
|
||||
DeleteFunctionConcurrency(*lambda.DeleteFunctionConcurrencyInput) (*lambda.DeleteFunctionConcurrencyOutput, error)
|
||||
DeleteFunctionConcurrencyWithContext(aws.Context, *lambda.DeleteFunctionConcurrencyInput, ...request.Option) (*lambda.DeleteFunctionConcurrencyOutput, error)
|
||||
DeleteFunctionConcurrencyRequest(*lambda.DeleteFunctionConcurrencyInput) (*request.Request, *lambda.DeleteFunctionConcurrencyOutput)
|
||||
|
||||
GetAccountSettings(*lambda.GetAccountSettingsInput) (*lambda.GetAccountSettingsOutput, error)
|
||||
GetAccountSettingsWithContext(aws.Context, *lambda.GetAccountSettingsInput, ...request.Option) (*lambda.GetAccountSettingsOutput, error)
|
||||
GetAccountSettingsRequest(*lambda.GetAccountSettingsInput) (*request.Request, *lambda.GetAccountSettingsOutput)
|
||||
|
||||
GetAlias(*lambda.GetAliasInput) (*lambda.AliasConfiguration, error)
|
||||
GetAliasWithContext(aws.Context, *lambda.GetAliasInput, ...request.Option) (*lambda.AliasConfiguration, error)
|
||||
GetAliasRequest(*lambda.GetAliasInput) (*request.Request, *lambda.AliasConfiguration)
|
||||
|
||||
GetEventSourceMapping(*lambda.GetEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error)
|
||||
GetEventSourceMappingWithContext(aws.Context, *lambda.GetEventSourceMappingInput, ...request.Option) (*lambda.EventSourceMappingConfiguration, error)
|
||||
GetEventSourceMappingRequest(*lambda.GetEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration)
|
||||
|
||||
GetFunction(*lambda.GetFunctionInput) (*lambda.GetFunctionOutput, error)
|
||||
GetFunctionWithContext(aws.Context, *lambda.GetFunctionInput, ...request.Option) (*lambda.GetFunctionOutput, error)
|
||||
GetFunctionRequest(*lambda.GetFunctionInput) (*request.Request, *lambda.GetFunctionOutput)
|
||||
|
||||
GetFunctionConfiguration(*lambda.GetFunctionConfigurationInput) (*lambda.FunctionConfiguration, error)
|
||||
GetFunctionConfigurationWithContext(aws.Context, *lambda.GetFunctionConfigurationInput, ...request.Option) (*lambda.FunctionConfiguration, error)
|
||||
GetFunctionConfigurationRequest(*lambda.GetFunctionConfigurationInput) (*request.Request, *lambda.FunctionConfiguration)
|
||||
|
||||
GetPolicy(*lambda.GetPolicyInput) (*lambda.GetPolicyOutput, error)
|
||||
GetPolicyWithContext(aws.Context, *lambda.GetPolicyInput, ...request.Option) (*lambda.GetPolicyOutput, error)
|
||||
GetPolicyRequest(*lambda.GetPolicyInput) (*request.Request, *lambda.GetPolicyOutput)
|
||||
|
||||
Invoke(*lambda.InvokeInput) (*lambda.InvokeOutput, error)
|
||||
InvokeWithContext(aws.Context, *lambda.InvokeInput, ...request.Option) (*lambda.InvokeOutput, error)
|
||||
InvokeRequest(*lambda.InvokeInput) (*request.Request, *lambda.InvokeOutput)
|
||||
|
||||
InvokeAsync(*lambda.InvokeAsyncInput) (*lambda.InvokeAsyncOutput, error)
|
||||
InvokeAsyncWithContext(aws.Context, *lambda.InvokeAsyncInput, ...request.Option) (*lambda.InvokeAsyncOutput, error)
|
||||
InvokeAsyncRequest(*lambda.InvokeAsyncInput) (*request.Request, *lambda.InvokeAsyncOutput)
|
||||
|
||||
ListAliases(*lambda.ListAliasesInput) (*lambda.ListAliasesOutput, error)
|
||||
ListAliasesWithContext(aws.Context, *lambda.ListAliasesInput, ...request.Option) (*lambda.ListAliasesOutput, error)
|
||||
ListAliasesRequest(*lambda.ListAliasesInput) (*request.Request, *lambda.ListAliasesOutput)
|
||||
|
||||
ListEventSourceMappings(*lambda.ListEventSourceMappingsInput) (*lambda.ListEventSourceMappingsOutput, error)
|
||||
ListEventSourceMappingsWithContext(aws.Context, *lambda.ListEventSourceMappingsInput, ...request.Option) (*lambda.ListEventSourceMappingsOutput, error)
|
||||
ListEventSourceMappingsRequest(*lambda.ListEventSourceMappingsInput) (*request.Request, *lambda.ListEventSourceMappingsOutput)
|
||||
|
||||
ListEventSourceMappingsPages(*lambda.ListEventSourceMappingsInput, func(*lambda.ListEventSourceMappingsOutput, bool) bool) error
|
||||
ListEventSourceMappingsPagesWithContext(aws.Context, *lambda.ListEventSourceMappingsInput, func(*lambda.ListEventSourceMappingsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListFunctions(*lambda.ListFunctionsInput) (*lambda.ListFunctionsOutput, error)
|
||||
ListFunctionsWithContext(aws.Context, *lambda.ListFunctionsInput, ...request.Option) (*lambda.ListFunctionsOutput, error)
|
||||
ListFunctionsRequest(*lambda.ListFunctionsInput) (*request.Request, *lambda.ListFunctionsOutput)
|
||||
|
||||
ListFunctionsPages(*lambda.ListFunctionsInput, func(*lambda.ListFunctionsOutput, bool) bool) error
|
||||
ListFunctionsPagesWithContext(aws.Context, *lambda.ListFunctionsInput, func(*lambda.ListFunctionsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListTags(*lambda.ListTagsInput) (*lambda.ListTagsOutput, error)
|
||||
ListTagsWithContext(aws.Context, *lambda.ListTagsInput, ...request.Option) (*lambda.ListTagsOutput, error)
|
||||
ListTagsRequest(*lambda.ListTagsInput) (*request.Request, *lambda.ListTagsOutput)
|
||||
|
||||
ListVersionsByFunction(*lambda.ListVersionsByFunctionInput) (*lambda.ListVersionsByFunctionOutput, error)
|
||||
ListVersionsByFunctionWithContext(aws.Context, *lambda.ListVersionsByFunctionInput, ...request.Option) (*lambda.ListVersionsByFunctionOutput, error)
|
||||
ListVersionsByFunctionRequest(*lambda.ListVersionsByFunctionInput) (*request.Request, *lambda.ListVersionsByFunctionOutput)
|
||||
|
||||
PublishVersion(*lambda.PublishVersionInput) (*lambda.FunctionConfiguration, error)
|
||||
PublishVersionWithContext(aws.Context, *lambda.PublishVersionInput, ...request.Option) (*lambda.FunctionConfiguration, error)
|
||||
PublishVersionRequest(*lambda.PublishVersionInput) (*request.Request, *lambda.FunctionConfiguration)
|
||||
|
||||
PutFunctionConcurrency(*lambda.PutFunctionConcurrencyInput) (*lambda.PutFunctionConcurrencyOutput, error)
|
||||
PutFunctionConcurrencyWithContext(aws.Context, *lambda.PutFunctionConcurrencyInput, ...request.Option) (*lambda.PutFunctionConcurrencyOutput, error)
|
||||
PutFunctionConcurrencyRequest(*lambda.PutFunctionConcurrencyInput) (*request.Request, *lambda.PutFunctionConcurrencyOutput)
|
||||
|
||||
RemovePermission(*lambda.RemovePermissionInput) (*lambda.RemovePermissionOutput, error)
|
||||
RemovePermissionWithContext(aws.Context, *lambda.RemovePermissionInput, ...request.Option) (*lambda.RemovePermissionOutput, error)
|
||||
RemovePermissionRequest(*lambda.RemovePermissionInput) (*request.Request, *lambda.RemovePermissionOutput)
|
||||
|
||||
TagResource(*lambda.TagResourceInput) (*lambda.TagResourceOutput, error)
|
||||
TagResourceWithContext(aws.Context, *lambda.TagResourceInput, ...request.Option) (*lambda.TagResourceOutput, error)
|
||||
TagResourceRequest(*lambda.TagResourceInput) (*request.Request, *lambda.TagResourceOutput)
|
||||
|
||||
UntagResource(*lambda.UntagResourceInput) (*lambda.UntagResourceOutput, error)
|
||||
UntagResourceWithContext(aws.Context, *lambda.UntagResourceInput, ...request.Option) (*lambda.UntagResourceOutput, error)
|
||||
UntagResourceRequest(*lambda.UntagResourceInput) (*request.Request, *lambda.UntagResourceOutput)
|
||||
|
||||
UpdateAlias(*lambda.UpdateAliasInput) (*lambda.AliasConfiguration, error)
|
||||
UpdateAliasWithContext(aws.Context, *lambda.UpdateAliasInput, ...request.Option) (*lambda.AliasConfiguration, error)
|
||||
UpdateAliasRequest(*lambda.UpdateAliasInput) (*request.Request, *lambda.AliasConfiguration)
|
||||
|
||||
UpdateEventSourceMapping(*lambda.UpdateEventSourceMappingInput) (*lambda.EventSourceMappingConfiguration, error)
|
||||
UpdateEventSourceMappingWithContext(aws.Context, *lambda.UpdateEventSourceMappingInput, ...request.Option) (*lambda.EventSourceMappingConfiguration, error)
|
||||
UpdateEventSourceMappingRequest(*lambda.UpdateEventSourceMappingInput) (*request.Request, *lambda.EventSourceMappingConfiguration)
|
||||
|
||||
UpdateFunctionCode(*lambda.UpdateFunctionCodeInput) (*lambda.FunctionConfiguration, error)
|
||||
UpdateFunctionCodeWithContext(aws.Context, *lambda.UpdateFunctionCodeInput, ...request.Option) (*lambda.FunctionConfiguration, error)
|
||||
UpdateFunctionCodeRequest(*lambda.UpdateFunctionCodeInput) (*request.Request, *lambda.FunctionConfiguration)
|
||||
|
||||
UpdateFunctionConfiguration(*lambda.UpdateFunctionConfigurationInput) (*lambda.FunctionConfiguration, error)
|
||||
UpdateFunctionConfigurationWithContext(aws.Context, *lambda.UpdateFunctionConfigurationInput, ...request.Option) (*lambda.FunctionConfiguration, error)
|
||||
UpdateFunctionConfigurationRequest(*lambda.UpdateFunctionConfigurationInput) (*request.Request, *lambda.FunctionConfiguration)
|
||||
}
|
||||
|
||||
var _ LambdaAPI = (*lambda.Lambda)(nil)
|
||||
93
vendor/github.com/aws/aws-sdk-go/service/lambda/service.go
generated
vendored
Normal file
93
vendor/github.com/aws/aws-sdk-go/service/lambda/service.go
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package lambda
|
||||
|
||||
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/restjson"
|
||||
)
|
||||
|
||||
// Lambda provides the API operation methods for making requests to
|
||||
// AWS Lambda. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// Lambda methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type Lambda 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 = "lambda" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Lambda 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 Lambda client from just a session.
|
||||
// svc := lambda.New(mySession)
|
||||
//
|
||||
// // Create a Lambda client with additional configuration
|
||||
// svc := lambda.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Lambda {
|
||||
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) *Lambda {
|
||||
svc := &Lambda{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2015-03-31",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a Lambda operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Lambda) 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