mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-01 04:40:38 +00:00
Update vendored deps, including AWS SDK, openpgp, ftp, ...
This commit is contained in:
+7989
File diff suppressed because it is too large
Load Diff
+29
@@ -0,0 +1,29 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package guardduty provides the client and types for making API
|
||||
// requests to Amazon GuardDuty.
|
||||
//
|
||||
// Assess, monitor, manage, and remediate security issues across your AWS infrastructure,
|
||||
// applications, and data.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28 for more information on this service.
|
||||
//
|
||||
// See guardduty package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/guardduty/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact Amazon GuardDuty 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 Amazon GuardDuty client GuardDuty for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/guardduty/#New
|
||||
package guardduty
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package guardduty
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeBadRequestException for service response error code
|
||||
// "BadRequestException".
|
||||
//
|
||||
// Error response object.
|
||||
ErrCodeBadRequestException = "BadRequestException"
|
||||
|
||||
// ErrCodeInternalServerErrorException for service response error code
|
||||
// "InternalServerErrorException".
|
||||
//
|
||||
// Error response object.
|
||||
ErrCodeInternalServerErrorException = "InternalServerErrorException"
|
||||
)
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package guarddutyiface provides an interface to enable mocking the Amazon GuardDuty 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 guarddutyiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/guardduty"
|
||||
)
|
||||
|
||||
// GuardDutyAPI provides an interface to enable mocking the
|
||||
// guardduty.GuardDuty 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
|
||||
// // Amazon GuardDuty.
|
||||
// func myFunc(svc guarddutyiface.GuardDutyAPI) bool {
|
||||
// // Make svc.AcceptInvitation request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := guardduty.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockGuardDutyClient struct {
|
||||
// guarddutyiface.GuardDutyAPI
|
||||
// }
|
||||
// func (m *mockGuardDutyClient) AcceptInvitation(input *guardduty.AcceptInvitationInput) (*guardduty.AcceptInvitationOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockGuardDutyClient{}
|
||||
//
|
||||
// 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 GuardDutyAPI interface {
|
||||
AcceptInvitation(*guardduty.AcceptInvitationInput) (*guardduty.AcceptInvitationOutput, error)
|
||||
AcceptInvitationWithContext(aws.Context, *guardduty.AcceptInvitationInput, ...request.Option) (*guardduty.AcceptInvitationOutput, error)
|
||||
AcceptInvitationRequest(*guardduty.AcceptInvitationInput) (*request.Request, *guardduty.AcceptInvitationOutput)
|
||||
|
||||
ArchiveFindings(*guardduty.ArchiveFindingsInput) (*guardduty.ArchiveFindingsOutput, error)
|
||||
ArchiveFindingsWithContext(aws.Context, *guardduty.ArchiveFindingsInput, ...request.Option) (*guardduty.ArchiveFindingsOutput, error)
|
||||
ArchiveFindingsRequest(*guardduty.ArchiveFindingsInput) (*request.Request, *guardduty.ArchiveFindingsOutput)
|
||||
|
||||
CreateDetector(*guardduty.CreateDetectorInput) (*guardduty.CreateDetectorOutput, error)
|
||||
CreateDetectorWithContext(aws.Context, *guardduty.CreateDetectorInput, ...request.Option) (*guardduty.CreateDetectorOutput, error)
|
||||
CreateDetectorRequest(*guardduty.CreateDetectorInput) (*request.Request, *guardduty.CreateDetectorOutput)
|
||||
|
||||
CreateIPSet(*guardduty.CreateIPSetInput) (*guardduty.CreateIPSetOutput, error)
|
||||
CreateIPSetWithContext(aws.Context, *guardduty.CreateIPSetInput, ...request.Option) (*guardduty.CreateIPSetOutput, error)
|
||||
CreateIPSetRequest(*guardduty.CreateIPSetInput) (*request.Request, *guardduty.CreateIPSetOutput)
|
||||
|
||||
CreateMembers(*guardduty.CreateMembersInput) (*guardduty.CreateMembersOutput, error)
|
||||
CreateMembersWithContext(aws.Context, *guardduty.CreateMembersInput, ...request.Option) (*guardduty.CreateMembersOutput, error)
|
||||
CreateMembersRequest(*guardduty.CreateMembersInput) (*request.Request, *guardduty.CreateMembersOutput)
|
||||
|
||||
CreateSampleFindings(*guardduty.CreateSampleFindingsInput) (*guardduty.CreateSampleFindingsOutput, error)
|
||||
CreateSampleFindingsWithContext(aws.Context, *guardduty.CreateSampleFindingsInput, ...request.Option) (*guardduty.CreateSampleFindingsOutput, error)
|
||||
CreateSampleFindingsRequest(*guardduty.CreateSampleFindingsInput) (*request.Request, *guardduty.CreateSampleFindingsOutput)
|
||||
|
||||
CreateThreatIntelSet(*guardduty.CreateThreatIntelSetInput) (*guardduty.CreateThreatIntelSetOutput, error)
|
||||
CreateThreatIntelSetWithContext(aws.Context, *guardduty.CreateThreatIntelSetInput, ...request.Option) (*guardduty.CreateThreatIntelSetOutput, error)
|
||||
CreateThreatIntelSetRequest(*guardduty.CreateThreatIntelSetInput) (*request.Request, *guardduty.CreateThreatIntelSetOutput)
|
||||
|
||||
DeclineInvitations(*guardduty.DeclineInvitationsInput) (*guardduty.DeclineInvitationsOutput, error)
|
||||
DeclineInvitationsWithContext(aws.Context, *guardduty.DeclineInvitationsInput, ...request.Option) (*guardduty.DeclineInvitationsOutput, error)
|
||||
DeclineInvitationsRequest(*guardduty.DeclineInvitationsInput) (*request.Request, *guardduty.DeclineInvitationsOutput)
|
||||
|
||||
DeleteDetector(*guardduty.DeleteDetectorInput) (*guardduty.DeleteDetectorOutput, error)
|
||||
DeleteDetectorWithContext(aws.Context, *guardduty.DeleteDetectorInput, ...request.Option) (*guardduty.DeleteDetectorOutput, error)
|
||||
DeleteDetectorRequest(*guardduty.DeleteDetectorInput) (*request.Request, *guardduty.DeleteDetectorOutput)
|
||||
|
||||
DeleteIPSet(*guardduty.DeleteIPSetInput) (*guardduty.DeleteIPSetOutput, error)
|
||||
DeleteIPSetWithContext(aws.Context, *guardduty.DeleteIPSetInput, ...request.Option) (*guardduty.DeleteIPSetOutput, error)
|
||||
DeleteIPSetRequest(*guardduty.DeleteIPSetInput) (*request.Request, *guardduty.DeleteIPSetOutput)
|
||||
|
||||
DeleteInvitations(*guardduty.DeleteInvitationsInput) (*guardduty.DeleteInvitationsOutput, error)
|
||||
DeleteInvitationsWithContext(aws.Context, *guardduty.DeleteInvitationsInput, ...request.Option) (*guardduty.DeleteInvitationsOutput, error)
|
||||
DeleteInvitationsRequest(*guardduty.DeleteInvitationsInput) (*request.Request, *guardduty.DeleteInvitationsOutput)
|
||||
|
||||
DeleteMembers(*guardduty.DeleteMembersInput) (*guardduty.DeleteMembersOutput, error)
|
||||
DeleteMembersWithContext(aws.Context, *guardduty.DeleteMembersInput, ...request.Option) (*guardduty.DeleteMembersOutput, error)
|
||||
DeleteMembersRequest(*guardduty.DeleteMembersInput) (*request.Request, *guardduty.DeleteMembersOutput)
|
||||
|
||||
DeleteThreatIntelSet(*guardduty.DeleteThreatIntelSetInput) (*guardduty.DeleteThreatIntelSetOutput, error)
|
||||
DeleteThreatIntelSetWithContext(aws.Context, *guardduty.DeleteThreatIntelSetInput, ...request.Option) (*guardduty.DeleteThreatIntelSetOutput, error)
|
||||
DeleteThreatIntelSetRequest(*guardduty.DeleteThreatIntelSetInput) (*request.Request, *guardduty.DeleteThreatIntelSetOutput)
|
||||
|
||||
DisassociateFromMasterAccount(*guardduty.DisassociateFromMasterAccountInput) (*guardduty.DisassociateFromMasterAccountOutput, error)
|
||||
DisassociateFromMasterAccountWithContext(aws.Context, *guardduty.DisassociateFromMasterAccountInput, ...request.Option) (*guardduty.DisassociateFromMasterAccountOutput, error)
|
||||
DisassociateFromMasterAccountRequest(*guardduty.DisassociateFromMasterAccountInput) (*request.Request, *guardduty.DisassociateFromMasterAccountOutput)
|
||||
|
||||
DisassociateMembers(*guardduty.DisassociateMembersInput) (*guardduty.DisassociateMembersOutput, error)
|
||||
DisassociateMembersWithContext(aws.Context, *guardduty.DisassociateMembersInput, ...request.Option) (*guardduty.DisassociateMembersOutput, error)
|
||||
DisassociateMembersRequest(*guardduty.DisassociateMembersInput) (*request.Request, *guardduty.DisassociateMembersOutput)
|
||||
|
||||
GetDetector(*guardduty.GetDetectorInput) (*guardduty.GetDetectorOutput, error)
|
||||
GetDetectorWithContext(aws.Context, *guardduty.GetDetectorInput, ...request.Option) (*guardduty.GetDetectorOutput, error)
|
||||
GetDetectorRequest(*guardduty.GetDetectorInput) (*request.Request, *guardduty.GetDetectorOutput)
|
||||
|
||||
GetFindings(*guardduty.GetFindingsInput) (*guardduty.GetFindingsOutput, error)
|
||||
GetFindingsWithContext(aws.Context, *guardduty.GetFindingsInput, ...request.Option) (*guardduty.GetFindingsOutput, error)
|
||||
GetFindingsRequest(*guardduty.GetFindingsInput) (*request.Request, *guardduty.GetFindingsOutput)
|
||||
|
||||
GetFindingsStatistics(*guardduty.GetFindingsStatisticsInput) (*guardduty.GetFindingsStatisticsOutput, error)
|
||||
GetFindingsStatisticsWithContext(aws.Context, *guardduty.GetFindingsStatisticsInput, ...request.Option) (*guardduty.GetFindingsStatisticsOutput, error)
|
||||
GetFindingsStatisticsRequest(*guardduty.GetFindingsStatisticsInput) (*request.Request, *guardduty.GetFindingsStatisticsOutput)
|
||||
|
||||
GetIPSet(*guardduty.GetIPSetInput) (*guardduty.GetIPSetOutput, error)
|
||||
GetIPSetWithContext(aws.Context, *guardduty.GetIPSetInput, ...request.Option) (*guardduty.GetIPSetOutput, error)
|
||||
GetIPSetRequest(*guardduty.GetIPSetInput) (*request.Request, *guardduty.GetIPSetOutput)
|
||||
|
||||
GetInvitationsCount(*guardduty.GetInvitationsCountInput) (*guardduty.GetInvitationsCountOutput, error)
|
||||
GetInvitationsCountWithContext(aws.Context, *guardduty.GetInvitationsCountInput, ...request.Option) (*guardduty.GetInvitationsCountOutput, error)
|
||||
GetInvitationsCountRequest(*guardduty.GetInvitationsCountInput) (*request.Request, *guardduty.GetInvitationsCountOutput)
|
||||
|
||||
GetMasterAccount(*guardduty.GetMasterAccountInput) (*guardduty.GetMasterAccountOutput, error)
|
||||
GetMasterAccountWithContext(aws.Context, *guardduty.GetMasterAccountInput, ...request.Option) (*guardduty.GetMasterAccountOutput, error)
|
||||
GetMasterAccountRequest(*guardduty.GetMasterAccountInput) (*request.Request, *guardduty.GetMasterAccountOutput)
|
||||
|
||||
GetMembers(*guardduty.GetMembersInput) (*guardduty.GetMembersOutput, error)
|
||||
GetMembersWithContext(aws.Context, *guardduty.GetMembersInput, ...request.Option) (*guardduty.GetMembersOutput, error)
|
||||
GetMembersRequest(*guardduty.GetMembersInput) (*request.Request, *guardduty.GetMembersOutput)
|
||||
|
||||
GetThreatIntelSet(*guardduty.GetThreatIntelSetInput) (*guardduty.GetThreatIntelSetOutput, error)
|
||||
GetThreatIntelSetWithContext(aws.Context, *guardduty.GetThreatIntelSetInput, ...request.Option) (*guardduty.GetThreatIntelSetOutput, error)
|
||||
GetThreatIntelSetRequest(*guardduty.GetThreatIntelSetInput) (*request.Request, *guardduty.GetThreatIntelSetOutput)
|
||||
|
||||
InviteMembers(*guardduty.InviteMembersInput) (*guardduty.InviteMembersOutput, error)
|
||||
InviteMembersWithContext(aws.Context, *guardduty.InviteMembersInput, ...request.Option) (*guardduty.InviteMembersOutput, error)
|
||||
InviteMembersRequest(*guardduty.InviteMembersInput) (*request.Request, *guardduty.InviteMembersOutput)
|
||||
|
||||
ListDetectors(*guardduty.ListDetectorsInput) (*guardduty.ListDetectorsOutput, error)
|
||||
ListDetectorsWithContext(aws.Context, *guardduty.ListDetectorsInput, ...request.Option) (*guardduty.ListDetectorsOutput, error)
|
||||
ListDetectorsRequest(*guardduty.ListDetectorsInput) (*request.Request, *guardduty.ListDetectorsOutput)
|
||||
|
||||
ListDetectorsPages(*guardduty.ListDetectorsInput, func(*guardduty.ListDetectorsOutput, bool) bool) error
|
||||
ListDetectorsPagesWithContext(aws.Context, *guardduty.ListDetectorsInput, func(*guardduty.ListDetectorsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListFindings(*guardduty.ListFindingsInput) (*guardduty.ListFindingsOutput, error)
|
||||
ListFindingsWithContext(aws.Context, *guardduty.ListFindingsInput, ...request.Option) (*guardduty.ListFindingsOutput, error)
|
||||
ListFindingsRequest(*guardduty.ListFindingsInput) (*request.Request, *guardduty.ListFindingsOutput)
|
||||
|
||||
ListFindingsPages(*guardduty.ListFindingsInput, func(*guardduty.ListFindingsOutput, bool) bool) error
|
||||
ListFindingsPagesWithContext(aws.Context, *guardduty.ListFindingsInput, func(*guardduty.ListFindingsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListIPSets(*guardduty.ListIPSetsInput) (*guardduty.ListIPSetsOutput, error)
|
||||
ListIPSetsWithContext(aws.Context, *guardduty.ListIPSetsInput, ...request.Option) (*guardduty.ListIPSetsOutput, error)
|
||||
ListIPSetsRequest(*guardduty.ListIPSetsInput) (*request.Request, *guardduty.ListIPSetsOutput)
|
||||
|
||||
ListIPSetsPages(*guardduty.ListIPSetsInput, func(*guardduty.ListIPSetsOutput, bool) bool) error
|
||||
ListIPSetsPagesWithContext(aws.Context, *guardduty.ListIPSetsInput, func(*guardduty.ListIPSetsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListInvitations(*guardduty.ListInvitationsInput) (*guardduty.ListInvitationsOutput, error)
|
||||
ListInvitationsWithContext(aws.Context, *guardduty.ListInvitationsInput, ...request.Option) (*guardduty.ListInvitationsOutput, error)
|
||||
ListInvitationsRequest(*guardduty.ListInvitationsInput) (*request.Request, *guardduty.ListInvitationsOutput)
|
||||
|
||||
ListInvitationsPages(*guardduty.ListInvitationsInput, func(*guardduty.ListInvitationsOutput, bool) bool) error
|
||||
ListInvitationsPagesWithContext(aws.Context, *guardduty.ListInvitationsInput, func(*guardduty.ListInvitationsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListMembers(*guardduty.ListMembersInput) (*guardduty.ListMembersOutput, error)
|
||||
ListMembersWithContext(aws.Context, *guardduty.ListMembersInput, ...request.Option) (*guardduty.ListMembersOutput, error)
|
||||
ListMembersRequest(*guardduty.ListMembersInput) (*request.Request, *guardduty.ListMembersOutput)
|
||||
|
||||
ListMembersPages(*guardduty.ListMembersInput, func(*guardduty.ListMembersOutput, bool) bool) error
|
||||
ListMembersPagesWithContext(aws.Context, *guardduty.ListMembersInput, func(*guardduty.ListMembersOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListThreatIntelSets(*guardduty.ListThreatIntelSetsInput) (*guardduty.ListThreatIntelSetsOutput, error)
|
||||
ListThreatIntelSetsWithContext(aws.Context, *guardduty.ListThreatIntelSetsInput, ...request.Option) (*guardduty.ListThreatIntelSetsOutput, error)
|
||||
ListThreatIntelSetsRequest(*guardduty.ListThreatIntelSetsInput) (*request.Request, *guardduty.ListThreatIntelSetsOutput)
|
||||
|
||||
ListThreatIntelSetsPages(*guardduty.ListThreatIntelSetsInput, func(*guardduty.ListThreatIntelSetsOutput, bool) bool) error
|
||||
ListThreatIntelSetsPagesWithContext(aws.Context, *guardduty.ListThreatIntelSetsInput, func(*guardduty.ListThreatIntelSetsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
StartMonitoringMembers(*guardduty.StartMonitoringMembersInput) (*guardduty.StartMonitoringMembersOutput, error)
|
||||
StartMonitoringMembersWithContext(aws.Context, *guardduty.StartMonitoringMembersInput, ...request.Option) (*guardduty.StartMonitoringMembersOutput, error)
|
||||
StartMonitoringMembersRequest(*guardduty.StartMonitoringMembersInput) (*request.Request, *guardduty.StartMonitoringMembersOutput)
|
||||
|
||||
StopMonitoringMembers(*guardduty.StopMonitoringMembersInput) (*guardduty.StopMonitoringMembersOutput, error)
|
||||
StopMonitoringMembersWithContext(aws.Context, *guardduty.StopMonitoringMembersInput, ...request.Option) (*guardduty.StopMonitoringMembersOutput, error)
|
||||
StopMonitoringMembersRequest(*guardduty.StopMonitoringMembersInput) (*request.Request, *guardduty.StopMonitoringMembersOutput)
|
||||
|
||||
UnarchiveFindings(*guardduty.UnarchiveFindingsInput) (*guardduty.UnarchiveFindingsOutput, error)
|
||||
UnarchiveFindingsWithContext(aws.Context, *guardduty.UnarchiveFindingsInput, ...request.Option) (*guardduty.UnarchiveFindingsOutput, error)
|
||||
UnarchiveFindingsRequest(*guardduty.UnarchiveFindingsInput) (*request.Request, *guardduty.UnarchiveFindingsOutput)
|
||||
|
||||
UpdateDetector(*guardduty.UpdateDetectorInput) (*guardduty.UpdateDetectorOutput, error)
|
||||
UpdateDetectorWithContext(aws.Context, *guardduty.UpdateDetectorInput, ...request.Option) (*guardduty.UpdateDetectorOutput, error)
|
||||
UpdateDetectorRequest(*guardduty.UpdateDetectorInput) (*request.Request, *guardduty.UpdateDetectorOutput)
|
||||
|
||||
UpdateFindingsFeedback(*guardduty.UpdateFindingsFeedbackInput) (*guardduty.UpdateFindingsFeedbackOutput, error)
|
||||
UpdateFindingsFeedbackWithContext(aws.Context, *guardduty.UpdateFindingsFeedbackInput, ...request.Option) (*guardduty.UpdateFindingsFeedbackOutput, error)
|
||||
UpdateFindingsFeedbackRequest(*guardduty.UpdateFindingsFeedbackInput) (*request.Request, *guardduty.UpdateFindingsFeedbackOutput)
|
||||
|
||||
UpdateIPSet(*guardduty.UpdateIPSetInput) (*guardduty.UpdateIPSetOutput, error)
|
||||
UpdateIPSetWithContext(aws.Context, *guardduty.UpdateIPSetInput, ...request.Option) (*guardduty.UpdateIPSetOutput, error)
|
||||
UpdateIPSetRequest(*guardduty.UpdateIPSetInput) (*request.Request, *guardduty.UpdateIPSetOutput)
|
||||
|
||||
UpdateThreatIntelSet(*guardduty.UpdateThreatIntelSetInput) (*guardduty.UpdateThreatIntelSetOutput, error)
|
||||
UpdateThreatIntelSetWithContext(aws.Context, *guardduty.UpdateThreatIntelSetInput, ...request.Option) (*guardduty.UpdateThreatIntelSetOutput, error)
|
||||
UpdateThreatIntelSetRequest(*guardduty.UpdateThreatIntelSetInput) (*request.Request, *guardduty.UpdateThreatIntelSetOutput)
|
||||
}
|
||||
|
||||
var _ GuardDutyAPI = (*guardduty.GuardDuty)(nil)
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package guardduty
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// GuardDuty provides the API operation methods for making requests to
|
||||
// Amazon GuardDuty. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// GuardDuty methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type GuardDuty 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 = "guardduty" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the GuardDuty 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 GuardDuty client from just a session.
|
||||
// svc := guardduty.New(mySession)
|
||||
//
|
||||
// // Create a GuardDuty client with additional configuration
|
||||
// svc := guardduty.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *GuardDuty {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = "guardduty"
|
||||
}
|
||||
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) *GuardDuty {
|
||||
svc := &GuardDuty{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2017-11-28",
|
||||
JSONVersion: "1.1",
|
||||
},
|
||||
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 GuardDuty operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *GuardDuty) 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