internal static Task <SkuUpdateResponse> UpdateAntaresCurrentSkuAsync(
            SkuOperations skuOperations,
            string resourceId,
            SkuUpdateParameters parameters,
            string apiVersion,
            CancellationToken cancellationToken)
        {
            AntaresSkuUpdateRequest antaresUpdateParameters = new AntaresSkuUpdateRequest
            {
                WorkerSize      = AntaresSkuOperations.GetAntaresWorkerSize(parameters.Sku.Name),
                Sku             = parameters.Sku.Tier,
                NumberOfWorkers = parameters.Sku.Capacity
            };

            return(skuOperations.UpdateAntaresCurrentSkuInternalAsync(resourceId, antaresUpdateParameters, apiVersion, cancellationToken));
        }
        internal async static Task <SkuGetResponse> GetAntaresCurrentSku(SkuOperations skuOperations, string resourceId, string apiVersion, CancellationToken cancellationToken)
        {
            AntaresSkuGetResponse response = await skuOperations.GetAntaresCurrentSkuInternalAsync(resourceId, apiVersion, cancellationToken);

            return(new SkuGetResponse
            {
                Properties = new SkuGetProperties
                {
                    Sku = new CurrentSku
                    {
                        Name = AntaresSkuOperations.GetAnatresSkuName(response.Properties.CurrentWorkerSize, response.Properties.Sku),
                        Tier = response.Properties.Sku,
                        Capacity = response.Properties.CurrentNumberOfWorkers
                    }
                }
            });
        }
        /// <param name='resourceId'>
        /// Required. The resource id.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public Task <SkuGetResponse> GetCurrentSkuAsync(string resourceId, string apiVersion, CancellationToken cancellationToken)
        {
            // Validate
            if (resourceId == null)
            {
                throw new ArgumentNullException("resourceId");
            }

            if (AntaresSkuOperations.IsAntaresResourceType(resourceId))
            {
                return(AntaresSkuOperations.GetAntaresCurrentSku(this, resourceId, apiVersion, cancellationToken));
            }
            else
            {
                return(this.GetCurrentSkuInternalAsync(resourceId, apiVersion, cancellationToken));
            }
        }
        /// <param name='resourceId'>
        /// Required. The resource id.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        /// <returns>
        /// A standard service response including an HTTP status code and
        /// request ID.
        /// </returns>
        public async Task <SkuListResponse> ListSkuDefinitionsAsync(string resourceId, string apiVersion, CancellationToken cancellationToken)
        {
            // Validate
            if (resourceId == null)
            {
                throw new ArgumentNullException("resourceId");
            }

            if (AntaresSkuOperations.IsAntaresResourceType(resourceId))
            {
                // Antares does not currently support the new contract and has no API to get all valid SKUs so these are hardcoded for now.
                return(AntaresSkuOperations.ListAntaresSkus());
            }
            else
            {
                return(await this.ListSkuDefinitionsInternalAsync(resourceId, apiVersion, cancellationToken));
            }
        }
        public Task <SkuUpdateResponse> UpdateCurrentSkuAsync(string resourceId, SkuUpdateParameters parameters, string apiVersion, CancellationToken cancellationToken)
        {
            // Validate
            if (resourceId == null)
            {
                throw new ArgumentNullException("resourceId");
            }

            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            if (parameters.Sku == null)
            {
                throw new ArgumentNullException("Sku");
            }

            if (parameters.Sku.Name == null)
            {
                throw new ArgumentNullException("Sku.Name");
            }

            if (parameters.Sku.Tier == null)
            {
                throw new ArgumentNullException("Sku.Tier");
            }

            // Confirm resourceId is supported
            if (AntaresSkuOperations.IsAntaresResourceType(resourceId))
            {
                return(AntaresSkuOperations.UpdateAntaresCurrentSkuAsync(this, resourceId, parameters, apiVersion, cancellationToken));
            }
            else
            {
                return(this.UpdateCurrentSkuInternalAsync(resourceId, parameters, apiVersion, cancellationToken));
            }
        }