// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** The EndpointScheduleAction model. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType")
@JsonTypeName("InvokeBatchEndpoint")
@Fluent
public final class EndpointScheduleAction extends ScheduleActionBase {
    /*
     * [Required] Defines Schedule action definition details.
     * <see href="TBD" />
     */
    @JsonProperty(value = "endpointInvocationDefinition", required = true)
    private Object endpointInvocationDefinition;

    /** Creates an instance of EndpointScheduleAction class. */
    public EndpointScheduleAction() {
    }

    /**
     * Get the endpointInvocationDefinition property: [Required] Defines Schedule action definition details. &lt;see
     * href="TBD" /&gt;.
     *
     * @return the endpointInvocationDefinition value.
     */
    public Object endpointInvocationDefinition() {
        return this.endpointInvocationDefinition;
    }

    /**
     * Set the endpointInvocationDefinition property: [Required] Defines Schedule action definition details. &lt;see
     * href="TBD" /&gt;.
     *
     * @param endpointInvocationDefinition the endpointInvocationDefinition value to set.
     * @return the EndpointScheduleAction object itself.
     */
    public EndpointScheduleAction withEndpointInvocationDefinition(Object endpointInvocationDefinition) {
        this.endpointInvocationDefinition = endpointInvocationDefinition;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (endpointInvocationDefinition() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property endpointInvocationDefinition in model EndpointScheduleAction"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(EndpointScheduleAction.class);
}
