1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package dataexchange 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/dataexchange/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 "time" 13) 14 15// This operation updates an asset. 16func (c *Client) UpdateAsset(ctx context.Context, params *UpdateAssetInput, optFns ...func(*Options)) (*UpdateAssetOutput, error) { 17 if params == nil { 18 params = &UpdateAssetInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "UpdateAsset", params, optFns, addOperationUpdateAssetMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*UpdateAssetOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31// The request body for UpdateAsset. 32type UpdateAssetInput struct { 33 34 // The unique identifier for an asset. 35 // 36 // This member is required. 37 AssetId *string 38 39 // The unique identifier for a data set. 40 // 41 // This member is required. 42 DataSetId *string 43 44 // The name of the asset. When importing from Amazon S3, the S3 object key is used 45 // as the asset name. When exporting to Amazon S3, the asset name is used as 46 // default target S3 object key. 47 // 48 // This member is required. 49 Name *string 50 51 // The unique identifier for a revision. 52 // 53 // This member is required. 54 RevisionId *string 55} 56 57type UpdateAssetOutput struct { 58 59 // The ARN for the asset. 60 Arn *string 61 62 // Information about the asset, including its size. 63 AssetDetails *types.AssetDetails 64 65 // The type of file your data is stored in. Currently, the supported asset type is 66 // S3_SNAPSHOT. 67 AssetType types.AssetType 68 69 // The date and time that the asset was created, in ISO 8601 format. 70 CreatedAt *time.Time 71 72 // The unique identifier for the data set associated with this asset. 73 DataSetId *string 74 75 // The unique identifier for the asset. 76 Id *string 77 78 // The name of the asset When importing from Amazon S3, the S3 object key is used 79 // as the asset name. When exporting to Amazon S3, the asset name is used as 80 // default target S3 object key. 81 Name *string 82 83 // The unique identifier for the revision associated with this asset. 84 RevisionId *string 85 86 // The asset ID of the owned asset corresponding to the entitled asset being 87 // viewed. This parameter is returned when an asset owner is viewing the entitled 88 // copy of its owned asset. 89 SourceId *string 90 91 // The date and time that the asset was last updated, in ISO 8601 format. 92 UpdatedAt *time.Time 93 94 // Metadata pertaining to the operation's result. 95 ResultMetadata middleware.Metadata 96} 97 98func addOperationUpdateAssetMiddlewares(stack *middleware.Stack, options Options) (err error) { 99 err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAsset{}, middleware.After) 100 if err != nil { 101 return err 102 } 103 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAsset{}, middleware.After) 104 if err != nil { 105 return err 106 } 107 if err = addSetLoggerMiddleware(stack, options); err != nil { 108 return err 109 } 110 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 111 return err 112 } 113 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 114 return err 115 } 116 if err = addResolveEndpointMiddleware(stack, options); err != nil { 117 return err 118 } 119 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 120 return err 121 } 122 if err = addRetryMiddlewares(stack, options); err != nil { 123 return err 124 } 125 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 126 return err 127 } 128 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 129 return err 130 } 131 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 132 return err 133 } 134 if err = addClientUserAgent(stack); err != nil { 135 return err 136 } 137 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 138 return err 139 } 140 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 141 return err 142 } 143 if err = addOpUpdateAssetValidationMiddleware(stack); err != nil { 144 return err 145 } 146 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAsset(options.Region), middleware.Before); err != nil { 147 return err 148 } 149 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 150 return err 151 } 152 if err = addResponseErrorMiddleware(stack); err != nil { 153 return err 154 } 155 if err = addRequestResponseLogging(stack, options); err != nil { 156 return err 157 } 158 return nil 159} 160 161func newServiceMetadataMiddleware_opUpdateAsset(region string) *awsmiddleware.RegisterServiceMetadata { 162 return &awsmiddleware.RegisterServiceMetadata{ 163 Region: region, 164 ServiceID: ServiceID, 165 SigningName: "dataexchange", 166 OperationName: "UpdateAsset", 167 } 168} 169