Task <ClientEncryptionKeyResponse> CreateClientEncryptionKeyAsync( ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { return(this.ClientContext.OperationHelperAsync( nameof(CreateClientEncryptionKeyAsync), requestOptions, (trace) => base.CreateClientEncryptionKeyAsync(trace, clientEncryptionKeyProperties, requestOptions, cancellationToken))); }
public override Task <ClientEncryptionKeyResponse> ReplaceAsync( ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { return(this.ClientContext.OperationHelperAsync( nameof(ReplaceAsync), requestOptions, (diagnostics, trace) => base.ReplaceAsync(clientEncryptionKeyProperties, requestOptions, cancellationToken))); }
/// <inheritdoc/> public override async Task <ClientEncryptionKeyResponse> ReplaceAsync( ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { ClientEncryptionKeyResponse response = await this.ReplaceInternalAsync( clientEncryptionKeyProperties, requestOptions, diagnosticsContext : null, cancellationToken : cancellationToken); return(response); }
/// <inheritdoc/> public override async Task <ClientEncryptionKeyResponse> ReplaceAsync( ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { ClientEncryptionKeyResponse response = await this.ReplaceInternalAsync( clientEncryptionKeyProperties, requestOptions, trace : NoOpTrace.Singleton, cancellationToken : cancellationToken); return(response); }
public override ClientEncryptionKeyResponse CreateClientEncryptionKeyResponse( ClientEncryptionKey clientEncryptionKey, ResponseMessage responseMessage) { return(this.ProcessMessage(responseMessage, (cosmosResponseMessage) => { ClientEncryptionKeyProperties cekProperties = this.ToObjectpublic <ClientEncryptionKeyProperties>(cosmosResponseMessage); return new ClientEncryptionKeyResponse( cosmosResponseMessage.StatusCode, cosmosResponseMessage.Headers, cekProperties, clientEncryptionKey, cosmosResponseMessage.Diagnostics); })); }
private async Task <ClientEncryptionKeyResponse> ReplaceInternalAsync( ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions, CosmosDiagnosticsContext diagnosticsContext, CancellationToken cancellationToken) { ResponseMessage responseMessage = await this.ProcessStreamAsync( streamPayload : this.ClientContext.SerializerCore.ToStream(clientEncryptionKeyProperties), operationType : OperationType.Replace, requestOptions : requestOptions, diagnosticsContext : diagnosticsContext, cancellationToken : cancellationToken); ClientEncryptionKeyResponse response = this.ClientContext.ResponseFactory.CreateClientEncryptionKeyResponse(this, responseMessage); Debug.Assert(response.Resource != null); return(response); }
async Task <ClientEncryptionKeyResponse> CreateClientEncryptionKeyAsync( ITrace trace, ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions = null, CancellationToken cancellationToken = default) { Stream streamPayload = this.ClientContext.SerializerCore.ToStream(clientEncryptionKeyProperties); ResponseMessage responseMessage = await this.CreateClientEncryptionKeyStreamAsync( trace : trace, streamPayload : streamPayload, requestOptions : requestOptions, cancellationToken : cancellationToken); ClientEncryptionKeyResponse cekResponse = this.ClientContext.ResponseFactory.CreateClientEncryptionKeyResponse( this.GetClientEncryptionKey(clientEncryptionKeyProperties.Id), responseMessage); Debug.Assert(cekResponse.Resource != null); return(cekResponse); }
/// <summary> /// Replace a <see cref="ClientEncryptionKeyProperties"/> from the Azure Cosmos service as an asynchronous operation. /// This method is not meant to be invoked directly. Please see https://aka.ms/CosmosClientEncryption in order to use client-side encryption. /// </summary> /// <param name="clientEncryptionKeyProperties">The <see cref="ClientEncryptionKeyProperties"/> object.</param> /// <param name="requestOptions">(Optional) The options for the request.</param> /// <param name="cancellationToken">(Optional) <see cref="CancellationToken"/> representing request cancellation.</param> /// <returns> /// A <see cref="Task"/> containing a <see cref="ClientEncryptionKeyResponse"/> which wraps a <see cref="ClientEncryptionKeyProperties"/> containing the replace resource record. /// </returns> /// <exception>https://aka.ms/cosmosdb-dot-net-exceptions</exception> public abstract Task <ClientEncryptionKeyResponse> ReplaceAsync( ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions = null, CancellationToken cancellationToken = default);