<?php
declare(strict_types=1);

// THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY.

namespace Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output;

use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output\SelectedAttribute;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Enums\ProductStatus as ProductStatusType;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Enums\ProductType as ProductTypeType;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Enums\StockStatus as StockStatusType;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output\ProductDimensions;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output\ProductImage;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output\ProductAttribute;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Pagination\ProductReviewConnection as ProductReviewConnectionType;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Scalars\DateTime as DateTimeType;
use Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Interfaces\Product as ProductInterface;
use Automattic\WooCommerce\Internal\Api\Schema\ObjectType;
use Automattic\WooCommerce\Internal\Api\Schema\Type;

class ProductVariation {
	private static ?ObjectType $instance = null;

	public static function get(): ObjectType {
		if ( null === self::$instance ) {
			self::$instance = new ObjectType(
				array(
					'name'        => 'ProductVariation',
					'description' => __( 'A product variation.', 'woocommerce' ),
					'interfaces'  => fn() => array(
						ProductInterface::get(),
					),
					'fields'      => fn() => array(
						'parent_id'           => array(
							'type'        => Type::nonNull( Type::int() ),
							'description' => __( 'The parent variable product ID.', 'woocommerce' ),
						),
						'selected_attributes' => array(
							'type'        => Type::nonNull( Type::listOf( Type::nonNull( SelectedAttribute::get() ) ) ),
							'description' => __( 'The selected attribute values for this variation.', 'woocommerce' ),
						),
						'name'                => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The product name.', 'woocommerce' ),
						),
						'slug'                => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The product slug.', 'woocommerce' ),
						),
						'sku'                 => array(
							'type'        => Type::string(),
							'description' => __( 'The product SKU.', 'woocommerce' ),
						),
						'description'         => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The full product description.', 'woocommerce' ),
						),
						'short_description'   => array(
							'type'              => Type::nonNull( Type::string() ),
							'description'       => __( 'The short product description.', 'woocommerce' ),
							'deprecationReason' => 'Use description instead.',
						),
						'status'              => array(
							'type'        => Type::nonNull( ProductStatusType::get() ),
							'description' => __( 'The product status.', 'woocommerce' ),
						),
						'raw_status'          => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The raw status as stored in WordPress. Useful when status is OTHER (e.g. plugin-added post statuses).', 'woocommerce' ),
						),
						'product_type'        => array(
							'type'        => Type::nonNull( ProductTypeType::get() ),
							'description' => __( 'The product type.', 'woocommerce' ),
						),
						'raw_product_type'    => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The raw product type as stored in WooCommerce. Useful when product_type is OTHER (e.g. plugin-added types like subscription, bundle).', 'woocommerce' ),
						),
						'regular_price'       => array(
							'type'        => Type::string(),
							'description' => __( 'The regular price of the product. Null when not set.', 'woocommerce' ),
							'args'        => array(
								'formatted' => array(
									'type'         => Type::boolean(),
									'defaultValue' => true,
									'description'  => __( 'Whether to apply currency formatting.', 'woocommerce' ),
								),
							),
						),
						'sale_price'          => array(
							'type'        => Type::string(),
							'description' => __( 'The sale price of the product.', 'woocommerce' ),
							'args'        => array(
								'formatted' => array(
									'type'         => Type::boolean(),
									'defaultValue' => true,
									'description'  => __( 'When true, returns price with currency symbol.', 'woocommerce' ),
								),
							),
						),
						'stock_status'        => array(
							'type'        => Type::nonNull( StockStatusType::get() ),
							'description' => __( 'The stock status of the product.', 'woocommerce' ),
						),
						'raw_stock_status'    => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The raw stock status as stored in WooCommerce. Useful when stock_status is OTHER (e.g. plugin-added statuses).', 'woocommerce' ),
						),
						'stock_quantity'      => array(
							'type'        => Type::int(),
							'description' => __( 'The number of items in stock.', 'woocommerce' ),
						),
						'dimensions'          => array(
							'type'        => ProductDimensions::get(),
							'description' => __( 'The product dimensions.', 'woocommerce' ),
						),
						'images'              => array(
							'type'        => Type::nonNull( Type::listOf( Type::nonNull( ProductImage::get() ) ) ),
							'description' => __( 'The product images.', 'woocommerce' ),
						),
						'attributes'          => array(
							'type'        => Type::nonNull( Type::listOf( Type::nonNull( ProductAttribute::get() ) ) ),
							'description' => __( 'The product attributes.', 'woocommerce' ),
						),
						'reviews'             => array(
							'type'        => Type::nonNull( ProductReviewConnectionType::get() ),
							'description' => __( 'Customer reviews for this product.', 'woocommerce' ),
						),
						'date_created'        => array(
							'type'        => DateTimeType::get(),
							'description' => __( 'The date the product was created.', 'woocommerce' ),
						),
						'date_modified'       => array(
							'type'        => DateTimeType::get(),
							'description' => __( 'The date the product was last modified.', 'woocommerce' ),
						),
						'id'                  => array(
							'type'        => Type::nonNull( Type::int() ),
							'description' => __( 'The unique numeric identifier.', 'woocommerce' ),
						),
					),
				)
			);
		}
		return self::$instance;
	}
}
