mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-31 04:30:44 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+3127
File diff suppressed because it is too large
Load Diff
+116
@@ -0,0 +1,116 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
// Package budgetsiface provides an interface to enable mocking the AWS Budgets 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 budgetsiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/budgets"
|
||||
)
|
||||
|
||||
// BudgetsAPI provides an interface to enable mocking the
|
||||
// budgets.Budgets 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
|
||||
// // AWS Budgets.
|
||||
// func myFunc(svc budgetsiface.BudgetsAPI) bool {
|
||||
// // Make svc.CreateBudget request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := budgets.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockBudgetsClient struct {
|
||||
// budgetsiface.BudgetsAPI
|
||||
// }
|
||||
// func (m *mockBudgetsClient) CreateBudget(input *budgets.CreateBudgetInput) (*budgets.CreateBudgetOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockBudgetsClient{}
|
||||
//
|
||||
// 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 BudgetsAPI interface {
|
||||
CreateBudget(*budgets.CreateBudgetInput) (*budgets.CreateBudgetOutput, error)
|
||||
CreateBudgetWithContext(aws.Context, *budgets.CreateBudgetInput, ...request.Option) (*budgets.CreateBudgetOutput, error)
|
||||
CreateBudgetRequest(*budgets.CreateBudgetInput) (*request.Request, *budgets.CreateBudgetOutput)
|
||||
|
||||
CreateNotification(*budgets.CreateNotificationInput) (*budgets.CreateNotificationOutput, error)
|
||||
CreateNotificationWithContext(aws.Context, *budgets.CreateNotificationInput, ...request.Option) (*budgets.CreateNotificationOutput, error)
|
||||
CreateNotificationRequest(*budgets.CreateNotificationInput) (*request.Request, *budgets.CreateNotificationOutput)
|
||||
|
||||
CreateSubscriber(*budgets.CreateSubscriberInput) (*budgets.CreateSubscriberOutput, error)
|
||||
CreateSubscriberWithContext(aws.Context, *budgets.CreateSubscriberInput, ...request.Option) (*budgets.CreateSubscriberOutput, error)
|
||||
CreateSubscriberRequest(*budgets.CreateSubscriberInput) (*request.Request, *budgets.CreateSubscriberOutput)
|
||||
|
||||
DeleteBudget(*budgets.DeleteBudgetInput) (*budgets.DeleteBudgetOutput, error)
|
||||
DeleteBudgetWithContext(aws.Context, *budgets.DeleteBudgetInput, ...request.Option) (*budgets.DeleteBudgetOutput, error)
|
||||
DeleteBudgetRequest(*budgets.DeleteBudgetInput) (*request.Request, *budgets.DeleteBudgetOutput)
|
||||
|
||||
DeleteNotification(*budgets.DeleteNotificationInput) (*budgets.DeleteNotificationOutput, error)
|
||||
DeleteNotificationWithContext(aws.Context, *budgets.DeleteNotificationInput, ...request.Option) (*budgets.DeleteNotificationOutput, error)
|
||||
DeleteNotificationRequest(*budgets.DeleteNotificationInput) (*request.Request, *budgets.DeleteNotificationOutput)
|
||||
|
||||
DeleteSubscriber(*budgets.DeleteSubscriberInput) (*budgets.DeleteSubscriberOutput, error)
|
||||
DeleteSubscriberWithContext(aws.Context, *budgets.DeleteSubscriberInput, ...request.Option) (*budgets.DeleteSubscriberOutput, error)
|
||||
DeleteSubscriberRequest(*budgets.DeleteSubscriberInput) (*request.Request, *budgets.DeleteSubscriberOutput)
|
||||
|
||||
DescribeBudget(*budgets.DescribeBudgetInput) (*budgets.DescribeBudgetOutput, error)
|
||||
DescribeBudgetWithContext(aws.Context, *budgets.DescribeBudgetInput, ...request.Option) (*budgets.DescribeBudgetOutput, error)
|
||||
DescribeBudgetRequest(*budgets.DescribeBudgetInput) (*request.Request, *budgets.DescribeBudgetOutput)
|
||||
|
||||
DescribeBudgets(*budgets.DescribeBudgetsInput) (*budgets.DescribeBudgetsOutput, error)
|
||||
DescribeBudgetsWithContext(aws.Context, *budgets.DescribeBudgetsInput, ...request.Option) (*budgets.DescribeBudgetsOutput, error)
|
||||
DescribeBudgetsRequest(*budgets.DescribeBudgetsInput) (*request.Request, *budgets.DescribeBudgetsOutput)
|
||||
|
||||
DescribeNotificationsForBudget(*budgets.DescribeNotificationsForBudgetInput) (*budgets.DescribeNotificationsForBudgetOutput, error)
|
||||
DescribeNotificationsForBudgetWithContext(aws.Context, *budgets.DescribeNotificationsForBudgetInput, ...request.Option) (*budgets.DescribeNotificationsForBudgetOutput, error)
|
||||
DescribeNotificationsForBudgetRequest(*budgets.DescribeNotificationsForBudgetInput) (*request.Request, *budgets.DescribeNotificationsForBudgetOutput)
|
||||
|
||||
DescribeSubscribersForNotification(*budgets.DescribeSubscribersForNotificationInput) (*budgets.DescribeSubscribersForNotificationOutput, error)
|
||||
DescribeSubscribersForNotificationWithContext(aws.Context, *budgets.DescribeSubscribersForNotificationInput, ...request.Option) (*budgets.DescribeSubscribersForNotificationOutput, error)
|
||||
DescribeSubscribersForNotificationRequest(*budgets.DescribeSubscribersForNotificationInput) (*request.Request, *budgets.DescribeSubscribersForNotificationOutput)
|
||||
|
||||
UpdateBudget(*budgets.UpdateBudgetInput) (*budgets.UpdateBudgetOutput, error)
|
||||
UpdateBudgetWithContext(aws.Context, *budgets.UpdateBudgetInput, ...request.Option) (*budgets.UpdateBudgetOutput, error)
|
||||
UpdateBudgetRequest(*budgets.UpdateBudgetInput) (*request.Request, *budgets.UpdateBudgetOutput)
|
||||
|
||||
UpdateNotification(*budgets.UpdateNotificationInput) (*budgets.UpdateNotificationOutput, error)
|
||||
UpdateNotificationWithContext(aws.Context, *budgets.UpdateNotificationInput, ...request.Option) (*budgets.UpdateNotificationOutput, error)
|
||||
UpdateNotificationRequest(*budgets.UpdateNotificationInput) (*request.Request, *budgets.UpdateNotificationOutput)
|
||||
|
||||
UpdateSubscriber(*budgets.UpdateSubscriberInput) (*budgets.UpdateSubscriberOutput, error)
|
||||
UpdateSubscriberWithContext(aws.Context, *budgets.UpdateSubscriberInput, ...request.Option) (*budgets.UpdateSubscriberOutput, error)
|
||||
UpdateSubscriberRequest(*budgets.UpdateSubscriberInput) (*request.Request, *budgets.UpdateSubscriberOutput)
|
||||
}
|
||||
|
||||
var _ BudgetsAPI = (*budgets.Budgets)(nil)
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package budgets
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeCreationLimitExceededException for service response error code
|
||||
// "CreationLimitExceededException".
|
||||
//
|
||||
// The exception is thrown when customer tries to create a record (e.g. budget),
|
||||
// but the number this record already exceeds the limitation.
|
||||
ErrCodeCreationLimitExceededException = "CreationLimitExceededException"
|
||||
|
||||
// ErrCodeDuplicateRecordException for service response error code
|
||||
// "DuplicateRecordException".
|
||||
//
|
||||
// The exception is thrown when customer tries to create a record (e.g. budget)
|
||||
// that already exists.
|
||||
ErrCodeDuplicateRecordException = "DuplicateRecordException"
|
||||
|
||||
// ErrCodeExpiredNextTokenException for service response error code
|
||||
// "ExpiredNextTokenException".
|
||||
//
|
||||
// This exception is thrown if the paging token is expired - past its TTL
|
||||
ErrCodeExpiredNextTokenException = "ExpiredNextTokenException"
|
||||
|
||||
// ErrCodeInternalErrorException for service response error code
|
||||
// "InternalErrorException".
|
||||
//
|
||||
// This exception is thrown on an unknown internal failure.
|
||||
ErrCodeInternalErrorException = "InternalErrorException"
|
||||
|
||||
// ErrCodeInvalidNextTokenException for service response error code
|
||||
// "InvalidNextTokenException".
|
||||
//
|
||||
// This exception is thrown if paging token signature didn't match the token,
|
||||
// or the paging token isn't for this request
|
||||
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
|
||||
|
||||
// ErrCodeInvalidParameterException for service response error code
|
||||
// "InvalidParameterException".
|
||||
//
|
||||
// This exception is thrown if any request is given an invalid parameter. E.g.,
|
||||
// if a required Date field is null.
|
||||
ErrCodeInvalidParameterException = "InvalidParameterException"
|
||||
|
||||
// ErrCodeNotFoundException for service response error code
|
||||
// "NotFoundException".
|
||||
//
|
||||
// This exception is thrown if a requested entity is not found. E.g., if a budget
|
||||
// id doesn't exist for an account ID.
|
||||
ErrCodeNotFoundException = "NotFoundException"
|
||||
)
|
||||
+455
@@ -0,0 +1,455 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package budgets_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/budgets"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleBudgets_CreateBudget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.CreateBudgetInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
Budget: &budgets.Budget{ // Required
|
||||
BudgetLimit: &budgets.Spend{ // Required
|
||||
Amount: aws.String("NumericValue"), // Required
|
||||
Unit: aws.String("GenericString"), // Required
|
||||
},
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
BudgetType: aws.String("BudgetType"), // Required
|
||||
CostTypes: &budgets.CostTypes{ // Required
|
||||
IncludeSubscription: aws.Bool(true), // Required
|
||||
IncludeTax: aws.Bool(true), // Required
|
||||
UseBlended: aws.Bool(true), // Required
|
||||
},
|
||||
TimePeriod: &budgets.TimePeriod{ // Required
|
||||
End: aws.Time(time.Now()), // Required
|
||||
Start: aws.Time(time.Now()), // Required
|
||||
},
|
||||
TimeUnit: aws.String("TimeUnit"), // Required
|
||||
CalculatedSpend: &budgets.CalculatedSpend{
|
||||
ActualSpend: &budgets.Spend{ // Required
|
||||
Amount: aws.String("NumericValue"), // Required
|
||||
Unit: aws.String("GenericString"), // Required
|
||||
},
|
||||
ForecastedSpend: &budgets.Spend{
|
||||
Amount: aws.String("NumericValue"), // Required
|
||||
Unit: aws.String("GenericString"), // Required
|
||||
},
|
||||
},
|
||||
CostFilters: map[string][]*string{
|
||||
"Key": { // Required
|
||||
aws.String("GenericString"), // Required
|
||||
// More values...
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
NotificationsWithSubscribers: []*budgets.NotificationWithSubscribers{
|
||||
{ // Required
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
Subscribers: []*budgets.Subscriber{ // Required
|
||||
{ // Required
|
||||
Address: aws.String("GenericString"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateBudget(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 ExampleBudgets_CreateNotification() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.CreateNotificationInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
Subscribers: []*budgets.Subscriber{ // Required
|
||||
{ // Required
|
||||
Address: aws.String("GenericString"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateNotification(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 ExampleBudgets_CreateSubscriber() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.CreateSubscriberInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
Subscriber: &budgets.Subscriber{ // Required
|
||||
Address: aws.String("GenericString"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
},
|
||||
}
|
||||
resp, err := svc.CreateSubscriber(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 ExampleBudgets_DeleteBudget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DeleteBudgetInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteBudget(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 ExampleBudgets_DeleteNotification() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DeleteNotificationInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
}
|
||||
resp, err := svc.DeleteNotification(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 ExampleBudgets_DeleteSubscriber() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DeleteSubscriberInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
Subscriber: &budgets.Subscriber{ // Required
|
||||
Address: aws.String("GenericString"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
},
|
||||
}
|
||||
resp, err := svc.DeleteSubscriber(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 ExampleBudgets_DescribeBudget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DescribeBudgetInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeBudget(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 ExampleBudgets_DescribeBudgets() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DescribeBudgetsInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("GenericString"),
|
||||
}
|
||||
resp, err := svc.DescribeBudgets(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 ExampleBudgets_DescribeNotificationsForBudget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DescribeNotificationsForBudgetInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("GenericString"),
|
||||
}
|
||||
resp, err := svc.DescribeNotificationsForBudget(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 ExampleBudgets_DescribeSubscribersForNotification() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.DescribeSubscribersForNotificationInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("GenericString"),
|
||||
}
|
||||
resp, err := svc.DescribeSubscribersForNotification(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 ExampleBudgets_UpdateBudget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.UpdateBudgetInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
NewBudget: &budgets.Budget{ // Required
|
||||
BudgetLimit: &budgets.Spend{ // Required
|
||||
Amount: aws.String("NumericValue"), // Required
|
||||
Unit: aws.String("GenericString"), // Required
|
||||
},
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
BudgetType: aws.String("BudgetType"), // Required
|
||||
CostTypes: &budgets.CostTypes{ // Required
|
||||
IncludeSubscription: aws.Bool(true), // Required
|
||||
IncludeTax: aws.Bool(true), // Required
|
||||
UseBlended: aws.Bool(true), // Required
|
||||
},
|
||||
TimePeriod: &budgets.TimePeriod{ // Required
|
||||
End: aws.Time(time.Now()), // Required
|
||||
Start: aws.Time(time.Now()), // Required
|
||||
},
|
||||
TimeUnit: aws.String("TimeUnit"), // Required
|
||||
CalculatedSpend: &budgets.CalculatedSpend{
|
||||
ActualSpend: &budgets.Spend{ // Required
|
||||
Amount: aws.String("NumericValue"), // Required
|
||||
Unit: aws.String("GenericString"), // Required
|
||||
},
|
||||
ForecastedSpend: &budgets.Spend{
|
||||
Amount: aws.String("NumericValue"), // Required
|
||||
Unit: aws.String("GenericString"), // Required
|
||||
},
|
||||
},
|
||||
CostFilters: map[string][]*string{
|
||||
"Key": { // Required
|
||||
aws.String("GenericString"), // Required
|
||||
// More values...
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
},
|
||||
}
|
||||
resp, err := svc.UpdateBudget(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 ExampleBudgets_UpdateNotification() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.UpdateNotificationInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
NewNotification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
OldNotification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
}
|
||||
resp, err := svc.UpdateNotification(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 ExampleBudgets_UpdateSubscriber() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := budgets.New(sess)
|
||||
|
||||
params := &budgets.UpdateSubscriberInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
BudgetName: aws.String("BudgetName"), // Required
|
||||
NewSubscriber: &budgets.Subscriber{ // Required
|
||||
Address: aws.String("GenericString"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
},
|
||||
Notification: &budgets.Notification{ // Required
|
||||
ComparisonOperator: aws.String("ComparisonOperator"), // Required
|
||||
NotificationType: aws.String("NotificationType"), // Required
|
||||
Threshold: aws.Float64(1.0), // Required
|
||||
},
|
||||
OldSubscriber: &budgets.Subscriber{ // Required
|
||||
Address: aws.String("GenericString"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
},
|
||||
}
|
||||
resp, err := svc.UpdateSubscriber(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package budgets
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// All public APIs for AWS Budgets
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
type Budgets 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 = "budgets" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Budgets 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 Budgets client from just a session.
|
||||
// svc := budgets.New(mySession)
|
||||
//
|
||||
// // Create a Budgets client with additional configuration
|
||||
// svc := budgets.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Budgets {
|
||||
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) *Budgets {
|
||||
svc := &Budgets{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-10-20",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "AWSBudgetServiceGateway",
|
||||
},
|
||||
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 Budgets operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Budgets) 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