OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Rename an object in the given Object Storage namespace.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Rename an object in the given Object Storage namespace.
Rename an object in the given Object Storage namespace .
public async Task<RenameObjectResponse> RenameObject(RenameObjectRequest request)
        {
            var uri = new Uri($"{GetEndPointNoneVersion(ObjectStorageServices.Bucket(request.NamespaceName, request.BucketName), this.Region)}/actions/renameObject");
            using (var webResponse = await this.RestClientAsync.Post(uri, request.RenameObjectDetails, new HttpRequestHeaderParam() { OpcClientRequestId = request.OpcClientRequestId }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new RenameObjectResponse()
                {
                    ETag = webResponse.Headers.Get("ETag"),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id"),
                    LastModified = webResponse.Headers.Get("last-modified")
                };
            }
        }
public async Task < RenameObjectResponse > RenameObject ( RenameObjectRequest request ) { var uri = new Uri ( $" { GetEndPointNoneVersion ( ObjectStorageServices . Bucket ( request . NamespaceName , request . BucketName ) , this . Region ) } /actions/renameObject " ) ; using ( var webResponse = await this . RestClientAsync . Post ( uri , request . RenameObjectDetails , new HttpRequestHeaderParam ( ) { OpcClientRequestId = request . OpcClientRequestId } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new RenameObjectResponse ( ) { ETag = webResponse . Headers . Get ( " " ) , OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) , LastModified = webResponse . Headers . Get ( " " ) } ; } }
Rename an object in the given Object Storage namespace.
Rename an object in the given Object Storage namespace .
None
request
RenameObjectRequest
None