mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+2561
File diff suppressed because it is too large
Load Diff
Generated
Vendored
+101
@@ -0,0 +1,101 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
// Package applicationautoscalingiface provides an interface to enable mocking the Application Auto Scaling 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 applicationautoscalingiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/applicationautoscaling"
|
||||
)
|
||||
|
||||
// ApplicationAutoScalingAPI provides an interface to enable mocking the
|
||||
// applicationautoscaling.ApplicationAutoScaling 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
|
||||
// // Application Auto Scaling.
|
||||
// func myFunc(svc applicationautoscalingiface.ApplicationAutoScalingAPI) bool {
|
||||
// // Make svc.DeleteScalingPolicy request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := applicationautoscaling.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockApplicationAutoScalingClient struct {
|
||||
// applicationautoscalingiface.ApplicationAutoScalingAPI
|
||||
// }
|
||||
// func (m *mockApplicationAutoScalingClient) DeleteScalingPolicy(input *applicationautoscaling.DeleteScalingPolicyInput) (*applicationautoscaling.DeleteScalingPolicyOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockApplicationAutoScalingClient{}
|
||||
//
|
||||
// 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 ApplicationAutoScalingAPI interface {
|
||||
DeleteScalingPolicy(*applicationautoscaling.DeleteScalingPolicyInput) (*applicationautoscaling.DeleteScalingPolicyOutput, error)
|
||||
DeleteScalingPolicyWithContext(aws.Context, *applicationautoscaling.DeleteScalingPolicyInput, ...request.Option) (*applicationautoscaling.DeleteScalingPolicyOutput, error)
|
||||
DeleteScalingPolicyRequest(*applicationautoscaling.DeleteScalingPolicyInput) (*request.Request, *applicationautoscaling.DeleteScalingPolicyOutput)
|
||||
|
||||
DeregisterScalableTarget(*applicationautoscaling.DeregisterScalableTargetInput) (*applicationautoscaling.DeregisterScalableTargetOutput, error)
|
||||
DeregisterScalableTargetWithContext(aws.Context, *applicationautoscaling.DeregisterScalableTargetInput, ...request.Option) (*applicationautoscaling.DeregisterScalableTargetOutput, error)
|
||||
DeregisterScalableTargetRequest(*applicationautoscaling.DeregisterScalableTargetInput) (*request.Request, *applicationautoscaling.DeregisterScalableTargetOutput)
|
||||
|
||||
DescribeScalableTargets(*applicationautoscaling.DescribeScalableTargetsInput) (*applicationautoscaling.DescribeScalableTargetsOutput, error)
|
||||
DescribeScalableTargetsWithContext(aws.Context, *applicationautoscaling.DescribeScalableTargetsInput, ...request.Option) (*applicationautoscaling.DescribeScalableTargetsOutput, error)
|
||||
DescribeScalableTargetsRequest(*applicationautoscaling.DescribeScalableTargetsInput) (*request.Request, *applicationautoscaling.DescribeScalableTargetsOutput)
|
||||
|
||||
DescribeScalableTargetsPages(*applicationautoscaling.DescribeScalableTargetsInput, func(*applicationautoscaling.DescribeScalableTargetsOutput, bool) bool) error
|
||||
DescribeScalableTargetsPagesWithContext(aws.Context, *applicationautoscaling.DescribeScalableTargetsInput, func(*applicationautoscaling.DescribeScalableTargetsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeScalingActivities(*applicationautoscaling.DescribeScalingActivitiesInput) (*applicationautoscaling.DescribeScalingActivitiesOutput, error)
|
||||
DescribeScalingActivitiesWithContext(aws.Context, *applicationautoscaling.DescribeScalingActivitiesInput, ...request.Option) (*applicationautoscaling.DescribeScalingActivitiesOutput, error)
|
||||
DescribeScalingActivitiesRequest(*applicationautoscaling.DescribeScalingActivitiesInput) (*request.Request, *applicationautoscaling.DescribeScalingActivitiesOutput)
|
||||
|
||||
DescribeScalingActivitiesPages(*applicationautoscaling.DescribeScalingActivitiesInput, func(*applicationautoscaling.DescribeScalingActivitiesOutput, bool) bool) error
|
||||
DescribeScalingActivitiesPagesWithContext(aws.Context, *applicationautoscaling.DescribeScalingActivitiesInput, func(*applicationautoscaling.DescribeScalingActivitiesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeScalingPolicies(*applicationautoscaling.DescribeScalingPoliciesInput) (*applicationautoscaling.DescribeScalingPoliciesOutput, error)
|
||||
DescribeScalingPoliciesWithContext(aws.Context, *applicationautoscaling.DescribeScalingPoliciesInput, ...request.Option) (*applicationautoscaling.DescribeScalingPoliciesOutput, error)
|
||||
DescribeScalingPoliciesRequest(*applicationautoscaling.DescribeScalingPoliciesInput) (*request.Request, *applicationautoscaling.DescribeScalingPoliciesOutput)
|
||||
|
||||
DescribeScalingPoliciesPages(*applicationautoscaling.DescribeScalingPoliciesInput, func(*applicationautoscaling.DescribeScalingPoliciesOutput, bool) bool) error
|
||||
DescribeScalingPoliciesPagesWithContext(aws.Context, *applicationautoscaling.DescribeScalingPoliciesInput, func(*applicationautoscaling.DescribeScalingPoliciesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
PutScalingPolicy(*applicationautoscaling.PutScalingPolicyInput) (*applicationautoscaling.PutScalingPolicyOutput, error)
|
||||
PutScalingPolicyWithContext(aws.Context, *applicationautoscaling.PutScalingPolicyInput, ...request.Option) (*applicationautoscaling.PutScalingPolicyOutput, error)
|
||||
PutScalingPolicyRequest(*applicationautoscaling.PutScalingPolicyInput) (*request.Request, *applicationautoscaling.PutScalingPolicyOutput)
|
||||
|
||||
RegisterScalableTarget(*applicationautoscaling.RegisterScalableTargetInput) (*applicationautoscaling.RegisterScalableTargetOutput, error)
|
||||
RegisterScalableTargetWithContext(aws.Context, *applicationautoscaling.RegisterScalableTargetInput, ...request.Option) (*applicationautoscaling.RegisterScalableTargetOutput, error)
|
||||
RegisterScalableTargetRequest(*applicationautoscaling.RegisterScalableTargetInput) (*request.Request, *applicationautoscaling.RegisterScalableTargetOutput)
|
||||
}
|
||||
|
||||
var _ ApplicationAutoScalingAPI = (*applicationautoscaling.ApplicationAutoScaling)(nil)
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package applicationautoscaling
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeConcurrentUpdateException for service response error code
|
||||
// "ConcurrentUpdateException".
|
||||
//
|
||||
// Concurrent updates caused an exception, for example, if you request an update
|
||||
// to an Application Auto Scaling resource that already has a pending update.
|
||||
ErrCodeConcurrentUpdateException = "ConcurrentUpdateException"
|
||||
|
||||
// ErrCodeFailedResourceAccessException for service response error code
|
||||
// "FailedResourceAccessException".
|
||||
//
|
||||
// Failed access to resources caused an exception. This exception currently
|
||||
// only applies to DescribeScalingPolicies. It is thrown when Application Auto
|
||||
// Scaling is unable to retrieve the alarms associated with a scaling policy
|
||||
// due to a client error, for example, if the role ARN specified for a scalable
|
||||
// target does not have the proper permissions to call the CloudWatch DescribeAlarms
|
||||
// (http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html)
|
||||
// API operation on behalf of your account.
|
||||
ErrCodeFailedResourceAccessException = "FailedResourceAccessException"
|
||||
|
||||
// ErrCodeInternalServiceException for service response error code
|
||||
// "InternalServiceException".
|
||||
//
|
||||
// The service encountered an internal error.
|
||||
ErrCodeInternalServiceException = "InternalServiceException"
|
||||
|
||||
// ErrCodeInvalidNextTokenException for service response error code
|
||||
// "InvalidNextTokenException".
|
||||
//
|
||||
// The next token supplied was invalid.
|
||||
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// Your account exceeded a limit. This exception is thrown when a per-account
|
||||
// resource limit is exceeded. For more information, see Application Auto Scaling
|
||||
// Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_as-app).
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeObjectNotFoundException for service response error code
|
||||
// "ObjectNotFoundException".
|
||||
//
|
||||
// The specified object could not be found. For any Put or Register API operation,
|
||||
// which depends on the existence of a scalable target, this exception is thrown
|
||||
// if the scalable target with the specified service namespace, resource ID,
|
||||
// and scalable dimension does not exist. For any Delete or Deregister API operation,
|
||||
// this exception is thrown if the resource that is to be deleted or deregistered
|
||||
// cannot be found.
|
||||
ErrCodeObjectNotFoundException = "ObjectNotFoundException"
|
||||
|
||||
// ErrCodeValidationException for service response error code
|
||||
// "ValidationException".
|
||||
//
|
||||
// An exception was thrown for a validation issue. Review the available parameters
|
||||
// for the API request.
|
||||
ErrCodeValidationException = "ValidationException"
|
||||
)
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package applicationautoscaling_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/applicationautoscaling"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleApplicationAutoScaling_DeleteScalingPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.DeleteScalingPolicyInput{
|
||||
PolicyName: aws.String("ResourceIdMaxLen1600"), // Required
|
||||
ResourceId: aws.String("ResourceIdMaxLen1600"), // Required
|
||||
ScalableDimension: aws.String("ScalableDimension"), // Required
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteScalingPolicy(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 ExampleApplicationAutoScaling_DeregisterScalableTarget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.DeregisterScalableTargetInput{
|
||||
ResourceId: aws.String("ResourceIdMaxLen1600"), // Required
|
||||
ScalableDimension: aws.String("ScalableDimension"), // Required
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
}
|
||||
resp, err := svc.DeregisterScalableTarget(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 ExampleApplicationAutoScaling_DescribeScalableTargets() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.DescribeScalableTargetsInput{
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("XmlString"),
|
||||
ResourceIds: []*string{
|
||||
aws.String("ResourceIdMaxLen1600"), // Required
|
||||
// More values...
|
||||
},
|
||||
ScalableDimension: aws.String("ScalableDimension"),
|
||||
}
|
||||
resp, err := svc.DescribeScalableTargets(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 ExampleApplicationAutoScaling_DescribeScalingActivities() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.DescribeScalingActivitiesInput{
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("XmlString"),
|
||||
ResourceId: aws.String("ResourceIdMaxLen1600"),
|
||||
ScalableDimension: aws.String("ScalableDimension"),
|
||||
}
|
||||
resp, err := svc.DescribeScalingActivities(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 ExampleApplicationAutoScaling_DescribeScalingPolicies() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.DescribeScalingPoliciesInput{
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("XmlString"),
|
||||
PolicyNames: []*string{
|
||||
aws.String("ResourceIdMaxLen1600"), // Required
|
||||
// More values...
|
||||
},
|
||||
ResourceId: aws.String("ResourceIdMaxLen1600"),
|
||||
ScalableDimension: aws.String("ScalableDimension"),
|
||||
}
|
||||
resp, err := svc.DescribeScalingPolicies(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 ExampleApplicationAutoScaling_PutScalingPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.PutScalingPolicyInput{
|
||||
PolicyName: aws.String("PolicyName"), // Required
|
||||
ResourceId: aws.String("ResourceIdMaxLen1600"), // Required
|
||||
ScalableDimension: aws.String("ScalableDimension"), // Required
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
PolicyType: aws.String("PolicyType"),
|
||||
StepScalingPolicyConfiguration: &applicationautoscaling.StepScalingPolicyConfiguration{
|
||||
AdjustmentType: aws.String("AdjustmentType"),
|
||||
Cooldown: aws.Int64(1),
|
||||
MetricAggregationType: aws.String("MetricAggregationType"),
|
||||
MinAdjustmentMagnitude: aws.Int64(1),
|
||||
StepAdjustments: []*applicationautoscaling.StepAdjustment{
|
||||
{ // Required
|
||||
ScalingAdjustment: aws.Int64(1), // Required
|
||||
MetricIntervalLowerBound: aws.Float64(1.0),
|
||||
MetricIntervalUpperBound: aws.Float64(1.0),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
}
|
||||
resp, err := svc.PutScalingPolicy(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 ExampleApplicationAutoScaling_RegisterScalableTarget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := applicationautoscaling.New(sess)
|
||||
|
||||
params := &applicationautoscaling.RegisterScalableTargetInput{
|
||||
ResourceId: aws.String("ResourceIdMaxLen1600"), // Required
|
||||
ScalableDimension: aws.String("ScalableDimension"), // Required
|
||||
ServiceNamespace: aws.String("ServiceNamespace"), // Required
|
||||
MaxCapacity: aws.Int64(1),
|
||||
MinCapacity: aws.Int64(1),
|
||||
RoleARN: aws.String("ResourceIdMaxLen1600"),
|
||||
}
|
||||
resp, err := svc.RegisterScalableTarget(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)
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package applicationautoscaling
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// With Application Auto Scaling, you can automatically scale your AWS resources.
|
||||
// The experience similar to that of Auto Scaling (https://aws.amazon.com/autoscaling/).
|
||||
// You can use Application Auto Scaling to accomplish the following tasks:
|
||||
//
|
||||
// * Define scaling policies to automatically scale your AWS resources
|
||||
//
|
||||
// * Scale your resources in response to CloudWatch alarms
|
||||
//
|
||||
// * View the history of your scaling events
|
||||
//
|
||||
// Application Auto Scaling can scale the following AWS resources:
|
||||
//
|
||||
// * Amazon ECS services. For more information, see Service Auto Scaling
|
||||
// (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html)
|
||||
// in the Amazon EC2 Container Service Developer Guide.
|
||||
//
|
||||
// * Amazon EC2 Spot fleets. For more information, see Automatic Scaling
|
||||
// for Spot Fleet (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/fleet-auto-scaling.html)
|
||||
// in the Amazon EC2 User Guide.
|
||||
//
|
||||
// * Amazon EMR clusters. For more information, see Using Automatic Scaling
|
||||
// in Amazon EMR (http://docs.aws.amazon.com/ElasticMapReduce/latest/ManagementGuide/emr-automatic-scaling.html)
|
||||
// in the Amazon EMR Management Guide.
|
||||
//
|
||||
// For a list of supported regions, see AWS Regions and Endpoints: Application
|
||||
// Auto Scaling (http://docs.aws.amazon.com/general/latest/gr/rande.html#as-app_region)
|
||||
// in the AWS General Reference.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06
|
||||
type ApplicationAutoScaling 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 = "autoscaling" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = "application-autoscaling" // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the ApplicationAutoScaling 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 ApplicationAutoScaling client from just a session.
|
||||
// svc := applicationautoscaling.New(mySession)
|
||||
//
|
||||
// // Create a ApplicationAutoScaling client with additional configuration
|
||||
// svc := applicationautoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApplicationAutoScaling {
|
||||
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) *ApplicationAutoScaling {
|
||||
if len(signingName) == 0 {
|
||||
signingName = "application-autoscaling"
|
||||
}
|
||||
svc := &ApplicationAutoScaling{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-02-06",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "AnyScaleFrontendService",
|
||||
},
|
||||
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 ApplicationAutoScaling operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *ApplicationAutoScaling) 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