internal DeploymentOperation(ArmResource options, DeploymentOperationData resource) : base(options, resource.Id)
 {
     HasData            = true;
     _data              = resource;
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _restClient        = new DeploymentRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
 }
        public async Task <Response <DeploymentOperationData> > GetAtScopeAsync(string scope, string deploymentName, string operationId, CancellationToken cancellationToken = default)
        {
            if (scope == null)
            {
                throw new ArgumentNullException(nameof(scope));
            }
            if (deploymentName == null)
            {
                throw new ArgumentNullException(nameof(deploymentName));
            }
            if (operationId == null)
            {
                throw new ArgumentNullException(nameof(operationId));
            }

            using var message = CreateGetAtScopeRequest(scope, deploymentName, operationId);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                DeploymentOperationData value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = DeploymentOperationData.DeserializeDeploymentOperationData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }