github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl@v0.2.0/awscryptographymaterialproviderssmithygenerated/CryptographicMaterialsCacheNativeWrapper.go (about)

     1  // Code generated by smithy-go-codegen DO NOT EDIT.
     2  
     3  package awscryptographymaterialproviderssmithygenerated
     4  
     5  import (
     6  	"github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/AwsCryptographyMaterialProvidersTypes"
     7  	"github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl/awscryptographymaterialproviderssmithygeneratedtypes"
     8  	"github.com/aws/aws-cryptographic-material-providers-library/releases/go/smithy-dafny-standard-library/Wrappers"
     9  	"github.com/dafny-lang/DafnyRuntimeGo/v4/dafny"
    10  )
    11  
    12  type CryptographicMaterialsCacheNativeWrapper struct {
    13  	AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache
    14  	Impl awscryptographymaterialproviderssmithygeneratedtypes.ICryptographicMaterialsCache
    15  }
    16  
    17  func (this *CryptographicMaterialsCacheNativeWrapper) PutCacheEntry(input AwsCryptographyMaterialProvidersTypes.PutCacheEntryInput) Wrappers.Result {
    18  	var native_request = PutCacheEntryInput_FromDafny(input)
    19  	var native_error = this.Impl.PutCacheEntry(native_request)
    20  	if native_error != nil {
    21  		return Wrappers.Companion_Result_.Create_Failure_(Error_ToDafny(native_error))
    22  	}
    23  	return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf())
    24  }
    25  
    26  func (this *CryptographicMaterialsCacheNativeWrapper) GetCacheEntry(input AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput) Wrappers.Result {
    27  	var native_request = GetCacheEntryInput_FromDafny(input)
    28  	var native_response, native_error = this.Impl.GetCacheEntry(native_request)
    29  	if native_error != nil {
    30  		return Wrappers.Companion_Result_.Create_Failure_(Error_ToDafny(native_error))
    31  	}
    32  	return Wrappers.Companion_Result_.Create_Success_(GetCacheEntryOutput_ToDafny(*native_response))
    33  }
    34  
    35  func (this *CryptographicMaterialsCacheNativeWrapper) UpdateUsageMetadata(input AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput) Wrappers.Result {
    36  	var native_request = UpdateUsageMetadataInput_FromDafny(input)
    37  	var native_error = this.Impl.UpdateUsageMetadata(native_request)
    38  	if native_error != nil {
    39  		return Wrappers.Companion_Result_.Create_Failure_(Error_ToDafny(native_error))
    40  	}
    41  	return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf())
    42  }
    43  
    44  func (this *CryptographicMaterialsCacheNativeWrapper) DeleteCacheEntry(input AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput) Wrappers.Result {
    45  	var native_request = DeleteCacheEntryInput_FromDafny(input)
    46  	var native_error = this.Impl.DeleteCacheEntry(native_request)
    47  	if native_error != nil {
    48  		return Wrappers.Companion_Result_.Create_Failure_(Error_ToDafny(native_error))
    49  	}
    50  	return Wrappers.Companion_Result_.Create_Success_(dafny.TupleOf())
    51  }