github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl@v0.2.0/awscryptographymaterialproviderssmithygenerated/CryptographicMaterialsCache.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  )
     9  
    10  type CryptographicMaterialsCache struct {
    11  	Impl AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache
    12  }
    13  
    14  func (this *CryptographicMaterialsCache) PutCacheEntry(params awscryptographymaterialproviderssmithygeneratedtypes.PutCacheEntryInput) error {
    15  	var dafny_request AwsCryptographyMaterialProvidersTypes.PutCacheEntryInput = PutCacheEntryInput_ToDafny(params)
    16  	var dafny_response = this.Impl.PutCacheEntry(dafny_request)
    17  
    18  	if dafny_response.Is_Failure() {
    19  		err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error)
    20  		return Error_FromDafny(err)
    21  	}
    22  	return nil
    23  }
    24  
    25  func (this *CryptographicMaterialsCache) GetCacheEntry(params awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryInput) (*awscryptographymaterialproviderssmithygeneratedtypes.GetCacheEntryOutput, error) {
    26  	var dafny_request AwsCryptographyMaterialProvidersTypes.GetCacheEntryInput = GetCacheEntryInput_ToDafny(params)
    27  	var dafny_response = this.Impl.GetCacheEntry(dafny_request)
    28  
    29  	if dafny_response.Is_Failure() {
    30  		err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error)
    31  		return nil, Error_FromDafny(err)
    32  	}
    33  	var native_response = GetCacheEntryOutput_FromDafny(dafny_response.Dtor_value().(AwsCryptographyMaterialProvidersTypes.GetCacheEntryOutput))
    34  	return &native_response, nil
    35  
    36  }
    37  
    38  func (this *CryptographicMaterialsCache) UpdateUsageMetadata(params awscryptographymaterialproviderssmithygeneratedtypes.UpdateUsageMetadataInput) error {
    39  	var dafny_request AwsCryptographyMaterialProvidersTypes.UpdateUsageMetadataInput = UpdateUsageMetadataInput_ToDafny(params)
    40  	var dafny_response = this.Impl.UpdateUsageMetadata(dafny_request)
    41  
    42  	if dafny_response.Is_Failure() {
    43  		err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error)
    44  		return Error_FromDafny(err)
    45  	}
    46  	return nil
    47  }
    48  
    49  func (this *CryptographicMaterialsCache) DeleteCacheEntry(params awscryptographymaterialproviderssmithygeneratedtypes.DeleteCacheEntryInput) error {
    50  	var dafny_request AwsCryptographyMaterialProvidersTypes.DeleteCacheEntryInput = DeleteCacheEntryInput_ToDafny(params)
    51  	var dafny_response = this.Impl.DeleteCacheEntry(dafny_request)
    52  
    53  	if dafny_response.Is_Failure() {
    54  		err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error)
    55  		return Error_FromDafny(err)
    56  	}
    57  	return nil
    58  }