// Code generated by Fern. DO NOT EDIT.

package client

import (
	context "context"
	management "github.com/auth0/go-auth0/v2/management"
	core "github.com/auth0/go-auth0/v2/management/core"
	internal "github.com/auth0/go-auth0/v2/management/internal"
	option "github.com/auth0/go-auth0/v2/management/option"
	newdevice "github.com/auth0/go-auth0/v2/management/riskassessments/settings/newdevice"
)

type Client struct {
	WithRawResponse *RawClient
	NewDevice       *newdevice.Client

	options *core.RequestOptions
	baseURL string
	caller  *internal.Caller
}

func NewClient(options *core.RequestOptions) *Client {
	return &Client{
		NewDevice:       newdevice.NewClient(options),
		WithRawResponse: NewRawClient(options),
		options:         options,
		baseURL:         options.BaseURL,
		caller: internal.NewCaller(
			&internal.CallerParams{
				Client:      options.HTTPClient,
				MaxAttempts: options.MaxAttempts,
			},
		),
	}
}

// Gets the tenant settings for risk assessments
func (c *Client) Get(
	ctx context.Context,
	opts ...option.RequestOption,
) (*management.GetRiskAssessmentsSettingsResponseContent, error) {
	response, err := c.WithRawResponse.Get(
		ctx,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}

// Updates the tenant settings for risk assessments
func (c *Client) Update(
	ctx context.Context,
	request *management.UpdateRiskAssessmentsSettingsRequestContent,
	opts ...option.RequestOption,
) (*management.UpdateRiskAssessmentsSettingsResponseContent, error) {
	response, err := c.WithRawResponse.Update(
		ctx,
		request,
		opts...,
	)
	if err != nil {
		return nil, err
	}
	return response.Body, nil
}
