public ValueTask <CustomResourceDefinition> DeleteCustomResourceDefinition(string customResourceDefinitionName, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrWhiteSpace(customResourceDefinitionName))
            {
                throw new ArgumentNullException(nameof(customResourceDefinitionName));
            }

            return(this.DeleteAsync <CustomResourceDefinition>(CustomResourceDefinitionUrls.ObjectUrl(customResourceDefinitionName), immediateDeleteOptions, cancellationToken: cancellationToken));
        }
        public Task <CustomResourceDefinition> GetCustomResourceDefinition(string customResourceDefinitionName, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrWhiteSpace(customResourceDefinitionName))
            {
                throw new ArgumentNullException(nameof(customResourceDefinitionName));
            }

            return(this.GetAsync <CustomResourceDefinition>(CustomResourceDefinitionUrls.ObjectUrl(customResourceDefinitionName), cancellationToken: cancellationToken));
        }
        public ValueTask <CustomResourceDefinition> ReplaceCustomResourceDefinition(CustomResourceDefinition customResourceDefinition, CancellationToken cancellationToken = default)
        {
            if (customResourceDefinition == null)
            {
                throw new ArgumentNullException(nameof(customResourceDefinition));
            }

            if (customResourceDefinition.Metadata == null || string.IsNullOrWhiteSpace(customResourceDefinition.Metadata.Name))
            {
                throw new ArgumentNullException(nameof(customResourceDefinition.Metadata.Name), "Metadata.Name is required.");
            }

            return(this.PutAsync <CustomResourceDefinition, CustomResourceDefinition>(CustomResourceDefinitionUrls.ObjectUrl(customResourceDefinition.Metadata.Name), payload: customResourceDefinition, cancellationToken: cancellationToken));
        }