// Copyright (c) 2025 Aiven, Helsinki, Finland. https://aiven.io/
// Code generated by user config generator. DO NOT EDIT.

package billinggrouplist

import (
	"context"

	"github.com/hashicorp/terraform-plugin-framework-timeouts/datasource/timeouts"
	"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
	"github.com/hashicorp/terraform-plugin-framework/types"

	"github.com/aiven/terraform-provider-aiven/internal/plugin/adapter"
)

func newDatasourceModel() adapter.Model[tfModel] {
	return new(datasourceModel)
}

// datasourceModel with specific datasource timeouts
type datasourceModel struct {
	tfModel
	Timeouts timeouts.Value `tfsdk:"timeouts"`
}

func (tf *datasourceModel) SharedModel() *tfModel {
	return &tf.tfModel
}

func (tf *datasourceModel) TimeoutsObject() types.Object {
	return tf.Timeouts.Object
}

/*
newDatasourceSchema:

	data "aiven_organization_billing_group_list" "example" {
	  organization_id = "org1a23f456789"

	  // COMPUTED FIELDS
	  billing_groups {
	    billing_address_id     = "foo"
	    billing_contact_emails = ["test@example.com"]
	    billing_emails         = ["test@example.com"]
	    billing_group_id       = "foo"
	    billing_group_name     = "test"
	    currency               = "AUD"
	    custom_invoice_text    = "foo"
	    organization_id        = "org1a23f456789"
	    payment_method_id      = "foo"
	    shipping_address_id    = "foo"
	    vat_id                 = "foo"
	  }
	}
*/
func newDatasourceSchema(ctx context.Context) schema.Schema {
	return schema.Schema{
		Attributes: map[string]schema.Attribute{
			"id": schema.StringAttribute{
				Computed:            true,
				MarkdownDescription: "Resource ID, equal to `organization_id`.",
			},
			"organization_id": schema.StringAttribute{
				MarkdownDescription: "ID of an organization.",
				Required:            true,
			},
		},
		Blocks: map[string]schema.Block{
			"billing_groups": schema.SetNestedBlock{
				MarkdownDescription: "A list of all billing groups belonging to the organization.",
				NestedObject: schema.NestedBlockObject{Attributes: map[string]schema.Attribute{
					"billing_address_id": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Billing address ID.",
					},
					"billing_contact_emails": schema.SetAttribute{
						Computed:            true,
						ElementType:         types.StringType,
						MarkdownDescription: "List of billing contact emails.",
					},
					"billing_emails": schema.SetAttribute{
						Computed:            true,
						ElementType:         types.StringType,
						MarkdownDescription: "List of billing contact emails.",
					},
					"billing_group_id": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Billing group ID.",
					},
					"billing_group_name": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Billing Group Name.",
					},
					"currency": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Acceptable currencies for a billing group. The possible values are `AUD`, `CAD`, `CHF`, `DKK`, `EUR`, `GBP`, `JPY`, `NOK`, `NZD`, `SEK`, `SGD` and `USD`.",
					},
					"custom_invoice_text": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Extra billing text.",
					},
					"organization_id": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Organization ID.",
					},
					"payment_method_id": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Payment method ID.",
					},
					"shipping_address_id": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "Shipping address ID.",
					},
					"vat_id": schema.StringAttribute{
						Computed:            true,
						MarkdownDescription: "VAT ID.",
					},
				}},
			},
			"timeouts": timeouts.Block(ctx),
		},
		MarkdownDescription: "Lists billing groups for an organization. \n\n**This resource is in the beta stage and may change without notice.** Set\nthe `PROVIDER_AIVEN_ENABLE_BETA` environment variable to use the resource.",
	}
}
