-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathshim.go
More file actions
70 lines (60 loc) · 4.95 KB
/
Copy pathshim.go
File metadata and controls
70 lines (60 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Code generated by smithy-go-codegen DO NOT EDIT.
package WrappedAwsCryptographyDbEncryptionSdkStructuredEncryptionService
import (
"context"
"github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers"
"github.com/aws/aws-database-encryption-sdk-dynamodb/releases/go/dynamodb-esdk/AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes"
"github.com/aws/aws-database-encryption-sdk-dynamodb/releases/go/dynamodb-esdk/awscryptographydbencryptionsdkstructuredencryptionsmithygenerated"
)
type Shim struct {
AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.IStructuredEncryptionClient
client *awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.Client
}
func (_static *CompanionStruct_Default___) WrappedStructuredEncryption(inputConfig AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.StructuredEncryptionConfig) Wrappers.Result {
var nativeConfig = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.StructuredEncryptionConfig_FromDafny(inputConfig)
var nativeClient, nativeError = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.NewClient(nativeConfig)
if nativeError != nil {
return Wrappers.Companion_Result_.Create_Failure_(AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.Companion_Error_.Create_Opaque_(nativeError))
}
return Wrappers.Companion_Result_.Create_Success_(&Shim{client: nativeClient})
}
func (shim *Shim) EncryptStructure(input AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.EncryptStructureInput) Wrappers.Result {
var native_request = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.EncryptStructureInput_FromDafny(input)
var native_response, native_error = shim.client.EncryptStructure(context.Background(), native_request)
if native_error != nil {
return Wrappers.Companion_Result_.Create_Failure_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.Error_ToDafny(native_error))
}
return Wrappers.Companion_Result_.Create_Success_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.EncryptStructureOutput_ToDafny(*native_response))
}
func (shim *Shim) DecryptStructure(input AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.DecryptStructureInput) Wrappers.Result {
var native_request = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.DecryptStructureInput_FromDafny(input)
var native_response, native_error = shim.client.DecryptStructure(context.Background(), native_request)
if native_error != nil {
return Wrappers.Companion_Result_.Create_Failure_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.Error_ToDafny(native_error))
}
return Wrappers.Companion_Result_.Create_Success_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.DecryptStructureOutput_ToDafny(*native_response))
}
func (shim *Shim) EncryptPathStructure(input AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.EncryptPathStructureInput) Wrappers.Result {
var native_request = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.EncryptPathStructureInput_FromDafny(input)
var native_response, native_error = shim.client.EncryptPathStructure(context.Background(), native_request)
if native_error != nil {
return Wrappers.Companion_Result_.Create_Failure_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.Error_ToDafny(native_error))
}
return Wrappers.Companion_Result_.Create_Success_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.EncryptPathStructureOutput_ToDafny(*native_response))
}
func (shim *Shim) DecryptPathStructure(input AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.DecryptPathStructureInput) Wrappers.Result {
var native_request = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.DecryptPathStructureInput_FromDafny(input)
var native_response, native_error = shim.client.DecryptPathStructure(context.Background(), native_request)
if native_error != nil {
return Wrappers.Companion_Result_.Create_Failure_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.Error_ToDafny(native_error))
}
return Wrappers.Companion_Result_.Create_Success_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.DecryptPathStructureOutput_ToDafny(*native_response))
}
func (shim *Shim) ResolveAuthActions(input AwsCryptographyDbEncryptionSdkStructuredEncryptionTypes.ResolveAuthActionsInput) Wrappers.Result {
var native_request = awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.ResolveAuthActionsInput_FromDafny(input)
var native_response, native_error = shim.client.ResolveAuthActions(context.Background(), native_request)
if native_error != nil {
return Wrappers.Companion_Result_.Create_Failure_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.Error_ToDafny(native_error))
}
return Wrappers.Companion_Result_.Create_Success_(awscryptographydbencryptionsdkstructuredencryptionsmithygenerated.ResolveAuthActionsOutput_ToDafny(*native_response))
}