mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +00:00
Upgrade AWS SDK to the latest version
This commit is contained in:
+3370
-313
File diff suppressed because it is too large
Load Diff
+58
@@ -0,0 +1,58 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package workdocs provides the client and types for making API
|
||||
// requests to Amazon WorkDocs.
|
||||
//
|
||||
// The WorkDocs API is designed for the following use cases:
|
||||
//
|
||||
// * File Migration: File migration applications are supported for users
|
||||
// who want to migrate their files from an on-premise or off-premise file
|
||||
// system or service. Users can insert files into a user directory structure,
|
||||
// as well as allow for basic metadata changes, such as modifications to
|
||||
// the permissions of files.
|
||||
//
|
||||
// * Security: Support security applications are supported for users who
|
||||
// have additional security needs, such as anti-virus or data loss prevention.
|
||||
// The APIs, in conjunction with Amazon CloudTrail, allow these applications
|
||||
// to detect when changes occur in Amazon WorkDocs, so the application can
|
||||
// take the necessary actions and replace the target file. The application
|
||||
// can also choose to email the user if the target file violates the policy.
|
||||
//
|
||||
// * eDiscovery/Analytics: General administrative applications are supported,
|
||||
// such as eDiscovery and analytics. These applications can choose to mimic
|
||||
// and/or record the actions in an Amazon WorkDocs site, in conjunction with
|
||||
// Amazon CloudTrails, to replicate data for eDiscovery, backup, or analytical
|
||||
// applications.
|
||||
//
|
||||
// All Amazon WorkDocs APIs are Amazon authenticated, certificate-signed APIs.
|
||||
// They not only require the use of the AWS SDK, but also allow for the exclusive
|
||||
// use of IAM users and roles to help facilitate access, trust, and permission
|
||||
// policies. By creating a role and allowing an IAM user to access the Amazon
|
||||
// WorkDocs site, the IAM user gains full administrative visibility into the
|
||||
// entire Amazon WorkDocs site (or as set in the IAM policy). This includes,
|
||||
// but is not limited to, the ability to modify file permissions and upload
|
||||
// any file to any user. This allows developers to perform the three use cases
|
||||
// above, as well as give users the ability to grant access on a selective basis
|
||||
// using the IAM model.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/workdocs-2016-05-01 for more information on this service.
|
||||
//
|
||||
// See workdocs package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/workdocs/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To Amazon WorkDocs 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 WorkDocs client WorkDocs for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/workdocs/#New
|
||||
package workdocs
|
||||
+35
-2
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package workdocs
|
||||
|
||||
@@ -10,12 +10,33 @@ const (
|
||||
// The resource hierarchy is changing.
|
||||
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
|
||||
|
||||
// ErrCodeCustomMetadataLimitExceededException for service response error code
|
||||
// "CustomMetadataLimitExceededException".
|
||||
//
|
||||
// The limit has been reached on the number of custom properties for the specified
|
||||
// resource.
|
||||
ErrCodeCustomMetadataLimitExceededException = "CustomMetadataLimitExceededException"
|
||||
|
||||
// ErrCodeDeactivatingLastSystemUserException for service response error code
|
||||
// "DeactivatingLastSystemUserException".
|
||||
//
|
||||
// The last user in the organization is being deactivated.
|
||||
ErrCodeDeactivatingLastSystemUserException = "DeactivatingLastSystemUserException"
|
||||
|
||||
// ErrCodeDocumentLockedForCommentsException for service response error code
|
||||
// "DocumentLockedForCommentsException".
|
||||
//
|
||||
// This exception is thrown when the document is locked for comments and user
|
||||
// tries to create or delete a comment on that document.
|
||||
ErrCodeDocumentLockedForCommentsException = "DocumentLockedForCommentsException"
|
||||
|
||||
// ErrCodeDraftUploadOutOfSyncException for service response error code
|
||||
// "DraftUploadOutOfSyncException".
|
||||
//
|
||||
// This exception is thrown when a valid checkout ID is not presented on document
|
||||
// version upload calls for a document that has been checked out from Web client.
|
||||
ErrCodeDraftUploadOutOfSyncException = "DraftUploadOutOfSyncException"
|
||||
|
||||
// ErrCodeEntityAlreadyExistsException for service response error code
|
||||
// "EntityAlreadyExistsException".
|
||||
//
|
||||
@@ -57,7 +78,7 @@ const (
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// You've exceeded the maximum of 100,000 folders under the parent folder.
|
||||
// The maximum of 100,000 folders under the parent folder has been exceeded.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeProhibitedStateException for service response error code
|
||||
@@ -66,6 +87,12 @@ const (
|
||||
// The specified document version is not in the INITIALIZED state.
|
||||
ErrCodeProhibitedStateException = "ProhibitedStateException"
|
||||
|
||||
// ErrCodeResourceAlreadyCheckedOutException for service response error code
|
||||
// "ResourceAlreadyCheckedOutException".
|
||||
//
|
||||
// The resource is already checked out.
|
||||
ErrCodeResourceAlreadyCheckedOutException = "ResourceAlreadyCheckedOutException"
|
||||
|
||||
// ErrCodeServiceUnavailableException for service response error code
|
||||
// "ServiceUnavailableException".
|
||||
//
|
||||
@@ -84,6 +111,12 @@ const (
|
||||
// The storage limit will be exceeded.
|
||||
ErrCodeStorageLimitWillExceedException = "StorageLimitWillExceedException"
|
||||
|
||||
// ErrCodeTooManyLabelsException for service response error code
|
||||
// "TooManyLabelsException".
|
||||
//
|
||||
// The limit has been reached on the number of labels for the specified resource.
|
||||
ErrCodeTooManyLabelsException = "TooManyLabelsException"
|
||||
|
||||
// ErrCodeTooManySubscriptionsException for service response error code
|
||||
// "TooManySubscriptionsException".
|
||||
//
|
||||
|
||||
-703
@@ -1,703 +0,0 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package workdocs_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/workdocs"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleWorkDocs_AbortDocumentVersionUpload() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.AbortDocumentVersionUploadInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
VersionId: aws.String("DocumentVersionIdType"), // Required
|
||||
}
|
||||
resp, err := svc.AbortDocumentVersionUpload(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 ExampleWorkDocs_ActivateUser() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.ActivateUserInput{
|
||||
UserId: aws.String("IdType"), // Required
|
||||
}
|
||||
resp, err := svc.ActivateUser(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 ExampleWorkDocs_AddResourcePermissions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.AddResourcePermissionsInput{
|
||||
Principals: []*workdocs.SharePrincipal{ // Required
|
||||
{ // Required
|
||||
Id: aws.String("IdType"), // Required
|
||||
Role: aws.String("RoleType"), // Required
|
||||
Type: aws.String("PrincipalType"), // Required
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
ResourceId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.AddResourcePermissions(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 ExampleWorkDocs_CreateFolder() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.CreateFolderInput{
|
||||
ParentFolderId: aws.String("ResourceIdType"), // Required
|
||||
Name: aws.String("ResourceNameType"),
|
||||
}
|
||||
resp, err := svc.CreateFolder(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 ExampleWorkDocs_CreateNotificationSubscription() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.CreateNotificationSubscriptionInput{
|
||||
Endpoint: aws.String("SubscriptionEndPointType"), // Required
|
||||
OrganizationId: aws.String("IdType"), // Required
|
||||
Protocol: aws.String("SubscriptionProtocolType"), // Required
|
||||
SubscriptionType: aws.String("SubscriptionType"), // Required
|
||||
}
|
||||
resp, err := svc.CreateNotificationSubscription(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 ExampleWorkDocs_CreateUser() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.CreateUserInput{
|
||||
GivenName: aws.String("UserAttributeValueType"), // Required
|
||||
Password: aws.String("PasswordType"), // Required
|
||||
Surname: aws.String("UserAttributeValueType"), // Required
|
||||
Username: aws.String("UsernameType"), // Required
|
||||
OrganizationId: aws.String("IdType"),
|
||||
StorageRule: &workdocs.StorageRuleType{
|
||||
StorageAllocatedInBytes: aws.Int64(1),
|
||||
StorageType: aws.String("StorageType"),
|
||||
},
|
||||
TimeZoneId: aws.String("TimeZoneIdType"),
|
||||
}
|
||||
resp, err := svc.CreateUser(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 ExampleWorkDocs_DeactivateUser() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DeactivateUserInput{
|
||||
UserId: aws.String("IdType"), // Required
|
||||
}
|
||||
resp, err := svc.DeactivateUser(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 ExampleWorkDocs_DeleteDocument() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DeleteDocumentInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteDocument(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 ExampleWorkDocs_DeleteFolder() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DeleteFolderInput{
|
||||
FolderId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteFolder(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 ExampleWorkDocs_DeleteFolderContents() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DeleteFolderContentsInput{
|
||||
FolderId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteFolderContents(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 ExampleWorkDocs_DeleteNotificationSubscription() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DeleteNotificationSubscriptionInput{
|
||||
OrganizationId: aws.String("IdType"), // Required
|
||||
SubscriptionId: aws.String("IdType"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteNotificationSubscription(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 ExampleWorkDocs_DeleteUser() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DeleteUserInput{
|
||||
UserId: aws.String("IdType"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteUser(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 ExampleWorkDocs_DescribeDocumentVersions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DescribeDocumentVersionsInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
Fields: aws.String("FieldNamesType"),
|
||||
Include: aws.String("FieldNamesType"),
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
}
|
||||
resp, err := svc.DescribeDocumentVersions(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 ExampleWorkDocs_DescribeFolderContents() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DescribeFolderContentsInput{
|
||||
FolderId: aws.String("ResourceIdType"), // Required
|
||||
Include: aws.String("FieldNamesType"),
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
Order: aws.String("OrderType"),
|
||||
Sort: aws.String("ResourceSortType"),
|
||||
Type: aws.String("FolderContentType"),
|
||||
}
|
||||
resp, err := svc.DescribeFolderContents(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 ExampleWorkDocs_DescribeNotificationSubscriptions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DescribeNotificationSubscriptionsInput{
|
||||
OrganizationId: aws.String("IdType"), // Required
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
}
|
||||
resp, err := svc.DescribeNotificationSubscriptions(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 ExampleWorkDocs_DescribeResourcePermissions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DescribeResourcePermissionsInput{
|
||||
ResourceId: aws.String("ResourceIdType"), // Required
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
}
|
||||
resp, err := svc.DescribeResourcePermissions(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 ExampleWorkDocs_DescribeUsers() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.DescribeUsersInput{
|
||||
Fields: aws.String("FieldNamesType"),
|
||||
Include: aws.String("UserFilterType"),
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
Order: aws.String("OrderType"),
|
||||
OrganizationId: aws.String("IdType"),
|
||||
Query: aws.String("SearchQueryType"),
|
||||
Sort: aws.String("UserSortType"),
|
||||
UserIds: aws.String("UserIdsType"),
|
||||
}
|
||||
resp, err := svc.DescribeUsers(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 ExampleWorkDocs_GetDocument() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.GetDocumentInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.GetDocument(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 ExampleWorkDocs_GetDocumentPath() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.GetDocumentPathInput{
|
||||
DocumentId: aws.String("IdType"), // Required
|
||||
Fields: aws.String("FieldNamesType"),
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
}
|
||||
resp, err := svc.GetDocumentPath(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 ExampleWorkDocs_GetDocumentVersion() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.GetDocumentVersionInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
VersionId: aws.String("DocumentVersionIdType"), // Required
|
||||
Fields: aws.String("FieldNamesType"),
|
||||
}
|
||||
resp, err := svc.GetDocumentVersion(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 ExampleWorkDocs_GetFolder() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.GetFolderInput{
|
||||
FolderId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.GetFolder(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 ExampleWorkDocs_GetFolderPath() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.GetFolderPathInput{
|
||||
FolderId: aws.String("IdType"), // Required
|
||||
Fields: aws.String("FieldNamesType"),
|
||||
Limit: aws.Int64(1),
|
||||
Marker: aws.String("PageMarkerType"),
|
||||
}
|
||||
resp, err := svc.GetFolderPath(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 ExampleWorkDocs_InitiateDocumentVersionUpload() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.InitiateDocumentVersionUploadInput{
|
||||
ParentFolderId: aws.String("ResourceIdType"), // Required
|
||||
ContentCreatedTimestamp: aws.Time(time.Now()),
|
||||
ContentModifiedTimestamp: aws.Time(time.Now()),
|
||||
ContentType: aws.String("DocumentContentType"),
|
||||
DocumentSizeInBytes: aws.Int64(1),
|
||||
Id: aws.String("ResourceIdType"),
|
||||
Name: aws.String("ResourceNameType"),
|
||||
}
|
||||
resp, err := svc.InitiateDocumentVersionUpload(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 ExampleWorkDocs_RemoveAllResourcePermissions() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.RemoveAllResourcePermissionsInput{
|
||||
ResourceId: aws.String("ResourceIdType"), // Required
|
||||
}
|
||||
resp, err := svc.RemoveAllResourcePermissions(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 ExampleWorkDocs_RemoveResourcePermission() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.RemoveResourcePermissionInput{
|
||||
PrincipalId: aws.String("IdType"), // Required
|
||||
ResourceId: aws.String("ResourceIdType"), // Required
|
||||
PrincipalType: aws.String("PrincipalType"),
|
||||
}
|
||||
resp, err := svc.RemoveResourcePermission(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 ExampleWorkDocs_UpdateDocument() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.UpdateDocumentInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
Name: aws.String("ResourceNameType"),
|
||||
ParentFolderId: aws.String("ResourceIdType"),
|
||||
ResourceState: aws.String("ResourceStateType"),
|
||||
}
|
||||
resp, err := svc.UpdateDocument(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 ExampleWorkDocs_UpdateDocumentVersion() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.UpdateDocumentVersionInput{
|
||||
DocumentId: aws.String("ResourceIdType"), // Required
|
||||
VersionId: aws.String("DocumentVersionIdType"), // Required
|
||||
VersionStatus: aws.String("DocumentVersionStatus"),
|
||||
}
|
||||
resp, err := svc.UpdateDocumentVersion(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 ExampleWorkDocs_UpdateFolder() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.UpdateFolderInput{
|
||||
FolderId: aws.String("ResourceIdType"), // Required
|
||||
Name: aws.String("ResourceNameType"),
|
||||
ParentFolderId: aws.String("ResourceIdType"),
|
||||
ResourceState: aws.String("ResourceStateType"),
|
||||
}
|
||||
resp, err := svc.UpdateFolder(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 ExampleWorkDocs_UpdateUser() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := workdocs.New(sess)
|
||||
|
||||
params := &workdocs.UpdateUserInput{
|
||||
UserId: aws.String("IdType"), // Required
|
||||
GivenName: aws.String("UserAttributeValueType"),
|
||||
Locale: aws.String("LocaleType"),
|
||||
StorageRule: &workdocs.StorageRuleType{
|
||||
StorageAllocatedInBytes: aws.Int64(1),
|
||||
StorageType: aws.String("StorageType"),
|
||||
},
|
||||
Surname: aws.String("UserAttributeValueType"),
|
||||
TimeZoneId: aws.String("TimeZoneIdType"),
|
||||
Type: aws.String("UserType"),
|
||||
}
|
||||
resp, err := svc.UpdateUser(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)
|
||||
}
|
||||
+6
-34
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package workdocs
|
||||
|
||||
@@ -11,40 +11,12 @@ import (
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
// The WorkDocs API is designed for the following use cases:
|
||||
// WorkDocs provides the API operation methods for making requests to
|
||||
// Amazon WorkDocs. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// * File Migration: File migration applications are supported for users
|
||||
// who want to migrate their files from an on-premise or off-premise file
|
||||
// system or service. Users can insert files into a user directory structure,
|
||||
// as well as allow for basic metadata changes, such as modifications to
|
||||
// the permissions of files.
|
||||
//
|
||||
// * Security: Support security applications are supported for users who
|
||||
// have additional security needs, such as anti-virus or data loss prevention.
|
||||
// The APIs, in conjunction with Amazon CloudTrail, allow these applications
|
||||
// to detect when changes occur in Amazon WorkDocs, so the application can
|
||||
// take the necessary actions and replace the target file. The application
|
||||
// can also choose to email the user if the target file violates the policy.
|
||||
//
|
||||
// * eDiscovery/Analytics: General administrative applications are supported,
|
||||
// such as eDiscovery and analytics. These applications can choose to mimic
|
||||
// and/or record the actions in an Amazon WorkDocs site, in conjunction with
|
||||
// Amazon CloudTrails, to replicate data for eDiscovery, backup, or analytical
|
||||
// applications.
|
||||
//
|
||||
// All Amazon WorkDocs APIs are Amazon authenticated, certificate-signed APIs.
|
||||
// They not only require the use of the AWS SDK, but also allow for the exclusive
|
||||
// use of IAM users and roles to help facilitate access, trust, and permission
|
||||
// policies. By creating a role and allowing an IAM user to access the Amazon
|
||||
// WorkDocs site, the IAM user gains full administrative visibility into the
|
||||
// entire Amazon WorkDocs site (or as set in the IAM policy). This includes,
|
||||
// but is not limited to, the ability to modify file permissions and upload
|
||||
// any file to any user. This allows developers to perform the three use cases
|
||||
// above, as well as give users the ability to grant access on a selective basis
|
||||
// using the IAM model.
|
||||
// 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/workdocs-2016-05-01
|
||||
// WorkDocs methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type WorkDocs struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
+42
-2
@@ -1,4 +1,4 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package workdocsiface provides an interface to enable mocking the Amazon WorkDocs service client
|
||||
// for testing your code.
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
//
|
||||
// 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.
|
||||
// to inject custom request handlers into the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon WorkDocs.
|
||||
@@ -72,10 +72,22 @@ type WorkDocsAPI interface {
|
||||
AddResourcePermissionsWithContext(aws.Context, *workdocs.AddResourcePermissionsInput, ...request.Option) (*workdocs.AddResourcePermissionsOutput, error)
|
||||
AddResourcePermissionsRequest(*workdocs.AddResourcePermissionsInput) (*request.Request, *workdocs.AddResourcePermissionsOutput)
|
||||
|
||||
CreateComment(*workdocs.CreateCommentInput) (*workdocs.CreateCommentOutput, error)
|
||||
CreateCommentWithContext(aws.Context, *workdocs.CreateCommentInput, ...request.Option) (*workdocs.CreateCommentOutput, error)
|
||||
CreateCommentRequest(*workdocs.CreateCommentInput) (*request.Request, *workdocs.CreateCommentOutput)
|
||||
|
||||
CreateCustomMetadata(*workdocs.CreateCustomMetadataInput) (*workdocs.CreateCustomMetadataOutput, error)
|
||||
CreateCustomMetadataWithContext(aws.Context, *workdocs.CreateCustomMetadataInput, ...request.Option) (*workdocs.CreateCustomMetadataOutput, error)
|
||||
CreateCustomMetadataRequest(*workdocs.CreateCustomMetadataInput) (*request.Request, *workdocs.CreateCustomMetadataOutput)
|
||||
|
||||
CreateFolder(*workdocs.CreateFolderInput) (*workdocs.CreateFolderOutput, error)
|
||||
CreateFolderWithContext(aws.Context, *workdocs.CreateFolderInput, ...request.Option) (*workdocs.CreateFolderOutput, error)
|
||||
CreateFolderRequest(*workdocs.CreateFolderInput) (*request.Request, *workdocs.CreateFolderOutput)
|
||||
|
||||
CreateLabels(*workdocs.CreateLabelsInput) (*workdocs.CreateLabelsOutput, error)
|
||||
CreateLabelsWithContext(aws.Context, *workdocs.CreateLabelsInput, ...request.Option) (*workdocs.CreateLabelsOutput, error)
|
||||
CreateLabelsRequest(*workdocs.CreateLabelsInput) (*request.Request, *workdocs.CreateLabelsOutput)
|
||||
|
||||
CreateNotificationSubscription(*workdocs.CreateNotificationSubscriptionInput) (*workdocs.CreateNotificationSubscriptionOutput, error)
|
||||
CreateNotificationSubscriptionWithContext(aws.Context, *workdocs.CreateNotificationSubscriptionInput, ...request.Option) (*workdocs.CreateNotificationSubscriptionOutput, error)
|
||||
CreateNotificationSubscriptionRequest(*workdocs.CreateNotificationSubscriptionInput) (*request.Request, *workdocs.CreateNotificationSubscriptionOutput)
|
||||
@@ -88,6 +100,14 @@ type WorkDocsAPI interface {
|
||||
DeactivateUserWithContext(aws.Context, *workdocs.DeactivateUserInput, ...request.Option) (*workdocs.DeactivateUserOutput, error)
|
||||
DeactivateUserRequest(*workdocs.DeactivateUserInput) (*request.Request, *workdocs.DeactivateUserOutput)
|
||||
|
||||
DeleteComment(*workdocs.DeleteCommentInput) (*workdocs.DeleteCommentOutput, error)
|
||||
DeleteCommentWithContext(aws.Context, *workdocs.DeleteCommentInput, ...request.Option) (*workdocs.DeleteCommentOutput, error)
|
||||
DeleteCommentRequest(*workdocs.DeleteCommentInput) (*request.Request, *workdocs.DeleteCommentOutput)
|
||||
|
||||
DeleteCustomMetadata(*workdocs.DeleteCustomMetadataInput) (*workdocs.DeleteCustomMetadataOutput, error)
|
||||
DeleteCustomMetadataWithContext(aws.Context, *workdocs.DeleteCustomMetadataInput, ...request.Option) (*workdocs.DeleteCustomMetadataOutput, error)
|
||||
DeleteCustomMetadataRequest(*workdocs.DeleteCustomMetadataInput) (*request.Request, *workdocs.DeleteCustomMetadataOutput)
|
||||
|
||||
DeleteDocument(*workdocs.DeleteDocumentInput) (*workdocs.DeleteDocumentOutput, error)
|
||||
DeleteDocumentWithContext(aws.Context, *workdocs.DeleteDocumentInput, ...request.Option) (*workdocs.DeleteDocumentOutput, error)
|
||||
DeleteDocumentRequest(*workdocs.DeleteDocumentInput) (*request.Request, *workdocs.DeleteDocumentOutput)
|
||||
@@ -100,6 +120,10 @@ type WorkDocsAPI interface {
|
||||
DeleteFolderContentsWithContext(aws.Context, *workdocs.DeleteFolderContentsInput, ...request.Option) (*workdocs.DeleteFolderContentsOutput, error)
|
||||
DeleteFolderContentsRequest(*workdocs.DeleteFolderContentsInput) (*request.Request, *workdocs.DeleteFolderContentsOutput)
|
||||
|
||||
DeleteLabels(*workdocs.DeleteLabelsInput) (*workdocs.DeleteLabelsOutput, error)
|
||||
DeleteLabelsWithContext(aws.Context, *workdocs.DeleteLabelsInput, ...request.Option) (*workdocs.DeleteLabelsOutput, error)
|
||||
DeleteLabelsRequest(*workdocs.DeleteLabelsInput) (*request.Request, *workdocs.DeleteLabelsOutput)
|
||||
|
||||
DeleteNotificationSubscription(*workdocs.DeleteNotificationSubscriptionInput) (*workdocs.DeleteNotificationSubscriptionOutput, error)
|
||||
DeleteNotificationSubscriptionWithContext(aws.Context, *workdocs.DeleteNotificationSubscriptionInput, ...request.Option) (*workdocs.DeleteNotificationSubscriptionOutput, error)
|
||||
DeleteNotificationSubscriptionRequest(*workdocs.DeleteNotificationSubscriptionInput) (*request.Request, *workdocs.DeleteNotificationSubscriptionOutput)
|
||||
@@ -108,6 +132,14 @@ type WorkDocsAPI interface {
|
||||
DeleteUserWithContext(aws.Context, *workdocs.DeleteUserInput, ...request.Option) (*workdocs.DeleteUserOutput, error)
|
||||
DeleteUserRequest(*workdocs.DeleteUserInput) (*request.Request, *workdocs.DeleteUserOutput)
|
||||
|
||||
DescribeActivities(*workdocs.DescribeActivitiesInput) (*workdocs.DescribeActivitiesOutput, error)
|
||||
DescribeActivitiesWithContext(aws.Context, *workdocs.DescribeActivitiesInput, ...request.Option) (*workdocs.DescribeActivitiesOutput, error)
|
||||
DescribeActivitiesRequest(*workdocs.DescribeActivitiesInput) (*request.Request, *workdocs.DescribeActivitiesOutput)
|
||||
|
||||
DescribeComments(*workdocs.DescribeCommentsInput) (*workdocs.DescribeCommentsOutput, error)
|
||||
DescribeCommentsWithContext(aws.Context, *workdocs.DescribeCommentsInput, ...request.Option) (*workdocs.DescribeCommentsOutput, error)
|
||||
DescribeCommentsRequest(*workdocs.DescribeCommentsInput) (*request.Request, *workdocs.DescribeCommentsOutput)
|
||||
|
||||
DescribeDocumentVersions(*workdocs.DescribeDocumentVersionsInput) (*workdocs.DescribeDocumentVersionsOutput, error)
|
||||
DescribeDocumentVersionsWithContext(aws.Context, *workdocs.DescribeDocumentVersionsInput, ...request.Option) (*workdocs.DescribeDocumentVersionsOutput, error)
|
||||
DescribeDocumentVersionsRequest(*workdocs.DescribeDocumentVersionsInput) (*request.Request, *workdocs.DescribeDocumentVersionsOutput)
|
||||
@@ -130,6 +162,10 @@ type WorkDocsAPI interface {
|
||||
DescribeResourcePermissionsWithContext(aws.Context, *workdocs.DescribeResourcePermissionsInput, ...request.Option) (*workdocs.DescribeResourcePermissionsOutput, error)
|
||||
DescribeResourcePermissionsRequest(*workdocs.DescribeResourcePermissionsInput) (*request.Request, *workdocs.DescribeResourcePermissionsOutput)
|
||||
|
||||
DescribeRootFolders(*workdocs.DescribeRootFoldersInput) (*workdocs.DescribeRootFoldersOutput, error)
|
||||
DescribeRootFoldersWithContext(aws.Context, *workdocs.DescribeRootFoldersInput, ...request.Option) (*workdocs.DescribeRootFoldersOutput, error)
|
||||
DescribeRootFoldersRequest(*workdocs.DescribeRootFoldersInput) (*request.Request, *workdocs.DescribeRootFoldersOutput)
|
||||
|
||||
DescribeUsers(*workdocs.DescribeUsersInput) (*workdocs.DescribeUsersOutput, error)
|
||||
DescribeUsersWithContext(aws.Context, *workdocs.DescribeUsersInput, ...request.Option) (*workdocs.DescribeUsersOutput, error)
|
||||
DescribeUsersRequest(*workdocs.DescribeUsersInput) (*request.Request, *workdocs.DescribeUsersOutput)
|
||||
@@ -137,6 +173,10 @@ type WorkDocsAPI interface {
|
||||
DescribeUsersPages(*workdocs.DescribeUsersInput, func(*workdocs.DescribeUsersOutput, bool) bool) error
|
||||
DescribeUsersPagesWithContext(aws.Context, *workdocs.DescribeUsersInput, func(*workdocs.DescribeUsersOutput, bool) bool, ...request.Option) error
|
||||
|
||||
GetCurrentUser(*workdocs.GetCurrentUserInput) (*workdocs.GetCurrentUserOutput, error)
|
||||
GetCurrentUserWithContext(aws.Context, *workdocs.GetCurrentUserInput, ...request.Option) (*workdocs.GetCurrentUserOutput, error)
|
||||
GetCurrentUserRequest(*workdocs.GetCurrentUserInput) (*request.Request, *workdocs.GetCurrentUserOutput)
|
||||
|
||||
GetDocument(*workdocs.GetDocumentInput) (*workdocs.GetDocumentOutput, error)
|
||||
GetDocumentWithContext(aws.Context, *workdocs.GetDocumentInput, ...request.Option) (*workdocs.GetDocumentOutput, error)
|
||||
GetDocumentRequest(*workdocs.GetDocumentInput) (*request.Request, *workdocs.GetDocumentOutput)
|
||||
|
||||
Reference in New Issue
Block a user