github.com/aws/aws-cryptographic-material-providers-library/releases/go/mpl@v0.2.0/awscryptographymaterialproviderssmithygenerated/CryptographicMaterialsManager.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 CryptographicMaterialsManager struct {
    11  	Impl AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager
    12  }
    13  
    14  func (this *CryptographicMaterialsManager) GetEncryptionMaterials(params awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsInput) (*awscryptographymaterialproviderssmithygeneratedtypes.GetEncryptionMaterialsOutput, error) {
    15  	var dafny_request AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsInput = GetEncryptionMaterialsInput_ToDafny(params)
    16  	var dafny_response = this.Impl.GetEncryptionMaterials(dafny_request)
    17  
    18  	if dafny_response.Is_Failure() {
    19  		err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error)
    20  		return nil, Error_FromDafny(err)
    21  	}
    22  	var native_response = GetEncryptionMaterialsOutput_FromDafny(dafny_response.Dtor_value().(AwsCryptographyMaterialProvidersTypes.GetEncryptionMaterialsOutput))
    23  	return &native_response, nil
    24  
    25  }
    26  
    27  func (this *CryptographicMaterialsManager) DecryptMaterials(params awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsInput) (*awscryptographymaterialproviderssmithygeneratedtypes.DecryptMaterialsOutput, error) {
    28  	var dafny_request AwsCryptographyMaterialProvidersTypes.DecryptMaterialsInput = DecryptMaterialsInput_ToDafny(params)
    29  	var dafny_response = this.Impl.DecryptMaterials(dafny_request)
    30  
    31  	if dafny_response.Is_Failure() {
    32  		err := dafny_response.Dtor_error().(AwsCryptographyMaterialProvidersTypes.Error)
    33  		return nil, Error_FromDafny(err)
    34  	}
    35  	var native_response = DecryptMaterialsOutput_FromDafny(dafny_response.Dtor_value().(AwsCryptographyMaterialProvidersTypes.DecryptMaterialsOutput))
    36  	return &native_response, nil
    37  
    38  }