// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.

package alexaforbusiness

import (
	"context"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)

type PutConferencePreferenceInput struct {
	_ struct{} `type:"structure"`

	// The conference preference of a specific conference provider.
	//
	// ConferencePreference is a required field
	ConferencePreference *ConferencePreference `type:"structure" required:"true"`
}

// String returns the string representation
func (s PutConferencePreferenceInput) String() string {
	return awsutil.Prettify(s)
}

// Validate inspects the fields of the type to determine if they are valid.
func (s *PutConferencePreferenceInput) Validate() error {
	invalidParams := aws.ErrInvalidParams{Context: "PutConferencePreferenceInput"}

	if s.ConferencePreference == nil {
		invalidParams.Add(aws.NewErrParamRequired("ConferencePreference"))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}

type PutConferencePreferenceOutput struct {
	_ struct{} `type:"structure"`
}

// String returns the string representation
func (s PutConferencePreferenceOutput) String() string {
	return awsutil.Prettify(s)
}

const opPutConferencePreference = "PutConferencePreference"

// PutConferencePreferenceRequest returns a request value for making API operation for
// Alexa For Business.
//
// Sets the conference preferences on a specific conference provider at the
// account level.
//
//    // Example sending a request using PutConferencePreferenceRequest.
//    req := client.PutConferencePreferenceRequest(params)
//    resp, err := req.Send(context.TODO())
//    if err == nil {
//        fmt.Println(resp)
//    }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/alexaforbusiness-2017-11-09/PutConferencePreference
func (c *Client) PutConferencePreferenceRequest(input *PutConferencePreferenceInput) PutConferencePreferenceRequest {
	op := &aws.Operation{
		Name:       opPutConferencePreference,
		HTTPMethod: "POST",
		HTTPPath:   "/",
	}

	if input == nil {
		input = &PutConferencePreferenceInput{}
	}

	req := c.newRequest(op, input, &PutConferencePreferenceOutput{})
	return PutConferencePreferenceRequest{Request: req, Input: input, Copy: c.PutConferencePreferenceRequest}
}

// PutConferencePreferenceRequest is the request type for the
// PutConferencePreference API operation.
type PutConferencePreferenceRequest struct {
	*aws.Request
	Input *PutConferencePreferenceInput
	Copy  func(*PutConferencePreferenceInput) PutConferencePreferenceRequest
}

// Send marshals and sends the PutConferencePreference API request.
func (r PutConferencePreferenceRequest) Send(ctx context.Context) (*PutConferencePreferenceResponse, error) {
	r.Request.SetContext(ctx)
	err := r.Request.Send()
	if err != nil {
		return nil, err
	}

	resp := &PutConferencePreferenceResponse{
		PutConferencePreferenceOutput: r.Request.Data.(*PutConferencePreferenceOutput),
		response:                      &aws.Response{Request: r.Request},
	}

	return resp, nil
}

// PutConferencePreferenceResponse is the response type for the
// PutConferencePreference API operation.
type PutConferencePreferenceResponse struct {
	*PutConferencePreferenceOutput

	response *aws.Response
}

// SDKResponseMetdata returns the response metadata for the
// PutConferencePreference request.
func (r *PutConferencePreferenceResponse) SDKResponseMetdata() *aws.Response {
	return r.response
}
