// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package logpush

import (
	"context"
	"errors"
	"fmt"
	"net/http"
	"slices"

	"github.com/cloudflare/cloudflare-go/v6/internal/apijson"
	"github.com/cloudflare/cloudflare-go/v6/internal/param"
	"github.com/cloudflare/cloudflare-go/v6/internal/requestconfig"
	"github.com/cloudflare/cloudflare-go/v6/option"
)

// ValidateService contains methods and other services that help with interacting
// with the cloudflare API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewValidateService] method instead.
type ValidateService struct {
	Options []option.RequestOption
}

// NewValidateService generates a new service that applies the given options to
// each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewValidateService(opts ...option.RequestOption) (r *ValidateService) {
	r = &ValidateService{}
	r.Options = opts
	return
}

// Validates destination.
func (r *ValidateService) Destination(ctx context.Context, params ValidateDestinationParams, opts ...option.RequestOption) (res *ValidateDestinationResponse, err error) {
	var env ValidateDestinationResponseEnvelope
	opts = slices.Concat(r.Options, opts)
	var accountOrZone string
	var accountOrZoneID param.Field[string]
	if params.AccountID.Value != "" && params.ZoneID.Value != "" {
		err = errors.New("account ID and zone ID are mutually exclusive")
		return
	}
	if params.AccountID.Value == "" && params.ZoneID.Value == "" {
		err = errors.New("either account ID or zone ID must be provided")
		return
	}
	if params.AccountID.Value != "" {
		accountOrZone = "accounts"
		accountOrZoneID = params.AccountID
	}
	if params.ZoneID.Value != "" {
		accountOrZone = "zones"
		accountOrZoneID = params.ZoneID
	}
	path := fmt.Sprintf("%s/%s/logpush/validate/destination", accountOrZone, accountOrZoneID)
	err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
	if err != nil {
		return
	}
	res = &env.Result
	return
}

// Checks if there is an existing job with a destination.
func (r *ValidateService) DestinationExists(ctx context.Context, params ValidateDestinationExistsParams, opts ...option.RequestOption) (res *ValidateDestinationExistsResponse, err error) {
	var env ValidateDestinationExistsResponseEnvelope
	opts = slices.Concat(r.Options, opts)
	var accountOrZone string
	var accountOrZoneID param.Field[string]
	if params.AccountID.Value != "" && params.ZoneID.Value != "" {
		err = errors.New("account ID and zone ID are mutually exclusive")
		return
	}
	if params.AccountID.Value == "" && params.ZoneID.Value == "" {
		err = errors.New("either account ID or zone ID must be provided")
		return
	}
	if params.AccountID.Value != "" {
		accountOrZone = "accounts"
		accountOrZoneID = params.AccountID
	}
	if params.ZoneID.Value != "" {
		accountOrZone = "zones"
		accountOrZoneID = params.ZoneID
	}
	path := fmt.Sprintf("%s/%s/logpush/validate/destination/exists", accountOrZone, accountOrZoneID)
	err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
	if err != nil {
		return
	}
	res = &env.Result
	return
}

// Validates logpull origin with logpull_options.
func (r *ValidateService) Origin(ctx context.Context, params ValidateOriginParams, opts ...option.RequestOption) (res *ValidateOriginResponse, err error) {
	var env ValidateOriginResponseEnvelope
	opts = slices.Concat(r.Options, opts)
	var accountOrZone string
	var accountOrZoneID param.Field[string]
	if params.AccountID.Value != "" && params.ZoneID.Value != "" {
		err = errors.New("account ID and zone ID are mutually exclusive")
		return
	}
	if params.AccountID.Value == "" && params.ZoneID.Value == "" {
		err = errors.New("either account ID or zone ID must be provided")
		return
	}
	if params.AccountID.Value != "" {
		accountOrZone = "accounts"
		accountOrZoneID = params.AccountID
	}
	if params.ZoneID.Value != "" {
		accountOrZone = "zones"
		accountOrZoneID = params.ZoneID
	}
	path := fmt.Sprintf("%s/%s/logpush/validate/origin", accountOrZone, accountOrZoneID)
	err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
	if err != nil {
		return
	}
	res = &env.Result
	return
}

