Conver to regular Go vendor + dep tool

This commit is contained in:
Andrey Smirnov
2017-03-22 17:38:32 +03:00
parent 070347295e
commit c6c1012330
3260 changed files with 1742550 additions and 72 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,216 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package directoryserviceiface provides an interface to enable mocking the AWS Directory Service 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 directoryserviceiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/directoryservice"
)
// DirectoryServiceAPI provides an interface to enable mocking the
// directoryservice.DirectoryService 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 Directory Service.
// func myFunc(svc directoryserviceiface.DirectoryServiceAPI) bool {
// // Make svc.AddIpRoutes request
// }
//
// func main() {
// sess := session.New()
// svc := directoryservice.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockDirectoryServiceClient struct {
// directoryserviceiface.DirectoryServiceAPI
// }
// func (m *mockDirectoryServiceClient) AddIpRoutes(input *directoryservice.AddIpRoutesInput) (*directoryservice.AddIpRoutesOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockDirectoryServiceClient{}
//
// 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 DirectoryServiceAPI interface {
AddIpRoutes(*directoryservice.AddIpRoutesInput) (*directoryservice.AddIpRoutesOutput, error)
AddIpRoutesWithContext(aws.Context, *directoryservice.AddIpRoutesInput, ...request.Option) (*directoryservice.AddIpRoutesOutput, error)
AddIpRoutesRequest(*directoryservice.AddIpRoutesInput) (*request.Request, *directoryservice.AddIpRoutesOutput)
AddTagsToResource(*directoryservice.AddTagsToResourceInput) (*directoryservice.AddTagsToResourceOutput, error)
AddTagsToResourceWithContext(aws.Context, *directoryservice.AddTagsToResourceInput, ...request.Option) (*directoryservice.AddTagsToResourceOutput, error)
AddTagsToResourceRequest(*directoryservice.AddTagsToResourceInput) (*request.Request, *directoryservice.AddTagsToResourceOutput)
CancelSchemaExtension(*directoryservice.CancelSchemaExtensionInput) (*directoryservice.CancelSchemaExtensionOutput, error)
CancelSchemaExtensionWithContext(aws.Context, *directoryservice.CancelSchemaExtensionInput, ...request.Option) (*directoryservice.CancelSchemaExtensionOutput, error)
CancelSchemaExtensionRequest(*directoryservice.CancelSchemaExtensionInput) (*request.Request, *directoryservice.CancelSchemaExtensionOutput)
ConnectDirectory(*directoryservice.ConnectDirectoryInput) (*directoryservice.ConnectDirectoryOutput, error)
ConnectDirectoryWithContext(aws.Context, *directoryservice.ConnectDirectoryInput, ...request.Option) (*directoryservice.ConnectDirectoryOutput, error)
ConnectDirectoryRequest(*directoryservice.ConnectDirectoryInput) (*request.Request, *directoryservice.ConnectDirectoryOutput)
CreateAlias(*directoryservice.CreateAliasInput) (*directoryservice.CreateAliasOutput, error)
CreateAliasWithContext(aws.Context, *directoryservice.CreateAliasInput, ...request.Option) (*directoryservice.CreateAliasOutput, error)
CreateAliasRequest(*directoryservice.CreateAliasInput) (*request.Request, *directoryservice.CreateAliasOutput)
CreateComputer(*directoryservice.CreateComputerInput) (*directoryservice.CreateComputerOutput, error)
CreateComputerWithContext(aws.Context, *directoryservice.CreateComputerInput, ...request.Option) (*directoryservice.CreateComputerOutput, error)
CreateComputerRequest(*directoryservice.CreateComputerInput) (*request.Request, *directoryservice.CreateComputerOutput)
CreateConditionalForwarder(*directoryservice.CreateConditionalForwarderInput) (*directoryservice.CreateConditionalForwarderOutput, error)
CreateConditionalForwarderWithContext(aws.Context, *directoryservice.CreateConditionalForwarderInput, ...request.Option) (*directoryservice.CreateConditionalForwarderOutput, error)
CreateConditionalForwarderRequest(*directoryservice.CreateConditionalForwarderInput) (*request.Request, *directoryservice.CreateConditionalForwarderOutput)
CreateDirectory(*directoryservice.CreateDirectoryInput) (*directoryservice.CreateDirectoryOutput, error)
CreateDirectoryWithContext(aws.Context, *directoryservice.CreateDirectoryInput, ...request.Option) (*directoryservice.CreateDirectoryOutput, error)
CreateDirectoryRequest(*directoryservice.CreateDirectoryInput) (*request.Request, *directoryservice.CreateDirectoryOutput)
CreateMicrosoftAD(*directoryservice.CreateMicrosoftADInput) (*directoryservice.CreateMicrosoftADOutput, error)
CreateMicrosoftADWithContext(aws.Context, *directoryservice.CreateMicrosoftADInput, ...request.Option) (*directoryservice.CreateMicrosoftADOutput, error)
CreateMicrosoftADRequest(*directoryservice.CreateMicrosoftADInput) (*request.Request, *directoryservice.CreateMicrosoftADOutput)
CreateSnapshot(*directoryservice.CreateSnapshotInput) (*directoryservice.CreateSnapshotOutput, error)
CreateSnapshotWithContext(aws.Context, *directoryservice.CreateSnapshotInput, ...request.Option) (*directoryservice.CreateSnapshotOutput, error)
CreateSnapshotRequest(*directoryservice.CreateSnapshotInput) (*request.Request, *directoryservice.CreateSnapshotOutput)
CreateTrust(*directoryservice.CreateTrustInput) (*directoryservice.CreateTrustOutput, error)
CreateTrustWithContext(aws.Context, *directoryservice.CreateTrustInput, ...request.Option) (*directoryservice.CreateTrustOutput, error)
CreateTrustRequest(*directoryservice.CreateTrustInput) (*request.Request, *directoryservice.CreateTrustOutput)
DeleteConditionalForwarder(*directoryservice.DeleteConditionalForwarderInput) (*directoryservice.DeleteConditionalForwarderOutput, error)
DeleteConditionalForwarderWithContext(aws.Context, *directoryservice.DeleteConditionalForwarderInput, ...request.Option) (*directoryservice.DeleteConditionalForwarderOutput, error)
DeleteConditionalForwarderRequest(*directoryservice.DeleteConditionalForwarderInput) (*request.Request, *directoryservice.DeleteConditionalForwarderOutput)
DeleteDirectory(*directoryservice.DeleteDirectoryInput) (*directoryservice.DeleteDirectoryOutput, error)
DeleteDirectoryWithContext(aws.Context, *directoryservice.DeleteDirectoryInput, ...request.Option) (*directoryservice.DeleteDirectoryOutput, error)
DeleteDirectoryRequest(*directoryservice.DeleteDirectoryInput) (*request.Request, *directoryservice.DeleteDirectoryOutput)
DeleteSnapshot(*directoryservice.DeleteSnapshotInput) (*directoryservice.DeleteSnapshotOutput, error)
DeleteSnapshotWithContext(aws.Context, *directoryservice.DeleteSnapshotInput, ...request.Option) (*directoryservice.DeleteSnapshotOutput, error)
DeleteSnapshotRequest(*directoryservice.DeleteSnapshotInput) (*request.Request, *directoryservice.DeleteSnapshotOutput)
DeleteTrust(*directoryservice.DeleteTrustInput) (*directoryservice.DeleteTrustOutput, error)
DeleteTrustWithContext(aws.Context, *directoryservice.DeleteTrustInput, ...request.Option) (*directoryservice.DeleteTrustOutput, error)
DeleteTrustRequest(*directoryservice.DeleteTrustInput) (*request.Request, *directoryservice.DeleteTrustOutput)
DeregisterEventTopic(*directoryservice.DeregisterEventTopicInput) (*directoryservice.DeregisterEventTopicOutput, error)
DeregisterEventTopicWithContext(aws.Context, *directoryservice.DeregisterEventTopicInput, ...request.Option) (*directoryservice.DeregisterEventTopicOutput, error)
DeregisterEventTopicRequest(*directoryservice.DeregisterEventTopicInput) (*request.Request, *directoryservice.DeregisterEventTopicOutput)
DescribeConditionalForwarders(*directoryservice.DescribeConditionalForwardersInput) (*directoryservice.DescribeConditionalForwardersOutput, error)
DescribeConditionalForwardersWithContext(aws.Context, *directoryservice.DescribeConditionalForwardersInput, ...request.Option) (*directoryservice.DescribeConditionalForwardersOutput, error)
DescribeConditionalForwardersRequest(*directoryservice.DescribeConditionalForwardersInput) (*request.Request, *directoryservice.DescribeConditionalForwardersOutput)
DescribeDirectories(*directoryservice.DescribeDirectoriesInput) (*directoryservice.DescribeDirectoriesOutput, error)
DescribeDirectoriesWithContext(aws.Context, *directoryservice.DescribeDirectoriesInput, ...request.Option) (*directoryservice.DescribeDirectoriesOutput, error)
DescribeDirectoriesRequest(*directoryservice.DescribeDirectoriesInput) (*request.Request, *directoryservice.DescribeDirectoriesOutput)
DescribeEventTopics(*directoryservice.DescribeEventTopicsInput) (*directoryservice.DescribeEventTopicsOutput, error)
DescribeEventTopicsWithContext(aws.Context, *directoryservice.DescribeEventTopicsInput, ...request.Option) (*directoryservice.DescribeEventTopicsOutput, error)
DescribeEventTopicsRequest(*directoryservice.DescribeEventTopicsInput) (*request.Request, *directoryservice.DescribeEventTopicsOutput)
DescribeSnapshots(*directoryservice.DescribeSnapshotsInput) (*directoryservice.DescribeSnapshotsOutput, error)
DescribeSnapshotsWithContext(aws.Context, *directoryservice.DescribeSnapshotsInput, ...request.Option) (*directoryservice.DescribeSnapshotsOutput, error)
DescribeSnapshotsRequest(*directoryservice.DescribeSnapshotsInput) (*request.Request, *directoryservice.DescribeSnapshotsOutput)
DescribeTrusts(*directoryservice.DescribeTrustsInput) (*directoryservice.DescribeTrustsOutput, error)
DescribeTrustsWithContext(aws.Context, *directoryservice.DescribeTrustsInput, ...request.Option) (*directoryservice.DescribeTrustsOutput, error)
DescribeTrustsRequest(*directoryservice.DescribeTrustsInput) (*request.Request, *directoryservice.DescribeTrustsOutput)
DisableRadius(*directoryservice.DisableRadiusInput) (*directoryservice.DisableRadiusOutput, error)
DisableRadiusWithContext(aws.Context, *directoryservice.DisableRadiusInput, ...request.Option) (*directoryservice.DisableRadiusOutput, error)
DisableRadiusRequest(*directoryservice.DisableRadiusInput) (*request.Request, *directoryservice.DisableRadiusOutput)
DisableSso(*directoryservice.DisableSsoInput) (*directoryservice.DisableSsoOutput, error)
DisableSsoWithContext(aws.Context, *directoryservice.DisableSsoInput, ...request.Option) (*directoryservice.DisableSsoOutput, error)
DisableSsoRequest(*directoryservice.DisableSsoInput) (*request.Request, *directoryservice.DisableSsoOutput)
EnableRadius(*directoryservice.EnableRadiusInput) (*directoryservice.EnableRadiusOutput, error)
EnableRadiusWithContext(aws.Context, *directoryservice.EnableRadiusInput, ...request.Option) (*directoryservice.EnableRadiusOutput, error)
EnableRadiusRequest(*directoryservice.EnableRadiusInput) (*request.Request, *directoryservice.EnableRadiusOutput)
EnableSso(*directoryservice.EnableSsoInput) (*directoryservice.EnableSsoOutput, error)
EnableSsoWithContext(aws.Context, *directoryservice.EnableSsoInput, ...request.Option) (*directoryservice.EnableSsoOutput, error)
EnableSsoRequest(*directoryservice.EnableSsoInput) (*request.Request, *directoryservice.EnableSsoOutput)
GetDirectoryLimits(*directoryservice.GetDirectoryLimitsInput) (*directoryservice.GetDirectoryLimitsOutput, error)
GetDirectoryLimitsWithContext(aws.Context, *directoryservice.GetDirectoryLimitsInput, ...request.Option) (*directoryservice.GetDirectoryLimitsOutput, error)
GetDirectoryLimitsRequest(*directoryservice.GetDirectoryLimitsInput) (*request.Request, *directoryservice.GetDirectoryLimitsOutput)
GetSnapshotLimits(*directoryservice.GetSnapshotLimitsInput) (*directoryservice.GetSnapshotLimitsOutput, error)
GetSnapshotLimitsWithContext(aws.Context, *directoryservice.GetSnapshotLimitsInput, ...request.Option) (*directoryservice.GetSnapshotLimitsOutput, error)
GetSnapshotLimitsRequest(*directoryservice.GetSnapshotLimitsInput) (*request.Request, *directoryservice.GetSnapshotLimitsOutput)
ListIpRoutes(*directoryservice.ListIpRoutesInput) (*directoryservice.ListIpRoutesOutput, error)
ListIpRoutesWithContext(aws.Context, *directoryservice.ListIpRoutesInput, ...request.Option) (*directoryservice.ListIpRoutesOutput, error)
ListIpRoutesRequest(*directoryservice.ListIpRoutesInput) (*request.Request, *directoryservice.ListIpRoutesOutput)
ListSchemaExtensions(*directoryservice.ListSchemaExtensionsInput) (*directoryservice.ListSchemaExtensionsOutput, error)
ListSchemaExtensionsWithContext(aws.Context, *directoryservice.ListSchemaExtensionsInput, ...request.Option) (*directoryservice.ListSchemaExtensionsOutput, error)
ListSchemaExtensionsRequest(*directoryservice.ListSchemaExtensionsInput) (*request.Request, *directoryservice.ListSchemaExtensionsOutput)
ListTagsForResource(*directoryservice.ListTagsForResourceInput) (*directoryservice.ListTagsForResourceOutput, error)
ListTagsForResourceWithContext(aws.Context, *directoryservice.ListTagsForResourceInput, ...request.Option) (*directoryservice.ListTagsForResourceOutput, error)
ListTagsForResourceRequest(*directoryservice.ListTagsForResourceInput) (*request.Request, *directoryservice.ListTagsForResourceOutput)
RegisterEventTopic(*directoryservice.RegisterEventTopicInput) (*directoryservice.RegisterEventTopicOutput, error)
RegisterEventTopicWithContext(aws.Context, *directoryservice.RegisterEventTopicInput, ...request.Option) (*directoryservice.RegisterEventTopicOutput, error)
RegisterEventTopicRequest(*directoryservice.RegisterEventTopicInput) (*request.Request, *directoryservice.RegisterEventTopicOutput)
RemoveIpRoutes(*directoryservice.RemoveIpRoutesInput) (*directoryservice.RemoveIpRoutesOutput, error)
RemoveIpRoutesWithContext(aws.Context, *directoryservice.RemoveIpRoutesInput, ...request.Option) (*directoryservice.RemoveIpRoutesOutput, error)
RemoveIpRoutesRequest(*directoryservice.RemoveIpRoutesInput) (*request.Request, *directoryservice.RemoveIpRoutesOutput)
RemoveTagsFromResource(*directoryservice.RemoveTagsFromResourceInput) (*directoryservice.RemoveTagsFromResourceOutput, error)
RemoveTagsFromResourceWithContext(aws.Context, *directoryservice.RemoveTagsFromResourceInput, ...request.Option) (*directoryservice.RemoveTagsFromResourceOutput, error)
RemoveTagsFromResourceRequest(*directoryservice.RemoveTagsFromResourceInput) (*request.Request, *directoryservice.RemoveTagsFromResourceOutput)
RestoreFromSnapshot(*directoryservice.RestoreFromSnapshotInput) (*directoryservice.RestoreFromSnapshotOutput, error)
RestoreFromSnapshotWithContext(aws.Context, *directoryservice.RestoreFromSnapshotInput, ...request.Option) (*directoryservice.RestoreFromSnapshotOutput, error)
RestoreFromSnapshotRequest(*directoryservice.RestoreFromSnapshotInput) (*request.Request, *directoryservice.RestoreFromSnapshotOutput)
StartSchemaExtension(*directoryservice.StartSchemaExtensionInput) (*directoryservice.StartSchemaExtensionOutput, error)
StartSchemaExtensionWithContext(aws.Context, *directoryservice.StartSchemaExtensionInput, ...request.Option) (*directoryservice.StartSchemaExtensionOutput, error)
StartSchemaExtensionRequest(*directoryservice.StartSchemaExtensionInput) (*request.Request, *directoryservice.StartSchemaExtensionOutput)
UpdateConditionalForwarder(*directoryservice.UpdateConditionalForwarderInput) (*directoryservice.UpdateConditionalForwarderOutput, error)
UpdateConditionalForwarderWithContext(aws.Context, *directoryservice.UpdateConditionalForwarderInput, ...request.Option) (*directoryservice.UpdateConditionalForwarderOutput, error)
UpdateConditionalForwarderRequest(*directoryservice.UpdateConditionalForwarderInput) (*request.Request, *directoryservice.UpdateConditionalForwarderOutput)
UpdateRadius(*directoryservice.UpdateRadiusInput) (*directoryservice.UpdateRadiusOutput, error)
UpdateRadiusWithContext(aws.Context, *directoryservice.UpdateRadiusInput, ...request.Option) (*directoryservice.UpdateRadiusOutput, error)
UpdateRadiusRequest(*directoryservice.UpdateRadiusInput) (*request.Request, *directoryservice.UpdateRadiusOutput)
VerifyTrust(*directoryservice.VerifyTrustInput) (*directoryservice.VerifyTrustOutput, error)
VerifyTrustWithContext(aws.Context, *directoryservice.VerifyTrustInput, ...request.Option) (*directoryservice.VerifyTrustOutput, error)
VerifyTrustRequest(*directoryservice.VerifyTrustInput) (*request.Request, *directoryservice.VerifyTrustOutput)
}
var _ DirectoryServiceAPI = (*directoryservice.DirectoryService)(nil)
+95
View File
@@ -0,0 +1,95 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package directoryservice
const (
// ErrCodeAuthenticationFailedException for service response error code
// "AuthenticationFailedException".
//
// An authentication error occurred.
ErrCodeAuthenticationFailedException = "AuthenticationFailedException"
// ErrCodeClientException for service response error code
// "ClientException".
//
// A client exception has occurred.
ErrCodeClientException = "ClientException"
// ErrCodeDirectoryLimitExceededException for service response error code
// "DirectoryLimitExceededException".
//
// The maximum number of directories in the region has been reached. You can
// use the GetDirectoryLimits operation to determine your directory limits in
// the region.
ErrCodeDirectoryLimitExceededException = "DirectoryLimitExceededException"
// ErrCodeDirectoryUnavailableException for service response error code
// "DirectoryUnavailableException".
//
// The specified directory is unavailable or could not be found.
ErrCodeDirectoryUnavailableException = "DirectoryUnavailableException"
// ErrCodeEntityAlreadyExistsException for service response error code
// "EntityAlreadyExistsException".
//
// The specified entity already exists.
ErrCodeEntityAlreadyExistsException = "EntityAlreadyExistsException"
// ErrCodeEntityDoesNotExistException for service response error code
// "EntityDoesNotExistException".
//
// The specified entity could not be found.
ErrCodeEntityDoesNotExistException = "EntityDoesNotExistException"
// ErrCodeInsufficientPermissionsException for service response error code
// "InsufficientPermissionsException".
//
// The account does not have sufficient permission to perform the operation.
ErrCodeInsufficientPermissionsException = "InsufficientPermissionsException"
// ErrCodeInvalidNextTokenException for service response error code
// "InvalidNextTokenException".
//
// The NextToken value is not valid.
ErrCodeInvalidNextTokenException = "InvalidNextTokenException"
// ErrCodeInvalidParameterException for service response error code
// "InvalidParameterException".
//
// One or more parameters are not valid.
ErrCodeInvalidParameterException = "InvalidParameterException"
// ErrCodeIpRouteLimitExceededException for service response error code
// "IpRouteLimitExceededException".
//
// The maximum allowed number of IP addresses was exceeded. The default limit
// is 100 IP address blocks.
ErrCodeIpRouteLimitExceededException = "IpRouteLimitExceededException"
// ErrCodeServiceException for service response error code
// "ServiceException".
//
// An exception has occurred in AWS Directory Service.
ErrCodeServiceException = "ServiceException"
// ErrCodeSnapshotLimitExceededException for service response error code
// "SnapshotLimitExceededException".
//
// The maximum number of manual snapshots for the directory has been reached.
// You can use the GetSnapshotLimits operation to determine the snapshot limits
// for a directory.
ErrCodeSnapshotLimitExceededException = "SnapshotLimitExceededException"
// ErrCodeTagLimitExceededException for service response error code
// "TagLimitExceededException".
//
// The maximum allowed number of tags was exceeded.
ErrCodeTagLimitExceededException = "TagLimitExceededException"
// ErrCodeUnsupportedOperationException for service response error code
// "UnsupportedOperationException".
//
// The operation is not supported.
ErrCodeUnsupportedOperationException = "UnsupportedOperationException"
)
@@ -0,0 +1,971 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package directoryservice_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/directoryservice"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleDirectoryService_AddIpRoutes() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.AddIpRoutesInput{
DirectoryId: aws.String("DirectoryId"), // Required
IpRoutes: []*directoryservice.IpRoute{ // Required
{ // Required
CidrIp: aws.String("CidrIp"),
Description: aws.String("Description"),
},
// More values...
},
UpdateSecurityGroupForDirectoryControllers: aws.Bool(true),
}
resp, err := svc.AddIpRoutes(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 ExampleDirectoryService_AddTagsToResource() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.AddTagsToResourceInput{
ResourceId: aws.String("ResourceId"), // Required
Tags: []*directoryservice.Tag{ // Required
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"), // Required
},
// More values...
},
}
resp, err := svc.AddTagsToResource(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 ExampleDirectoryService_CancelSchemaExtension() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CancelSchemaExtensionInput{
DirectoryId: aws.String("DirectoryId"), // Required
SchemaExtensionId: aws.String("SchemaExtensionId"), // Required
}
resp, err := svc.CancelSchemaExtension(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 ExampleDirectoryService_ConnectDirectory() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.ConnectDirectoryInput{
ConnectSettings: &directoryservice.DirectoryConnectSettings{ // Required
CustomerDnsIps: []*string{ // Required
aws.String("IpAddr"), // Required
// More values...
},
CustomerUserName: aws.String("UserName"), // Required
SubnetIds: []*string{ // Required
aws.String("SubnetId"), // Required
// More values...
},
VpcId: aws.String("VpcId"), // Required
},
Name: aws.String("DirectoryName"), // Required
Password: aws.String("ConnectPassword"), // Required
Size: aws.String("DirectorySize"), // Required
Description: aws.String("Description"),
ShortName: aws.String("DirectoryShortName"),
}
resp, err := svc.ConnectDirectory(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 ExampleDirectoryService_CreateAlias() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateAliasInput{
Alias: aws.String("AliasName"), // Required
DirectoryId: aws.String("DirectoryId"), // Required
}
resp, err := svc.CreateAlias(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 ExampleDirectoryService_CreateComputer() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateComputerInput{
ComputerName: aws.String("ComputerName"), // Required
DirectoryId: aws.String("DirectoryId"), // Required
Password: aws.String("ComputerPassword"), // Required
ComputerAttributes: []*directoryservice.Attribute{
{ // Required
Name: aws.String("AttributeName"),
Value: aws.String("AttributeValue"),
},
// More values...
},
OrganizationalUnitDistinguishedName: aws.String("OrganizationalUnitDN"),
}
resp, err := svc.CreateComputer(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 ExampleDirectoryService_CreateConditionalForwarder() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateConditionalForwarderInput{
DirectoryId: aws.String("DirectoryId"), // Required
DnsIpAddrs: []*string{ // Required
aws.String("IpAddr"), // Required
// More values...
},
RemoteDomainName: aws.String("RemoteDomainName"), // Required
}
resp, err := svc.CreateConditionalForwarder(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 ExampleDirectoryService_CreateDirectory() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateDirectoryInput{
Name: aws.String("DirectoryName"), // Required
Password: aws.String("Password"), // Required
Size: aws.String("DirectorySize"), // Required
Description: aws.String("Description"),
ShortName: aws.String("DirectoryShortName"),
VpcSettings: &directoryservice.DirectoryVpcSettings{
SubnetIds: []*string{ // Required
aws.String("SubnetId"), // Required
// More values...
},
VpcId: aws.String("VpcId"), // Required
},
}
resp, err := svc.CreateDirectory(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 ExampleDirectoryService_CreateMicrosoftAD() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateMicrosoftADInput{
Name: aws.String("DirectoryName"), // Required
Password: aws.String("Password"), // Required
VpcSettings: &directoryservice.DirectoryVpcSettings{ // Required
SubnetIds: []*string{ // Required
aws.String("SubnetId"), // Required
// More values...
},
VpcId: aws.String("VpcId"), // Required
},
Description: aws.String("Description"),
ShortName: aws.String("DirectoryShortName"),
}
resp, err := svc.CreateMicrosoftAD(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 ExampleDirectoryService_CreateSnapshot() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateSnapshotInput{
DirectoryId: aws.String("DirectoryId"), // Required
Name: aws.String("SnapshotName"),
}
resp, err := svc.CreateSnapshot(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 ExampleDirectoryService_CreateTrust() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.CreateTrustInput{
DirectoryId: aws.String("DirectoryId"), // Required
RemoteDomainName: aws.String("RemoteDomainName"), // Required
TrustDirection: aws.String("TrustDirection"), // Required
TrustPassword: aws.String("TrustPassword"), // Required
ConditionalForwarderIpAddrs: []*string{
aws.String("IpAddr"), // Required
// More values...
},
TrustType: aws.String("TrustType"),
}
resp, err := svc.CreateTrust(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 ExampleDirectoryService_DeleteConditionalForwarder() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DeleteConditionalForwarderInput{
DirectoryId: aws.String("DirectoryId"), // Required
RemoteDomainName: aws.String("RemoteDomainName"), // Required
}
resp, err := svc.DeleteConditionalForwarder(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 ExampleDirectoryService_DeleteDirectory() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DeleteDirectoryInput{
DirectoryId: aws.String("DirectoryId"), // Required
}
resp, err := svc.DeleteDirectory(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 ExampleDirectoryService_DeleteSnapshot() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DeleteSnapshotInput{
SnapshotId: aws.String("SnapshotId"), // Required
}
resp, err := svc.DeleteSnapshot(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 ExampleDirectoryService_DeleteTrust() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DeleteTrustInput{
TrustId: aws.String("TrustId"), // Required
DeleteAssociatedConditionalForwarder: aws.Bool(true),
}
resp, err := svc.DeleteTrust(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 ExampleDirectoryService_DeregisterEventTopic() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DeregisterEventTopicInput{
DirectoryId: aws.String("DirectoryId"), // Required
TopicName: aws.String("TopicName"), // Required
}
resp, err := svc.DeregisterEventTopic(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 ExampleDirectoryService_DescribeConditionalForwarders() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DescribeConditionalForwardersInput{
DirectoryId: aws.String("DirectoryId"), // Required
RemoteDomainNames: []*string{
aws.String("RemoteDomainName"), // Required
// More values...
},
}
resp, err := svc.DescribeConditionalForwarders(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 ExampleDirectoryService_DescribeDirectories() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DescribeDirectoriesInput{
DirectoryIds: []*string{
aws.String("DirectoryId"), // Required
// More values...
},
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.DescribeDirectories(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 ExampleDirectoryService_DescribeEventTopics() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DescribeEventTopicsInput{
DirectoryId: aws.String("DirectoryId"),
TopicNames: []*string{
aws.String("TopicName"), // Required
// More values...
},
}
resp, err := svc.DescribeEventTopics(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 ExampleDirectoryService_DescribeSnapshots() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DescribeSnapshotsInput{
DirectoryId: aws.String("DirectoryId"),
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
SnapshotIds: []*string{
aws.String("SnapshotId"), // Required
// More values...
},
}
resp, err := svc.DescribeSnapshots(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 ExampleDirectoryService_DescribeTrusts() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DescribeTrustsInput{
DirectoryId: aws.String("DirectoryId"),
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
TrustIds: []*string{
aws.String("TrustId"), // Required
// More values...
},
}
resp, err := svc.DescribeTrusts(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 ExampleDirectoryService_DisableRadius() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DisableRadiusInput{
DirectoryId: aws.String("DirectoryId"), // Required
}
resp, err := svc.DisableRadius(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 ExampleDirectoryService_DisableSso() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.DisableSsoInput{
DirectoryId: aws.String("DirectoryId"), // Required
Password: aws.String("ConnectPassword"),
UserName: aws.String("UserName"),
}
resp, err := svc.DisableSso(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 ExampleDirectoryService_EnableRadius() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.EnableRadiusInput{
DirectoryId: aws.String("DirectoryId"), // Required
RadiusSettings: &directoryservice.RadiusSettings{ // Required
AuthenticationProtocol: aws.String("RadiusAuthenticationProtocol"),
DisplayLabel: aws.String("RadiusDisplayLabel"),
RadiusPort: aws.Int64(1),
RadiusRetries: aws.Int64(1),
RadiusServers: []*string{
aws.String("Server"), // Required
// More values...
},
RadiusTimeout: aws.Int64(1),
SharedSecret: aws.String("RadiusSharedSecret"),
UseSameUsername: aws.Bool(true),
},
}
resp, err := svc.EnableRadius(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 ExampleDirectoryService_EnableSso() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.EnableSsoInput{
DirectoryId: aws.String("DirectoryId"), // Required
Password: aws.String("ConnectPassword"),
UserName: aws.String("UserName"),
}
resp, err := svc.EnableSso(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 ExampleDirectoryService_GetDirectoryLimits() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
var params *directoryservice.GetDirectoryLimitsInput
resp, err := svc.GetDirectoryLimits(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 ExampleDirectoryService_GetSnapshotLimits() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.GetSnapshotLimitsInput{
DirectoryId: aws.String("DirectoryId"), // Required
}
resp, err := svc.GetSnapshotLimits(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 ExampleDirectoryService_ListIpRoutes() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.ListIpRoutesInput{
DirectoryId: aws.String("DirectoryId"), // Required
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListIpRoutes(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 ExampleDirectoryService_ListSchemaExtensions() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.ListSchemaExtensionsInput{
DirectoryId: aws.String("DirectoryId"), // Required
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListSchemaExtensions(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 ExampleDirectoryService_ListTagsForResource() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.ListTagsForResourceInput{
ResourceId: aws.String("ResourceId"), // Required
Limit: aws.Int64(1),
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListTagsForResource(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 ExampleDirectoryService_RegisterEventTopic() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.RegisterEventTopicInput{
DirectoryId: aws.String("DirectoryId"), // Required
TopicName: aws.String("TopicName"), // Required
}
resp, err := svc.RegisterEventTopic(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 ExampleDirectoryService_RemoveIpRoutes() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.RemoveIpRoutesInput{
CidrIps: []*string{ // Required
aws.String("CidrIp"), // Required
// More values...
},
DirectoryId: aws.String("DirectoryId"), // Required
}
resp, err := svc.RemoveIpRoutes(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 ExampleDirectoryService_RemoveTagsFromResource() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.RemoveTagsFromResourceInput{
ResourceId: aws.String("ResourceId"), // Required
TagKeys: []*string{ // Required
aws.String("TagKey"), // Required
// More values...
},
}
resp, err := svc.RemoveTagsFromResource(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 ExampleDirectoryService_RestoreFromSnapshot() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.RestoreFromSnapshotInput{
SnapshotId: aws.String("SnapshotId"), // Required
}
resp, err := svc.RestoreFromSnapshot(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 ExampleDirectoryService_StartSchemaExtension() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.StartSchemaExtensionInput{
CreateSnapshotBeforeSchemaExtension: aws.Bool(true), // Required
Description: aws.String("Description"), // Required
DirectoryId: aws.String("DirectoryId"), // Required
LdifContent: aws.String("LdifContent"), // Required
}
resp, err := svc.StartSchemaExtension(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 ExampleDirectoryService_UpdateConditionalForwarder() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.UpdateConditionalForwarderInput{
DirectoryId: aws.String("DirectoryId"), // Required
DnsIpAddrs: []*string{ // Required
aws.String("IpAddr"), // Required
// More values...
},
RemoteDomainName: aws.String("RemoteDomainName"), // Required
}
resp, err := svc.UpdateConditionalForwarder(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 ExampleDirectoryService_UpdateRadius() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.UpdateRadiusInput{
DirectoryId: aws.String("DirectoryId"), // Required
RadiusSettings: &directoryservice.RadiusSettings{ // Required
AuthenticationProtocol: aws.String("RadiusAuthenticationProtocol"),
DisplayLabel: aws.String("RadiusDisplayLabel"),
RadiusPort: aws.Int64(1),
RadiusRetries: aws.Int64(1),
RadiusServers: []*string{
aws.String("Server"), // Required
// More values...
},
RadiusTimeout: aws.Int64(1),
SharedSecret: aws.String("RadiusSharedSecret"),
UseSameUsername: aws.Bool(true),
},
}
resp, err := svc.UpdateRadius(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 ExampleDirectoryService_VerifyTrust() {
sess := session.Must(session.NewSession())
svc := directoryservice.New(sess)
params := &directoryservice.VerifyTrustInput{
TrustId: aws.String("TrustId"), // Required
}
resp, err := svc.VerifyTrust(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)
}
+105
View File
@@ -0,0 +1,105 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package directoryservice
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"
)
// AWS Directory Service is a web service that makes it easy for you to setup
// and run directories in the AWS cloud, or connect your AWS resources with
// an existing on-premises Microsoft Active Directory. This guide provides detailed
// information about AWS Directory Service operations, data types, parameters,
// and errors. For information about AWS Directory Services features, see AWS
// Directory Service (https://aws.amazon.com/directoryservice/) and the AWS
// Directory Service Administration Guide (http://docs.aws.amazon.com/directoryservice/latest/admin-guide/what_is.html).
//
// AWS provides SDKs that consist of libraries and sample code for various programming
// languages and platforms (Java, Ruby, .Net, iOS, Android, etc.). The SDKs
// provide a convenient way to create programmatic access to AWS Directory Service
// and other AWS services. For more information about the AWS SDKs, including
// how to download and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/).
// 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/ds-2015-04-16
type DirectoryService 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 = "ds" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the DirectoryService 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 DirectoryService client from just a session.
// svc := directoryservice.New(mySession)
//
// // Create a DirectoryService client with additional configuration
// svc := directoryservice.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *DirectoryService {
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) *DirectoryService {
svc := &DirectoryService{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2015-04-16",
JSONVersion: "1.1",
TargetPrefix: "DirectoryService_20150416",
},
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 DirectoryService operation and runs any
// custom request initialization.
func (c *DirectoryService) 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
}