type ValidateDestinationResponse struct {
	Message string                          `json:"message"`
	Valid   bool                            `json:"valid"`
	JSON    validateDestinationResponseJSON `json:"-"`
}

// validateDestinationResponseJSON contains the JSON metadata for the struct
// [ValidateDestinationResponse]
type validateDestinationResponseJSON struct {
	Message     apijson.Field
	Valid       apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationResponse) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationResponseJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationExistsResponse struct {
	Exists bool                                  `json:"exists"`
	JSON   validateDestinationExistsResponseJSON `json:"-"`
}

// validateDestinationExistsResponseJSON contains the JSON metadata for the struct
// [ValidateDestinationExistsResponse]
type validateDestinationExistsResponseJSON struct {
	Exists      apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationExistsResponse) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationExistsResponseJSON) RawJSON() string {
	return r.raw
}

type ValidateOriginResponse struct {
	Message string                     `json:"message"`
	Valid   bool                       `json:"valid"`
	JSON    validateOriginResponseJSON `json:"-"`
}

// validateOriginResponseJSON contains the JSON metadata for the struct
// [ValidateOriginResponse]
type validateOriginResponseJSON struct {
	Message     apijson.Field
	Valid       apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateOriginResponse) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateOriginResponseJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationParams struct {
	// Uniquely identifies a resource (such as an s3 bucket) where data. will be
	// pushed. Additional configuration parameters supported by the destination may be
	// included.
	DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
	// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
	AccountID param.Field[string] `path:"account_id"`
	// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
	ZoneID param.Field[string] `path:"zone_id"`
}

func (r ValidateDestinationParams) MarshalJSON() (data []byte, err error) {
	return apijson.MarshalRoot(r)
}

type ValidateDestinationResponseEnvelope struct {
	Errors   []ValidateDestinationResponseEnvelopeErrors   `json:"errors,required"`
	Messages []ValidateDestinationResponseEnvelopeMessages `json:"messages,required"`
	// Whether the API call was successful.
	Success ValidateDestinationResponseEnvelopeSuccess `json:"success,required"`
	Result  ValidateDestinationResponse                `json:"result,nullable"`
	JSON    validateDestinationResponseEnvelopeJSON    `json:"-"`
}

// validateDestinationResponseEnvelopeJSON contains the JSON metadata for the
// struct [ValidateDestinationResponseEnvelope]
type validateDestinationResponseEnvelopeJSON struct {
	Errors      apijson.Field
	Messages    apijson.Field
	Success     apijson.Field
	Result      apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationResponseEnvelopeJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationResponseEnvelopeErrors struct {
	Code             int64                                           `json:"code,required"`
	Message          string                                          `json:"message,required"`
	DocumentationURL string                                          `json:"documentation_url"`
	Source           ValidateDestinationResponseEnvelopeErrorsSource `json:"source"`
	JSON             validateDestinationResponseEnvelopeErrorsJSON   `json:"-"`
}

// validateDestinationResponseEnvelopeErrorsJSON contains the JSON metadata for the
// struct [ValidateDestinationResponseEnvelopeErrors]
type validateDestinationResponseEnvelopeErrorsJSON struct {
	Code             apijson.Field
	Message          apijson.Field
	DocumentationURL apijson.Field
	Source           apijson.Field
	raw              string
	ExtraFields      map[string]apijson.Field
}

func (r *ValidateDestinationResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationResponseEnvelopeErrorsJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationResponseEnvelopeErrorsSource struct {
	Pointer string                                              `json:"pointer"`
	JSON    validateDestinationResponseEnvelopeErrorsSourceJSON `json:"-"`
}

// validateDestinationResponseEnvelopeErrorsSourceJSON contains the JSON metadata
// for the struct [ValidateDestinationResponseEnvelopeErrorsSource]
type validateDestinationResponseEnvelopeErrorsSourceJSON struct {
	Pointer     apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationResponseEnvelopeErrorsSourceJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationResponseEnvelopeMessages struct {
	Code             int64                                             `json:"code,required"`
	Message          string                                            `json:"message,required"`
	DocumentationURL string                                            `json:"documentation_url"`
	Source           ValidateDestinationResponseEnvelopeMessagesSource `json:"source"`
	JSON             validateDestinationResponseEnvelopeMessagesJSON   `json:"-"`
}

// validateDestinationResponseEnvelopeMessagesJSON contains the JSON metadata for
// the struct [ValidateDestinationResponseEnvelopeMessages]
type validateDestinationResponseEnvelopeMessagesJSON struct {
	Code             apijson.Field
	Message          apijson.Field
	DocumentationURL apijson.Field
	Source           apijson.Field
	raw              string
	ExtraFields      map[string]apijson.Field
}

func (r *ValidateDestinationResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationResponseEnvelopeMessagesJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationResponseEnvelopeMessagesSource struct {
	Pointer string                                                `json:"pointer"`
	JSON    validateDestinationResponseEnvelopeMessagesSourceJSON `json:"-"`
}

// validateDestinationResponseEnvelopeMessagesSourceJSON contains the JSON metadata
// for the struct [ValidateDestinationResponseEnvelopeMessagesSource]
type validateDestinationResponseEnvelopeMessagesSourceJSON struct {
	Pointer     apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationResponseEnvelopeMessagesSourceJSON) RawJSON() string {
	return r.raw
}

// Whether the API call was successful.
type ValidateDestinationResponseEnvelopeSuccess bool

const (
	ValidateDestinationResponseEnvelopeSuccessTrue ValidateDestinationResponseEnvelopeSuccess = true
)

func (r ValidateDestinationResponseEnvelopeSuccess) IsKnown() bool {
	switch r {
	case ValidateDestinationResponseEnvelopeSuccessTrue:
		return true
	}
	return false
}

type ValidateDestinationExistsParams struct {
	// Uniquely identifies a resource (such as an s3 bucket) where data. will be
	// pushed. Additional configuration parameters supported by the destination may be
	// included.
	DestinationConf param.Field[string] `json:"destination_conf,required" format:"uri"`
	// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
	AccountID param.Field[string] `path:"account_id"`
	// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
	ZoneID param.Field[string] `path:"zone_id"`
}

func (r ValidateDestinationExistsParams) MarshalJSON() (data []byte, err error) {
	return apijson.MarshalRoot(r)
}

type ValidateDestinationExistsResponseEnvelope struct {
	Errors   []ValidateDestinationExistsResponseEnvelopeErrors   `json:"errors,required"`
	Messages []ValidateDestinationExistsResponseEnvelopeMessages `json:"messages,required"`
	// Whether the API call was successful.
	Success ValidateDestinationExistsResponseEnvelopeSuccess `json:"success,required"`
	Result  ValidateDestinationExistsResponse                `json:"result,nullable"`
	JSON    validateDestinationExistsResponseEnvelopeJSON    `json:"-"`
}

// validateDestinationExistsResponseEnvelopeJSON contains the JSON metadata for the
// struct [ValidateDestinationExistsResponseEnvelope]
type validateDestinationExistsResponseEnvelopeJSON struct {
	Errors      apijson.Field
	Messages    apijson.Field
	Success     apijson.Field
	Result      apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationExistsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationExistsResponseEnvelopeJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationExistsResponseEnvelopeErrors struct {
	Code             int64                                                 `json:"code,required"`
	Message          string                                                `json:"message,required"`
	DocumentationURL string                                                `json:"documentation_url"`
	Source           ValidateDestinationExistsResponseEnvelopeErrorsSource `json:"source"`
	JSON             validateDestinationExistsResponseEnvelopeErrorsJSON   `json:"-"`
}

// validateDestinationExistsResponseEnvelopeErrorsJSON contains the JSON metadata
// for the struct [ValidateDestinationExistsResponseEnvelopeErrors]
type validateDestinationExistsResponseEnvelopeErrorsJSON struct {
	Code             apijson.Field
	Message          apijson.Field
	DocumentationURL apijson.Field
	Source           apijson.Field
	raw              string
	ExtraFields      map[string]apijson.Field
}

func (r *ValidateDestinationExistsResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationExistsResponseEnvelopeErrorsJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationExistsResponseEnvelopeErrorsSource struct {
	Pointer string                                                    `json:"pointer"`
	JSON    validateDestinationExistsResponseEnvelopeErrorsSourceJSON `json:"-"`
}

// validateDestinationExistsResponseEnvelopeErrorsSourceJSON contains the JSON
// metadata for the struct [ValidateDestinationExistsResponseEnvelopeErrorsSource]
type validateDestinationExistsResponseEnvelopeErrorsSourceJSON struct {
	Pointer     apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationExistsResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationExistsResponseEnvelopeErrorsSourceJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationExistsResponseEnvelopeMessages struct {
	Code             int64                                                   `json:"code,required"`
	Message          string                                                  `json:"message,required"`
	DocumentationURL string                                                  `json:"documentation_url"`
	Source           ValidateDestinationExistsResponseEnvelopeMessagesSource `json:"source"`
	JSON             validateDestinationExistsResponseEnvelopeMessagesJSON   `json:"-"`
}

// validateDestinationExistsResponseEnvelopeMessagesJSON contains the JSON metadata
// for the struct [ValidateDestinationExistsResponseEnvelopeMessages]
type validateDestinationExistsResponseEnvelopeMessagesJSON struct {
	Code             apijson.Field
	Message          apijson.Field
	DocumentationURL apijson.Field
	Source           apijson.Field
	raw              string
	ExtraFields      map[string]apijson.Field
}

func (r *ValidateDestinationExistsResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationExistsResponseEnvelopeMessagesJSON) RawJSON() string {
	return r.raw
}

type ValidateDestinationExistsResponseEnvelopeMessagesSource struct {
	Pointer string                                                      `json:"pointer"`
	JSON    validateDestinationExistsResponseEnvelopeMessagesSourceJSON `json:"-"`
}

// validateDestinationExistsResponseEnvelopeMessagesSourceJSON contains the JSON
// metadata for the struct
// [ValidateDestinationExistsResponseEnvelopeMessagesSource]
type validateDestinationExistsResponseEnvelopeMessagesSourceJSON struct {
	Pointer     apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateDestinationExistsResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateDestinationExistsResponseEnvelopeMessagesSourceJSON) RawJSON() string {
	return r.raw
}

// Whether the API call was successful.
type ValidateDestinationExistsResponseEnvelopeSuccess bool

const (
	ValidateDestinationExistsResponseEnvelopeSuccessTrue ValidateDestinationExistsResponseEnvelopeSuccess = true
)

func (r ValidateDestinationExistsResponseEnvelopeSuccess) IsKnown() bool {
	switch r {
	case ValidateDestinationExistsResponseEnvelopeSuccessTrue:
		return true
	}
	return false
}

type ValidateOriginParams struct {
	// This field is deprecated. Use `output_options` instead. Configuration string. It
	// specifies things like requested fields and timestamp formats. If migrating from
	// the logpull api, copy the url (full url or just the query string) of your call
	// here, and logpush will keep on making this call for you, setting start and end
	// times appropriately.
	LogpullOptions param.Field[string] `json:"logpull_options,required" format:"uri-reference"`
	// The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
	AccountID param.Field[string] `path:"account_id"`
	// The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
	ZoneID param.Field[string] `path:"zone_id"`
}

func (r ValidateOriginParams) MarshalJSON() (data []byte, err error) {
	return apijson.MarshalRoot(r)
}

type ValidateOriginResponseEnvelope struct {
	Errors   []ValidateOriginResponseEnvelopeErrors   `json:"errors,required"`
	Messages []ValidateOriginResponseEnvelopeMessages `json:"messages,required"`
	// Whether the API call was successful.
	Success ValidateOriginResponseEnvelopeSuccess `json:"success,required"`
	Result  ValidateOriginResponse                `json:"result,nullable"`
	JSON    validateOriginResponseEnvelopeJSON    `json:"-"`
}

// validateOriginResponseEnvelopeJSON contains the JSON metadata for the struct
// [ValidateOriginResponseEnvelope]
type validateOriginResponseEnvelopeJSON struct {
	Errors      apijson.Field
	Messages    apijson.Field
	Success     apijson.Field
	Result      apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateOriginResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateOriginResponseEnvelopeJSON) RawJSON() string {
	return r.raw
}

type ValidateOriginResponseEnvelopeErrors struct {
	Code             int64                                      `json:"code,required"`
	Message          string                                     `json:"message,required"`
	DocumentationURL string                                     `json:"documentation_url"`
	Source           ValidateOriginResponseEnvelopeErrorsSource `json:"source"`
	JSON             validateOriginResponseEnvelopeErrorsJSON   `json:"-"`
}

// validateOriginResponseEnvelopeErrorsJSON contains the JSON metadata for the
// struct [ValidateOriginResponseEnvelopeErrors]
type validateOriginResponseEnvelopeErrorsJSON struct {
	Code             apijson.Field
	Message          apijson.Field
	DocumentationURL apijson.Field
	Source           apijson.Field
	raw              string
	ExtraFields      map[string]apijson.Field
}

func (r *ValidateOriginResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateOriginResponseEnvelopeErrorsJSON) RawJSON() string {
	return r.raw
}

type ValidateOriginResponseEnvelopeErrorsSource struct {
	Pointer string                                         `json:"pointer"`
	JSON    validateOriginResponseEnvelopeErrorsSourceJSON `json:"-"`
}

// validateOriginResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
// the struct [ValidateOriginResponseEnvelopeErrorsSource]
type validateOriginResponseEnvelopeErrorsSourceJSON struct {
	Pointer     apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateOriginResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateOriginResponseEnvelopeErrorsSourceJSON) RawJSON() string {
	return r.raw
}

type ValidateOriginResponseEnvelopeMessages struct {
	Code             int64                                        `json:"code,required"`
	Message          string                                       `json:"message,required"`
	DocumentationURL string                                       `json:"documentation_url"`
	Source           ValidateOriginResponseEnvelopeMessagesSource `json:"source"`
	JSON             validateOriginResponseEnvelopeMessagesJSON   `json:"-"`
}

// validateOriginResponseEnvelopeMessagesJSON contains the JSON metadata for the
// struct [ValidateOriginResponseEnvelopeMessages]
type validateOriginResponseEnvelopeMessagesJSON struct {
	Code             apijson.Field
	Message          apijson.Field
	DocumentationURL apijson.Field
	Source           apijson.Field
	raw              string
	ExtraFields      map[string]apijson.Field
}

func (r *ValidateOriginResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateOriginResponseEnvelopeMessagesJSON) RawJSON() string {
	return r.raw
}

type ValidateOriginResponseEnvelopeMessagesSource struct {
	Pointer string                                           `json:"pointer"`
	JSON    validateOriginResponseEnvelopeMessagesSourceJSON `json:"-"`
}

// validateOriginResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
// the struct [ValidateOriginResponseEnvelopeMessagesSource]
type validateOriginResponseEnvelopeMessagesSourceJSON struct {
	Pointer     apijson.Field
	raw         string
	ExtraFields map[string]apijson.Field
}

func (r *ValidateOriginResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
	return apijson.UnmarshalRoot(data, r)
}

func (r validateOriginResponseEnvelopeMessagesSourceJSON) RawJSON() string {
	return r.raw
}

// Whether the API call was successful.
type ValidateOriginResponseEnvelopeSuccess bool

const (
	ValidateOriginResponseEnvelopeSuccessTrue ValidateOriginResponseEnvelopeSuccess = true
)

func (r ValidateOriginResponseEnvelopeSuccess) IsKnown() bool {
	switch r {
	case ValidateOriginResponseEnvelopeSuccessTrue:
		return true
	}
	return false
}
